bonnetid-ui 0.0.0 → 0.0.1

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 (105) hide show
  1. package/dist/App.d.ts +1 -1
  2. package/dist/app/assets/{index-B8PCs-AY.css → index-BChLUg01.css} +1 -1
  3. package/dist/app/assets/index-BeH2CXvV.js +1169 -0
  4. package/dist/app/assets/{index.es-BE6LkVtq.js → index.es-Bwf93iys.js} +6 -6
  5. package/dist/app/assets/purify.es-CPrKKeqe.js +3 -0
  6. package/dist/app/index.html +2 -2
  7. package/dist/app/manifest.webmanifest +1 -1
  8. package/dist/app/sw.js +1 -1
  9. package/dist/app/workbox-9c191d2f.js +1 -0
  10. package/dist/components/lobby1/AnnouncementBar.d.ts +1 -1
  11. package/dist/components/lobby1/Carousel.d.ts +1 -1
  12. package/dist/components/lobby1/SmallPrayerTable.d.ts +1 -1
  13. package/dist/components/lobby2/PrayerBoxes.d.ts +1 -1
  14. package/dist/components/lobby3/Countdown.d.ts +4 -3
  15. package/dist/components/lobby3/LobbyTimetable.d.ts +1 -1
  16. package/dist/components/miscellaneous/ButtonSpin.d.ts +1 -1
  17. package/dist/components/miscellaneous/DownloadModal.d.ts +1 -1
  18. package/dist/components/miscellaneous/ErrorFallback.d.ts +2 -2
  19. package/dist/components/miscellaneous/Spin.d.ts +1 -1
  20. package/dist/components/ph1/Instruction.d.ts +1 -1
  21. package/dist/components/ph1/MasjidLogo.d.ts +1 -1
  22. package/dist/components/ph1/MasjidPrayerClock.d.ts +5 -3
  23. package/dist/components/ph1/PrayerClockPH1.d.ts +2 -1
  24. package/dist/components/ph1/TimeTablePH1.d.ts +1 -1
  25. package/dist/components/ph2/PrayerTimeBox.d.ts +1 -1
  26. package/dist/components/ph3/CountdownVisual.d.ts +4 -3
  27. package/dist/components/ph3/DateInfo.d.ts +1 -1
  28. package/dist/components/ph3/DigitalClock.d.ts +1 -1
  29. package/dist/components/ud/DateSelector.d.ts +1 -1
  30. package/dist/components/ud/Header.d.ts +2 -1
  31. package/dist/components/ud/HijriCalendar.d.ts +1 -1
  32. package/dist/components/ud/MasjidSelect.d.ts +1 -1
  33. package/dist/components/ud/PrayerTimetable.d.ts +1 -1
  34. package/dist/components/ud/Time.d.ts +1 -1
  35. package/dist/config/arabic-prayer-names.d.ts +3 -0
  36. package/dist/config/instruction-show-seconds.d.ts +1 -0
  37. package/dist/config/iqamah-window-duration.d.ts +1 -0
  38. package/dist/context/GlobalLanguageProvider.d.ts +1 -0
  39. package/dist/context/MosqueLanguageContext.d.ts +11 -0
  40. package/dist/context/ThemeContext.d.ts +1 -1
  41. package/dist/context/UDContext.d.ts +3 -1
  42. package/dist/context/UDProviderWrapper.d.ts +1 -1
  43. package/dist/database-services/MasjidService.d.ts +1 -1
  44. package/dist/database-services/PrayerTimesService.d.ts +3 -1
  45. package/dist/hooks/useIqamahCheck.d.ts +2 -1
  46. package/dist/hooks/useMasjidInfo.d.ts +2 -0
  47. package/dist/hooks/usePrayerTimes.d.ts +2 -1
  48. package/dist/hooks/usePrayerTimesUD.d.ts +4 -2
  49. package/dist/index.d.ts +1 -25
  50. package/dist/layout-components/lobby1/AnnouncementPart.d.ts +4 -3
  51. package/dist/layout-components/lobby1/ClockAndTime.d.ts +4 -3
  52. package/dist/layout-components/lobby1/TablePart.d.ts +4 -3
  53. package/dist/layout-components/lobby2/PrayerPart.d.ts +4 -3
  54. package/dist/layout-components/lobby3/TimePart.d.ts +1 -1
  55. package/dist/layout-components/ph1/ClockPart.d.ts +5 -3
  56. package/dist/layout-components/ph1/TimeTablePart.d.ts +1 -1
  57. package/dist/layout-components/ph2/ClockAndPrayers.d.ts +4 -3
  58. package/dist/layout-components/ph2/CountdownBox.d.ts +4 -3
  59. package/dist/layout-components/ph2/ExtraInfo.d.ts +1 -1
  60. package/dist/layout-components/ph2/TimeAndDate.d.ts +1 -1
  61. package/dist/layout-components/ph3/DigitalClockPart.d.ts +5 -4
  62. package/dist/layout-components/ph3/TimeTable.d.ts +1 -1
  63. package/dist/lib/index.css +1 -1
  64. package/dist/lib/manifest.webmanifest +1 -0
  65. package/dist/lib/my-ui-library.es.js +24208 -39
  66. package/dist/lib/my-ui-library.umd.js +53 -324
  67. package/dist/lib/registerSW.js +1 -0
  68. package/dist/lib/sw.js +1 -0
  69. package/dist/lib/workbox-9c191d2f.js +1 -0
  70. package/dist/pages/IqamahScreen.d.ts +1 -1
  71. package/dist/pages/Lobby1.d.ts +1 -1
  72. package/dist/pages/Lobby2.d.ts +1 -1
  73. package/dist/pages/Lobby3.d.ts +1 -1
  74. package/dist/pages/NotFound.d.ts +1 -1
  75. package/dist/pages/PH1.d.ts +1 -1
  76. package/dist/pages/PH2.d.ts +1 -1
  77. package/dist/pages/PH3.d.ts +4 -1
  78. package/dist/pages/ud/DownloadTimetable.d.ts +1 -1
  79. package/dist/pages/ud/Events.d.ts +1 -1
  80. package/dist/pages/ud/UD1.d.ts +1 -1
  81. package/dist/pages/ud/UD2.d.ts +1 -1
  82. package/dist/pages/ud/UD3.d.ts +1 -1
  83. package/dist/pages/ud/ViewTimetable.d.ts +1 -1
  84. package/dist/renderer/lobby/LobbyLayoutRenderer.d.ts +2 -1
  85. package/dist/renderer/lobby/LobbyRenderer.d.ts +1 -1
  86. package/dist/renderer/prayer-hall/PrayerHallLayoutRenderer.d.ts +2 -1
  87. package/dist/renderer/prayer-hall/PrayerHallRenderer.d.ts +1 -1
  88. package/dist/renderer/user-display/UDLayoutRenderer.d.ts +2 -1
  89. package/dist/renderer/user-display/UDRenderer.d.ts +1 -1
  90. package/dist/routes/AppRoutes.d.ts +1 -1
  91. package/dist/types/types.d.ts +6 -0
  92. package/dist/utils/CustomInput.d.ts +1 -1
  93. package/dist/utils/countdown.d.ts +8 -2
  94. package/dist/utils/idb/prayerTimesDB.d.ts +2 -1
  95. package/dist/utils/idb/udPrayerTimesDB.d.ts +2 -1
  96. package/dist/utils/prayertimeHelpers.d.ts +4 -0
  97. package/dist/utils/timeHelpers.d.ts +2 -0
  98. package/package.json +3 -1
  99. package/dist/app/assets/index-CQIIfC-Z.js +0 -345
  100. package/dist/app/assets/purify.es-B9ZVCkUG.js +0 -2
  101. package/dist/app/workbox-1ef09536.js +0 -1
  102. package/dist/lib/html2canvas.esm-dgT_1dIT.js +0 -4871
  103. package/dist/lib/index-BL2PYeMT.js +0 -32882
  104. package/dist/lib/index.es-DFW-PnlO.js +0 -6656
  105. package/dist/lib/purify.es-BpFm6ZGf.js +0 -553
@@ -1,345 +0,0 @@
1
- var dA=Object.defineProperty;var pA=(t,e,n)=>e in t?dA(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var tr=(t,e,n)=>pA(t,typeof e!="symbol"?e+"":e,n);function mA(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const a in r)if(a!=="default"&&!(a in t)){const s=Object.getOwnPropertyDescriptor(r,a);s&&Object.defineProperty(t,a,s.get?s:{enumerable:!0,get:()=>r[a]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const s of a)if(s.type==="childList")for(const l of s.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(a){const s={};return a.integrity&&(s.integrity=a.integrity),a.referrerPolicy&&(s.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?s.credentials="include":a.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(a){if(a.ep)return;a.ep=!0;const s=n(a);fetch(a.href,s)}})();var fz=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Bm(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var C0={exports:{}},Sh={};/**
2
- * @license React
3
- * react-jsx-runtime.production.js
4
- *
5
- * Copyright (c) Meta Platforms, Inc. and affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var Xb;function gA(){if(Xb)return Sh;Xb=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(r,a,s){var l=null;if(s!==void 0&&(l=""+s),a.key!==void 0&&(l=""+a.key),"key"in a){s={};for(var u in a)u!=="key"&&(s[u]=a[u])}else s=a;return a=s.ref,{$$typeof:t,type:r,key:l,ref:a!==void 0?a:null,props:s}}return Sh.Fragment=e,Sh.jsx=n,Sh.jsxs=n,Sh}var Zb;function vA(){return Zb||(Zb=1,C0.exports=gA()),C0.exports}var _=vA(),T0={exports:{}},on={};/**
10
- * @license React
11
- * react.production.js
12
- *
13
- * Copyright (c) Meta Platforms, Inc. and affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var Qb;function yA(){if(Qb)return on;Qb=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),y=Symbol.iterator;function m(U){return U===null||typeof U!="object"?null:(U=y&&U[y]||U["@@iterator"],typeof U=="function"?U:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,A={};function N(U,j,Y){this.props=U,this.context=j,this.refs=A,this.updater=Y||x}N.prototype.isReactComponent={},N.prototype.setState=function(U,j){if(typeof U!="object"&&typeof U!="function"&&U!=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,U,j,"setState")},N.prototype.forceUpdate=function(U){this.updater.enqueueForceUpdate(this,U,"forceUpdate")};function O(){}O.prototype=N.prototype;function T(U,j,Y){this.props=U,this.context=j,this.refs=A,this.updater=Y||x}var D=T.prototype=new O;D.constructor=T,E(D,N.prototype),D.isPureReactComponent=!0;var F=Array.isArray;function Q(){}var P={H:null,A:null,T:null,S:null},$=Object.prototype.hasOwnProperty;function B(U,j,Y){var K=Y.ref;return{$$typeof:t,type:U,key:j,ref:K!==void 0?K:null,props:Y}}function ne(U,j){return B(U.type,j,U.props)}function I(U){return typeof U=="object"&&U!==null&&U.$$typeof===t}function z(U){var j={"=":"=0",":":"=2"};return"$"+U.replace(/[=:]/g,function(Y){return j[Y]})}var J=/\/+/g;function ae(U,j){return typeof U=="object"&&U!==null&&U.key!=null?z(""+U.key):j.toString(36)}function me(U){switch(U.status){case"fulfilled":return U.value;case"rejected":throw U.reason;default:switch(typeof U.status=="string"?U.then(Q,Q):(U.status="pending",U.then(function(j){U.status==="pending"&&(U.status="fulfilled",U.value=j)},function(j){U.status==="pending"&&(U.status="rejected",U.reason=j)})),U.status){case"fulfilled":return U.value;case"rejected":throw U.reason}}throw U}function Z(U,j,Y,K,ie){var V=typeof U;(V==="undefined"||V==="boolean")&&(U=null);var se=!1;if(U===null)se=!0;else switch(V){case"bigint":case"string":case"number":se=!0;break;case"object":switch(U.$$typeof){case t:case e:se=!0;break;case d:return se=U._init,Z(se(U._payload),j,Y,K,ie)}}if(se)return ie=ie(U),se=K===""?"."+ae(U,0):K,F(ie)?(Y="",se!=null&&(Y=se.replace(J,"$&/")+"/"),Z(ie,j,Y,"",function(Oe){return Oe})):ie!=null&&(I(ie)&&(ie=ne(ie,Y+(ie.key==null||U&&U.key===ie.key?"":(""+ie.key).replace(J,"$&/")+"/")+se)),j.push(ie)),1;se=0;var be=K===""?".":K+":";if(F(U))for(var xe=0;xe<U.length;xe++)K=U[xe],V=be+ae(K,xe),se+=Z(K,j,Y,V,ie);else if(xe=m(U),typeof xe=="function")for(U=xe.call(U),xe=0;!(K=U.next()).done;)K=K.value,V=be+ae(K,xe++),se+=Z(K,j,Y,V,ie);else if(V==="object"){if(typeof U.then=="function")return Z(me(U),j,Y,K,ie);throw j=String(U),Error("Objects are not valid as a React child (found: "+(j==="[object Object]"?"object with keys {"+Object.keys(U).join(", ")+"}":j)+"). If you meant to render a collection of children, use an array instead.")}return se}function ce(U,j,Y){if(U==null)return U;var K=[],ie=0;return Z(U,K,"","",function(V){return j.call(Y,V,ie++)}),K}function oe(U){if(U._status===-1){var j=U._result;j=j(),j.then(function(Y){(U._status===0||U._status===-1)&&(U._status=1,U._result=Y)},function(Y){(U._status===0||U._status===-1)&&(U._status=2,U._result=Y)}),U._status===-1&&(U._status=0,U._result=j)}if(U._status===1)return U._result.default;throw U._result}var ge=typeof reportError=="function"?reportError:function(U){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var j=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof U=="object"&&U!==null&&typeof U.message=="string"?String(U.message):String(U),error:U});if(!window.dispatchEvent(j))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",U);return}console.error(U)},he={map:ce,forEach:function(U,j,Y){ce(U,function(){j.apply(this,arguments)},Y)},count:function(U){var j=0;return ce(U,function(){j++}),j},toArray:function(U){return ce(U,function(j){return j})||[]},only:function(U){if(!I(U))throw Error("React.Children.only expected to receive a single React element child.");return U}};return on.Activity=g,on.Children=he,on.Component=N,on.Fragment=n,on.Profiler=a,on.PureComponent=T,on.StrictMode=r,on.Suspense=c,on.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=P,on.__COMPILER_RUNTIME={__proto__:null,c:function(U){return P.H.useMemoCache(U)}},on.cache=function(U){return function(){return U.apply(null,arguments)}},on.cacheSignal=function(){return null},on.cloneElement=function(U,j,Y){if(U==null)throw Error("The argument must be a React element, but you passed "+U+".");var K=E({},U.props),ie=U.key;if(j!=null)for(V in j.key!==void 0&&(ie=""+j.key),j)!$.call(j,V)||V==="key"||V==="__self"||V==="__source"||V==="ref"&&j.ref===void 0||(K[V]=j[V]);var V=arguments.length-2;if(V===1)K.children=Y;else if(1<V){for(var se=Array(V),be=0;be<V;be++)se[be]=arguments[be+2];K.children=se}return B(U.type,ie,K)},on.createContext=function(U){return U={$$typeof:l,_currentValue:U,_currentValue2:U,_threadCount:0,Provider:null,Consumer:null},U.Provider=U,U.Consumer={$$typeof:s,_context:U},U},on.createElement=function(U,j,Y){var K,ie={},V=null;if(j!=null)for(K in j.key!==void 0&&(V=""+j.key),j)$.call(j,K)&&K!=="key"&&K!=="__self"&&K!=="__source"&&(ie[K]=j[K]);var se=arguments.length-2;if(se===1)ie.children=Y;else if(1<se){for(var be=Array(se),xe=0;xe<se;xe++)be[xe]=arguments[xe+2];ie.children=be}if(U&&U.defaultProps)for(K in se=U.defaultProps,se)ie[K]===void 0&&(ie[K]=se[K]);return B(U,V,ie)},on.createRef=function(){return{current:null}},on.forwardRef=function(U){return{$$typeof:u,render:U}},on.isValidElement=I,on.lazy=function(U){return{$$typeof:d,_payload:{_status:-1,_result:U},_init:oe}},on.memo=function(U,j){return{$$typeof:h,type:U,compare:j===void 0?null:j}},on.startTransition=function(U){var j=P.T,Y={};P.T=Y;try{var K=U(),ie=P.S;ie!==null&&ie(Y,K),typeof K=="object"&&K!==null&&typeof K.then=="function"&&K.then(Q,ge)}catch(V){ge(V)}finally{j!==null&&Y.types!==null&&(j.types=Y.types),P.T=j}},on.unstable_useCacheRefresh=function(){return P.H.useCacheRefresh()},on.use=function(U){return P.H.use(U)},on.useActionState=function(U,j,Y){return P.H.useActionState(U,j,Y)},on.useCallback=function(U,j){return P.H.useCallback(U,j)},on.useContext=function(U){return P.H.useContext(U)},on.useDebugValue=function(){},on.useDeferredValue=function(U,j){return P.H.useDeferredValue(U,j)},on.useEffect=function(U,j){return P.H.useEffect(U,j)},on.useEffectEvent=function(U){return P.H.useEffectEvent(U)},on.useId=function(){return P.H.useId()},on.useImperativeHandle=function(U,j,Y){return P.H.useImperativeHandle(U,j,Y)},on.useInsertionEffect=function(U,j){return P.H.useInsertionEffect(U,j)},on.useLayoutEffect=function(U,j){return P.H.useLayoutEffect(U,j)},on.useMemo=function(U,j){return P.H.useMemo(U,j)},on.useOptimistic=function(U,j){return P.H.useOptimistic(U,j)},on.useReducer=function(U,j,Y){return P.H.useReducer(U,j,Y)},on.useRef=function(U){return P.H.useRef(U)},on.useState=function(U){return P.H.useState(U)},on.useSyncExternalStore=function(U,j,Y){return P.H.useSyncExternalStore(U,j,Y)},on.useTransition=function(){return P.H.useTransition()},on.version="19.2.3",on}var e5;function e2(){return e5||(e5=1,T0.exports=yA()),T0.exports}var k=e2();const yn=Bm(k),Y1=mA({__proto__:null,default:yn},[k]);var L0={exports:{}},_h={},O0={exports:{}},j0={};/**
18
- * @license React
19
- * scheduler.production.js
20
- *
21
- * Copyright (c) Meta Platforms, Inc. and affiliates.
22
- *
23
- * This source code is licensed under the MIT license found in the
24
- * LICENSE file in the root directory of this source tree.
25
- */var t5;function bA(){return t5||(t5=1,(function(t){function e(Z,ce){var oe=Z.length;Z.push(ce);e:for(;0<oe;){var ge=oe-1>>>1,he=Z[ge];if(0<a(he,ce))Z[ge]=ce,Z[oe]=he,oe=ge;else break e}}function n(Z){return Z.length===0?null:Z[0]}function r(Z){if(Z.length===0)return null;var ce=Z[0],oe=Z.pop();if(oe!==ce){Z[0]=oe;e:for(var ge=0,he=Z.length,U=he>>>1;ge<U;){var j=2*(ge+1)-1,Y=Z[j],K=j+1,ie=Z[K];if(0>a(Y,oe))K<he&&0>a(ie,Y)?(Z[ge]=ie,Z[K]=oe,ge=K):(Z[ge]=Y,Z[j]=oe,ge=j);else if(K<he&&0>a(ie,oe))Z[ge]=ie,Z[K]=oe,ge=K;else break e}}return ce}function a(Z,ce){var oe=Z.sortIndex-ce.sortIndex;return oe!==0?oe:Z.id-ce.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var l=Date,u=l.now();t.unstable_now=function(){return l.now()-u}}var c=[],h=[],d=1,g=null,y=3,m=!1,x=!1,E=!1,A=!1,N=typeof setTimeout=="function"?setTimeout:null,O=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;function D(Z){for(var ce=n(h);ce!==null;){if(ce.callback===null)r(h);else if(ce.startTime<=Z)r(h),ce.sortIndex=ce.expirationTime,e(c,ce);else break;ce=n(h)}}function F(Z){if(E=!1,D(Z),!x)if(n(c)!==null)x=!0,Q||(Q=!0,z());else{var ce=n(h);ce!==null&&me(F,ce.startTime-Z)}}var Q=!1,P=-1,$=5,B=-1;function ne(){return A?!0:!(t.unstable_now()-B<$)}function I(){if(A=!1,Q){var Z=t.unstable_now();B=Z;var ce=!0;try{e:{x=!1,E&&(E=!1,O(P),P=-1),m=!0;var oe=y;try{t:{for(D(Z),g=n(c);g!==null&&!(g.expirationTime>Z&&ne());){var ge=g.callback;if(typeof ge=="function"){g.callback=null,y=g.priorityLevel;var he=ge(g.expirationTime<=Z);if(Z=t.unstable_now(),typeof he=="function"){g.callback=he,D(Z),ce=!0;break t}g===n(c)&&r(c),D(Z)}else r(c);g=n(c)}if(g!==null)ce=!0;else{var U=n(h);U!==null&&me(F,U.startTime-Z),ce=!1}}break e}finally{g=null,y=oe,m=!1}ce=void 0}}finally{ce?z():Q=!1}}}var z;if(typeof T=="function")z=function(){T(I)};else if(typeof MessageChannel<"u"){var J=new MessageChannel,ae=J.port2;J.port1.onmessage=I,z=function(){ae.postMessage(null)}}else z=function(){N(I,0)};function me(Z,ce){P=N(function(){Z(t.unstable_now())},ce)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(Z){Z.callback=null},t.unstable_forceFrameRate=function(Z){0>Z||125<Z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):$=0<Z?Math.floor(1e3/Z):5},t.unstable_getCurrentPriorityLevel=function(){return y},t.unstable_next=function(Z){switch(y){case 1:case 2:case 3:var ce=3;break;default:ce=y}var oe=y;y=ce;try{return Z()}finally{y=oe}},t.unstable_requestPaint=function(){A=!0},t.unstable_runWithPriority=function(Z,ce){switch(Z){case 1:case 2:case 3:case 4:case 5:break;default:Z=3}var oe=y;y=Z;try{return ce()}finally{y=oe}},t.unstable_scheduleCallback=function(Z,ce,oe){var ge=t.unstable_now();switch(typeof oe=="object"&&oe!==null?(oe=oe.delay,oe=typeof oe=="number"&&0<oe?ge+oe:ge):oe=ge,Z){case 1:var he=-1;break;case 2:he=250;break;case 5:he=1073741823;break;case 4:he=1e4;break;default:he=5e3}return he=oe+he,Z={id:d++,callback:ce,priorityLevel:Z,startTime:oe,expirationTime:he,sortIndex:-1},oe>ge?(Z.sortIndex=oe,e(h,Z),n(c)===null&&Z===n(h)&&(E?(O(P),P=-1):E=!0,me(F,oe-ge))):(Z.sortIndex=he,e(c,Z),x||m||(x=!0,Q||(Q=!0,z()))),Z},t.unstable_shouldYield=ne,t.unstable_wrapCallback=function(Z){var ce=y;return function(){var oe=y;y=ce;try{return Z.apply(this,arguments)}finally{y=oe}}}})(j0)),j0}var n5;function wA(){return n5||(n5=1,O0.exports=bA()),O0.exports}var R0={exports:{}},Qa={};/**
26
- * @license React
27
- * react-dom.production.js
28
- *
29
- * Copyright (c) Meta Platforms, Inc. and affiliates.
30
- *
31
- * This source code is licensed under the MIT license found in the
32
- * LICENSE file in the root directory of this source tree.
33
- */var r5;function xA(){if(r5)return Qa;r5=1;var t=e2();function e(c){var h="https://react.dev/errors/"+c;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var d=2;d<arguments.length;d++)h+="&args[]="+encodeURIComponent(arguments[d])}return"Minified React error #"+c+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(e(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},a=Symbol.for("react.portal");function s(c,h,d){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:g==null?null:""+g,children:c,containerInfo:h,implementation:d}}var l=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(c,h){if(c==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return Qa.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Qa.createPortal=function(c,h){var d=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(e(299));return s(c,h,null,d)},Qa.flushSync=function(c){var h=l.T,d=r.p;try{if(l.T=null,r.p=2,c)return c()}finally{l.T=h,r.p=d,r.d.f()}},Qa.preconnect=function(c,h){typeof c=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,r.d.C(c,h))},Qa.prefetchDNS=function(c){typeof c=="string"&&r.d.D(c)},Qa.preinit=function(c,h){if(typeof c=="string"&&h&&typeof h.as=="string"){var d=h.as,g=u(d,h.crossOrigin),y=typeof h.integrity=="string"?h.integrity:void 0,m=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;d==="style"?r.d.S(c,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:g,integrity:y,fetchPriority:m}):d==="script"&&r.d.X(c,{crossOrigin:g,integrity:y,fetchPriority:m,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},Qa.preinitModule=function(c,h){if(typeof c=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var d=u(h.as,h.crossOrigin);r.d.M(c,{crossOrigin:d,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&r.d.M(c)},Qa.preload=function(c,h){if(typeof c=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var d=h.as,g=u(d,h.crossOrigin);r.d.L(c,d,{crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},Qa.preloadModule=function(c,h){if(typeof c=="string")if(h){var d=u(h.as,h.crossOrigin);r.d.m(c,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:d,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else r.d.m(c)},Qa.requestFormReset=function(c){r.d.r(c)},Qa.unstable_batchedUpdates=function(c,h){return c(h)},Qa.useFormState=function(c,h,d){return l.H.useFormState(c,h,d)},Qa.useFormStatus=function(){return l.H.useHostTransitionStatus()},Qa.version="19.2.3",Qa}var a5;function d_(){if(a5)return R0.exports;a5=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),R0.exports=xA(),R0.exports}/**
34
- * @license React
35
- * react-dom-client.production.js
36
- *
37
- * Copyright (c) Meta Platforms, Inc. and affiliates.
38
- *
39
- * This source code is licensed under the MIT license found in the
40
- * LICENSE file in the root directory of this source tree.
41
- */var i5;function SA(){if(i5)return _h;i5=1;var t=wA(),e=e2(),n=d_();function r(i){var o="https://react.dev/errors/"+i;if(1<arguments.length){o+="?args[]="+encodeURIComponent(arguments[1]);for(var f=2;f<arguments.length;f++)o+="&args[]="+encodeURIComponent(arguments[f])}return"Minified React error #"+i+"; visit "+o+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function s(i){var o=i,f=i;if(i.alternate)for(;o.return;)o=o.return;else{i=o;do o=i,(o.flags&4098)!==0&&(f=o.return),i=o.return;while(i)}return o.tag===3?f:null}function l(i){if(i.tag===13){var o=i.memoizedState;if(o===null&&(i=i.alternate,i!==null&&(o=i.memoizedState)),o!==null)return o.dehydrated}return null}function u(i){if(i.tag===31){var o=i.memoizedState;if(o===null&&(i=i.alternate,i!==null&&(o=i.memoizedState)),o!==null)return o.dehydrated}return null}function c(i){if(s(i)!==i)throw Error(r(188))}function h(i){var o=i.alternate;if(!o){if(o=s(i),o===null)throw Error(r(188));return o!==i?null:i}for(var f=i,p=o;;){var b=f.return;if(b===null)break;var S=b.alternate;if(S===null){if(p=b.return,p!==null){f=p;continue}break}if(b.child===S.child){for(S=b.child;S;){if(S===f)return c(b),i;if(S===p)return c(b),o;S=S.sibling}throw Error(r(188))}if(f.return!==p.return)f=b,p=S;else{for(var M=!1,X=b.child;X;){if(X===f){M=!0,f=b,p=S;break}if(X===p){M=!0,p=b,f=S;break}X=X.sibling}if(!M){for(X=S.child;X;){if(X===f){M=!0,f=S,p=b;break}if(X===p){M=!0,p=S,f=b;break}X=X.sibling}if(!M)throw Error(r(189))}}if(f.alternate!==p)throw Error(r(190))}if(f.tag!==3)throw Error(r(188));return f.stateNode.current===f?i:o}function d(i){var o=i.tag;if(o===5||o===26||o===27||o===6)return i;for(i=i.child;i!==null;){if(o=d(i),o!==null)return o;i=i.sibling}return null}var g=Object.assign,y=Symbol.for("react.element"),m=Symbol.for("react.transitional.element"),x=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),A=Symbol.for("react.strict_mode"),N=Symbol.for("react.profiler"),O=Symbol.for("react.consumer"),T=Symbol.for("react.context"),D=Symbol.for("react.forward_ref"),F=Symbol.for("react.suspense"),Q=Symbol.for("react.suspense_list"),P=Symbol.for("react.memo"),$=Symbol.for("react.lazy"),B=Symbol.for("react.activity"),ne=Symbol.for("react.memo_cache_sentinel"),I=Symbol.iterator;function z(i){return i===null||typeof i!="object"?null:(i=I&&i[I]||i["@@iterator"],typeof i=="function"?i:null)}var J=Symbol.for("react.client.reference");function ae(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===J?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case E:return"Fragment";case N:return"Profiler";case A:return"StrictMode";case F:return"Suspense";case Q:return"SuspenseList";case B:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case x:return"Portal";case T:return i.displayName||"Context";case O:return(i._context.displayName||"Context")+".Consumer";case D:var o=i.render;return i=i.displayName,i||(i=o.displayName||o.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case P:return o=i.displayName||null,o!==null?o:ae(i.type)||"Memo";case $:o=i._payload,i=i._init;try{return ae(i(o))}catch{}}return null}var me=Array.isArray,Z=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ce=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,oe={pending:!1,data:null,method:null,action:null},ge=[],he=-1;function U(i){return{current:i}}function j(i){0>he||(i.current=ge[he],ge[he]=null,he--)}function Y(i,o){he++,ge[he]=i.current,i.current=o}var K=U(null),ie=U(null),V=U(null),se=U(null);function be(i,o){switch(Y(V,o),Y(ie,i),Y(K,null),o.nodeType){case 9:case 11:i=(i=o.documentElement)&&(i=i.namespaceURI)?wb(i):0;break;default:if(i=o.tagName,o=o.namespaceURI)o=wb(o),i=xb(o,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}j(K),Y(K,i)}function xe(){j(K),j(ie),j(V)}function Oe(i){i.memoizedState!==null&&Y(se,i);var o=K.current,f=xb(o,i.type);o!==f&&(Y(ie,i),Y(K,f))}function Me(i){ie.current===i&&(j(K),j(ie)),se.current===i&&(j(se),yh._currentValue=oe)}var Ue,Be;function Ke(i){if(Ue===void 0)try{throw Error()}catch(f){var o=f.stack.trim().match(/\n( *(at )?)/);Ue=o&&o[1]||"",Be=-1<f.stack.indexOf(`
42
- at`)?" (<anonymous>)":-1<f.stack.indexOf("@")?"@unknown:0:0":""}return`
43
- `+Ue+i+Be}var ee=!1;function qe(i,o){if(!i||ee)return"";ee=!0;var f=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var p={DetermineComponentFrameRoot:function(){try{if(o){var Ge=function(){throw Error()};if(Object.defineProperty(Ge.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ge,[])}catch(ke){var De=ke}Reflect.construct(i,[],Ge)}else{try{Ge.call()}catch(ke){De=ke}i.call(Ge.prototype)}}else{try{throw Error()}catch(ke){De=ke}(Ge=i())&&typeof Ge.catch=="function"&&Ge.catch(function(){})}}catch(ke){if(ke&&De&&typeof ke.stack=="string")return[ke.stack,De.stack]}return[null,null]}};p.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var b=Object.getOwnPropertyDescriptor(p.DetermineComponentFrameRoot,"name");b&&b.configurable&&Object.defineProperty(p.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var S=p.DetermineComponentFrameRoot(),M=S[0],X=S[1];if(M&&X){var pe=M.split(`
44
- `),Re=X.split(`
45
- `);for(b=p=0;p<pe.length&&!pe[p].includes("DetermineComponentFrameRoot");)p++;for(;b<Re.length&&!Re[b].includes("DetermineComponentFrameRoot");)b++;if(p===pe.length||b===Re.length)for(p=pe.length-1,b=Re.length-1;1<=p&&0<=b&&pe[p]!==Re[b];)b--;for(;1<=p&&0<=b;p--,b--)if(pe[p]!==Re[b]){if(p!==1||b!==1)do if(p--,b--,0>b||pe[p]!==Re[b]){var Fe=`
46
- `+pe[p].replace(" at new "," at ");return i.displayName&&Fe.includes("<anonymous>")&&(Fe=Fe.replace("<anonymous>",i.displayName)),Fe}while(1<=p&&0<=b);break}}}finally{ee=!1,Error.prepareStackTrace=f}return(f=i?i.displayName||i.name:"")?Ke(f):""}function ct(i,o){switch(i.tag){case 26:case 27:case 5:return Ke(i.type);case 16:return Ke("Lazy");case 13:return i.child!==o&&o!==null?Ke("Suspense Fallback"):Ke("Suspense");case 19:return Ke("SuspenseList");case 0:case 15:return qe(i.type,!1);case 11:return qe(i.type.render,!1);case 1:return qe(i.type,!0);case 31:return Ke("Activity");default:return""}}function tt(i){try{var o="",f=null;do o+=ct(i,f),f=i,i=i.return;while(i);return o}catch(p){return`
47
- Error generating stack: `+p.message+`
48
- `+p.stack}}var Ye=Object.prototype.hasOwnProperty,gt=t.unstable_scheduleCallback,ot=t.unstable_cancelCallback,Ot=t.unstable_shouldYield,At=t.unstable_requestPaint,Ft=t.unstable_now,rn=t.unstable_getCurrentPriorityLevel,Jt=t.unstable_ImmediatePriority,fn=t.unstable_UserBlockingPriority,zt=t.unstable_NormalPriority,at=t.unstable_LowPriority,Xt=t.unstable_IdlePriority,wt=t.log,lr=t.unstable_setDisableYieldValue,dn=null,bt=null;function qt(i){if(typeof wt=="function"&&lr(i),bt&&typeof bt.setStrictMode=="function")try{bt.setStrictMode(dn,i)}catch{}}var pn=Math.clz32?Math.clz32:Pt,Nt=Math.log,Gn=Math.LN2;function Pt(i){return i>>>=0,i===0?32:31-(Nt(i)/Gn|0)|0}var It=256,Mn=262144,Qt=4194304;function _t(i){var o=i&42;if(o!==0)return o;switch(i&-i){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 i&261888;case 262144:case 524288:case 1048576:case 2097152:return i&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return i&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return i}}function bn(i,o,f){var p=i.pendingLanes;if(p===0)return 0;var b=0,S=i.suspendedLanes,M=i.pingedLanes;i=i.warmLanes;var X=p&134217727;return X!==0?(p=X&~S,p!==0?b=_t(p):(M&=X,M!==0?b=_t(M):f||(f=X&~i,f!==0&&(b=_t(f))))):(X=p&~S,X!==0?b=_t(X):M!==0?b=_t(M):f||(f=p&~i,f!==0&&(b=_t(f)))),b===0?0:o!==0&&o!==b&&(o&S)===0&&(S=b&-b,f=o&-o,S>=f||S===32&&(f&4194048)!==0)?o:b}function si(i,o){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&o)===0}function Wr(i,o){switch(i){case 1:case 2:case 4:case 8:case 64:return o+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 o+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 ka(){var i=Qt;return Qt<<=1,(Qt&62914560)===0&&(Qt=4194304),i}function ha(i){for(var o=[],f=0;31>f;f++)o.push(i);return o}function Et(i,o){i.pendingLanes|=o,o!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function Ui(i,o,f,p,b,S){var M=i.pendingLanes;i.pendingLanes=f,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=f,i.entangledLanes&=f,i.errorRecoveryDisabledLanes&=f,i.shellSuspendCounter=0;var X=i.entanglements,pe=i.expirationTimes,Re=i.hiddenUpdates;for(f=M&~f;0<f;){var Fe=31-pn(f),Ge=1<<Fe;X[Fe]=0,pe[Fe]=-1;var De=Re[Fe];if(De!==null)for(Re[Fe]=null,Fe=0;Fe<De.length;Fe++){var ke=De[Fe];ke!==null&&(ke.lane&=-536870913)}f&=~Ge}p!==0&&vi(i,p,0),S!==0&&b===0&&i.tag!==0&&(i.suspendedLanes|=S&~(M&~o))}function vi(i,o,f){i.pendingLanes|=o,i.suspendedLanes&=~o;var p=31-pn(o);i.entangledLanes|=o,i.entanglements[p]=i.entanglements[p]|1073741824|f&261930}function de(i,o){var f=i.entangledLanes|=o;for(i=i.entanglements;f;){var p=31-pn(f),b=1<<p;b&o|i[p]&o&&(i[p]|=o),f&=~b}}function Se(i,o){var f=o&-o;return f=(f&42)!==0?1:Ne(f),(f&(i.suspendedLanes|o))!==0?0:f}function Ne(i){switch(i){case 2:i=1;break;case 8:i=4;break;case 32:i=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:i=128;break;case 268435456:i=134217728;break;default:i=0}return i}function He(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function Xe(){var i=ce.p;return i!==0?i:(i=window.event,i===void 0?32:Hb(i.type))}function ht(i,o){var f=ce.p;try{return ce.p=i,o()}finally{ce.p=f}}var it=Math.random().toString(36).slice(2),Qe="__reactFiber$"+it,et="__reactProps$"+it,rt="__reactContainer$"+it,Ct="__reactEvents$"+it,st="__reactListeners$"+it,Ht="__reactHandles$"+it,Zt="__reactResources$"+it,Bn="__reactMarker$"+it;function Kn(i){delete i[Qe],delete i[et],delete i[Ct],delete i[st],delete i[Ht]}function Jn(i){var o=i[Qe];if(o)return o;for(var f=i.parentNode;f;){if(o=f[rt]||f[Qe]){if(f=o.alternate,o.child!==null||f!==null&&f.child!==null)for(i=Tb(i);i!==null;){if(f=i[Qe])return f;i=Tb(i)}return o}i=f,f=i.parentNode}return null}function hn(i){if(i=i[Qe]||i[rt]){var o=i.tag;if(o===5||o===6||o===13||o===31||o===26||o===27||o===3)return i}return null}function Mr(i){var o=i.tag;if(o===5||o===26||o===27||o===6)return i.stateNode;throw Error(r(33))}function ra(i){var o=i[Zt];return o||(o=i[Zt]={hoistableStyles:new Map,hoistableScripts:new Map}),o}function Xn(i){i[Bn]=!0}var Ka=new Set,dr={};function Ma(i,o){Pa(i,o),Pa(i+"Capture",o)}function Pa(i,o){for(dr[i]=o,i=0;i<o.length;i++)Ka.add(o[i])}var oi=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]*$"),is={},ss={};function gn(i){return Ye.call(ss,i)?!0:Ye.call(is,i)?!1:oi.test(i)?ss[i]=!0:(is[i]=!0,!1)}function Pn(i,o,f){if(gn(o))if(f===null)i.removeAttribute(o);else{switch(typeof f){case"undefined":case"function":case"symbol":i.removeAttribute(o);return;case"boolean":var p=o.toLowerCase().slice(0,5);if(p!=="data-"&&p!=="aria-"){i.removeAttribute(o);return}}i.setAttribute(o,""+f)}}function Na(i,o,f){if(f===null)i.removeAttribute(o);else{switch(typeof f){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(o);return}i.setAttribute(o,""+f)}}function Kr(i,o,f,p){if(p===null)i.removeAttribute(f);else{switch(typeof p){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(f);return}i.setAttributeNS(o,f,""+p)}}function jt(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function os(i){var o=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function li(i,o,f){var p=Object.getOwnPropertyDescriptor(i.constructor.prototype,o);if(!i.hasOwnProperty(o)&&typeof p<"u"&&typeof p.get=="function"&&typeof p.set=="function"){var b=p.get,S=p.set;return Object.defineProperty(i,o,{configurable:!0,get:function(){return b.call(this)},set:function(M){f=""+M,S.call(this,M)}}),Object.defineProperty(i,o,{enumerable:p.enumerable}),{getValue:function(){return f},setValue:function(M){f=""+M},stopTracking:function(){i._valueTracker=null,delete i[o]}}}}function ls(i){if(!i._valueTracker){var o=os(i)?"checked":"value";i._valueTracker=li(i,o,""+i[o])}}function mu(i){if(!i)return!1;var o=i._valueTracker;if(!o)return!0;var f=o.getValue(),p="";return i&&(p=os(i)?i.checked?"true":"false":i.value),i=p,i!==f?(o.setValue(i),!0):!1}function Ia(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}var Jr=/[\n"\\]/g;function Pr(i){return i.replace(Jr,function(o){return"\\"+o.charCodeAt(0).toString(16)+" "})}function El(i,o,f,p,b,S,M,X){i.name="",M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"?i.type=M:i.removeAttribute("type"),o!=null?M==="number"?(o===0&&i.value===""||i.value!=o)&&(i.value=""+jt(o)):i.value!==""+jt(o)&&(i.value=""+jt(o)):M!=="submit"&&M!=="reset"||i.removeAttribute("value"),o!=null?gu(i,M,jt(o)):f!=null?gu(i,M,jt(f)):p!=null&&i.removeAttribute("value"),b==null&&S!=null&&(i.defaultChecked=!!S),b!=null&&(i.checked=b&&typeof b!="function"&&typeof b!="symbol"),X!=null&&typeof X!="function"&&typeof X!="symbol"&&typeof X!="boolean"?i.name=""+jt(X):i.removeAttribute("name")}function lc(i,o,f,p,b,S,M,X){if(S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(i.type=S),o!=null||f!=null){if(!(S!=="submit"&&S!=="reset"||o!=null)){ls(i);return}f=f!=null?""+jt(f):"",o=o!=null?""+jt(o):f,X||o===i.value||(i.value=o),i.defaultValue=o}p=p??b,p=typeof p!="function"&&typeof p!="symbol"&&!!p,i.checked=X?i.checked:!!p,i.defaultChecked=!!p,M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"&&(i.name=M),ls(i)}function gu(i,o,f){o==="number"&&Ia(i.ownerDocument)===i||i.defaultValue===""+f||(i.defaultValue=""+f)}function Fa(i,o,f,p){if(i=i.options,o){o={};for(var b=0;b<f.length;b++)o["$"+f[b]]=!0;for(f=0;f<i.length;f++)b=o.hasOwnProperty("$"+i[f].value),i[f].selected!==b&&(i[f].selected=b),b&&p&&(i[f].defaultSelected=!0)}else{for(f=""+jt(f),o=null,b=0;b<i.length;b++){if(i[b].value===f){i[b].selected=!0,p&&(i[b].defaultSelected=!0);return}o!==null||i[b].disabled||(o=i[b])}o!==null&&(o.selected=!0)}}function vu(i,o,f){if(o!=null&&(o=""+jt(o),o!==i.value&&(i.value=o),f==null)){i.defaultValue!==o&&(i.defaultValue=o);return}i.defaultValue=f!=null?""+jt(f):""}function yu(i,o,f,p){if(o==null){if(p!=null){if(f!=null)throw Error(r(92));if(me(p)){if(1<p.length)throw Error(r(93));p=p[0]}f=p}f==null&&(f=""),o=f}f=jt(o),i.defaultValue=f,p=i.textContent,p===f&&p!==""&&p!==null&&(i.value=p),ls(i)}function Bi(i,o){if(o){var f=i.firstChild;if(f&&f===i.lastChild&&f.nodeType===3){f.nodeValue=o;return}}i.textContent=o}var Io=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 uc(i,o,f){var p=o.indexOf("--")===0;f==null||typeof f=="boolean"||f===""?p?i.setProperty(o,""):o==="float"?i.cssFloat="":i[o]="":p?i.setProperty(o,f):typeof f!="number"||f===0||Io.has(o)?o==="float"?i.cssFloat=f:i[o]=(""+f).trim():i[o]=f+"px"}function cc(i,o,f){if(o!=null&&typeof o!="object")throw Error(r(62));if(i=i.style,f!=null){for(var p in f)!f.hasOwnProperty(p)||o!=null&&o.hasOwnProperty(p)||(p.indexOf("--")===0?i.setProperty(p,""):p==="float"?i.cssFloat="":i[p]="");for(var b in o)p=o[b],o.hasOwnProperty(b)&&f[b]!==p&&uc(i,b,p)}else for(var S in o)o.hasOwnProperty(S)&&uc(i,S,o[S])}function bu(i){if(i.indexOf("-")===-1)return!1;switch(i){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 wu=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"],["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"]]),fc=/^[\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 Ja(i){return fc.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}function $i(){}var Ts=null;function Fo(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var lo=null,Ut=null;function hc(i){var o=hn(i);if(o&&(i=o.stateNode)){var f=i[et]||null;e:switch(i=o.stateNode,o.type){case"input":if(El(i,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name),o=f.name,f.type==="radio"&&o!=null){for(f=i;f.parentNode;)f=f.parentNode;for(f=f.querySelectorAll('input[name="'+Pr(""+o)+'"][type="radio"]'),o=0;o<f.length;o++){var p=f[o];if(p!==i&&p.form===i.form){var b=p[et]||null;if(!b)throw Error(r(90));El(p,b.value,b.defaultValue,b.defaultValue,b.checked,b.defaultChecked,b.type,b.name)}}for(o=0;o<f.length;o++)p=f[o],p.form===i.form&&mu(p)}break e;case"textarea":vu(i,f.value,f.defaultValue);break e;case"select":o=f.value,o!=null&&Fa(i,!!f.multiple,o,!1)}}}var xu=!1;function dc(i,o,f){if(xu)return i(o,f);xu=!0;try{var p=i(o);return p}finally{if(xu=!1,(lo!==null||Ut!==null)&&(Vd(),lo&&(o=lo,i=Ut,Ut=lo=null,hc(o),i)))for(o=0;o<i.length;o++)hc(i[o])}}function ui(i,o){var f=i.stateNode;if(f===null)return null;var p=f[et]||null;if(p===null)return null;f=p[o];e:switch(o){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(p=!p.disabled)||(i=i.type,p=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!p;break e;default:i=!1}if(i)return null;if(f&&typeof f!="function")throw Error(r(231,o,typeof f));return f}var da=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Su=!1;if(da)try{var Uo={};Object.defineProperty(Uo,"passive",{get:function(){Su=!0}}),window.addEventListener("test",Uo,Uo),window.removeEventListener("test",Uo,Uo)}catch{Su=!1}var ci=null,Bo=null,us=null;function pc(){if(us)return us;var i,o=Bo,f=o.length,p,b="value"in ci?ci.value:ci.textContent,S=b.length;for(i=0;i<f&&o[i]===b[i];i++);var M=f-i;for(p=1;p<=M&&o[f-p]===b[S-p];p++);return us=b.slice(i,1<p?1-p:void 0)}function yi(i){var o=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&o===13&&(i=13)):i=o,i===10&&(i=13),32<=i||i===13?i:0}function Al(){return!0}function Nl(){return!1}function aa(i){function o(f,p,b,S,M){this._reactName=f,this._targetInst=b,this.type=p,this.nativeEvent=S,this.target=M,this.currentTarget=null;for(var X in i)i.hasOwnProperty(X)&&(f=i[X],this[X]=f?f(S):S[X]);return this.isDefaultPrevented=(S.defaultPrevented!=null?S.defaultPrevented:S.returnValue===!1)?Al:Nl,this.isPropagationStopped=Nl,this}return g(o.prototype,{preventDefault:function(){this.defaultPrevented=!0;var f=this.nativeEvent;f&&(f.preventDefault?f.preventDefault():typeof f.returnValue!="unknown"&&(f.returnValue=!1),this.isDefaultPrevented=Al)},stopPropagation:function(){var f=this.nativeEvent;f&&(f.stopPropagation?f.stopPropagation():typeof f.cancelBubble!="unknown"&&(f.cancelBubble=!0),this.isPropagationStopped=Al)},persist:function(){},isPersistent:Al}),o}var cs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},bi=aa(cs),Ls=g({},cs,{view:0,detail:0}),Cl=aa(Ls),$o,Os,js,zo=g({},Ls,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Yt,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==js&&(js&&i.type==="mousemove"?($o=i.screenX-js.screenX,Os=i.screenY-js.screenY):Os=$o=0,js=i),$o)},movementY:function(i){return"movementY"in i?i.movementY:Os}}),_u=aa(zo),Rs=g({},zo,{dataTransfer:0}),Ds=aa(Rs),mc=g({},Ls,{relatedTarget:0}),ks=aa(mc),gc=g({},cs,{animationName:0,elapsedTime:0,pseudoElement:0}),C=aa(gc),q=g({},cs,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),fe=aa(q),ve=g({},cs,{data:0}),Ee=aa(ve),$e={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Je={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"},pt={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function xt(i){var o=this.nativeEvent;return o.getModifierState?o.getModifierState(i):(i=pt[i])?!!o[i]:!1}function Yt(){return xt}var an=g({},Ls,{key:function(i){if(i.key){var o=$e[i.key]||i.key;if(o!=="Unidentified")return o}return i.type==="keypress"?(i=yi(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?Je[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Yt,charCode:function(i){return i.type==="keypress"?yi(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?yi(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),Nn=aa(an),mr=g({},zo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Cr=aa(mr),nr=g({},Ls,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Yt}),Xr=aa(nr),Ir=g({},cs,{propertyName:0,elapsedTime:0,pseudoElement:0}),pa=aa(Ir),Ms=g({},zo,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),zi=aa(Ms),Ps=g({},cs,{newState:0,oldState:0}),Eu=aa(Ps),Tl=[9,13,27,32],fs=da&&"CompositionEvent"in window,qi=null;da&&"documentMode"in document&&(qi=document.documentMode);var qo=da&&"TextEvent"in window&&!qi,Is=da&&(!fs||qi&&8<qi&&11>=qi),ia=" ",uo=!1;function co(i,o){switch(i){case"keyup":return Tl.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ll(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var hs=!1;function Ua(i,o){switch(i){case"compositionend":return Ll(o);case"keypress":return o.which!==32?null:(uo=!0,ia);case"textInput":return i=o.data,i===ia&&uo?null:i;default:return null}}function Fs(i,o){if(hs)return i==="compositionend"||!fs&&co(i,o)?(i=pc(),us=Bo=ci=null,hs=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(o.ctrlKey||o.altKey||o.metaKey)||o.ctrlKey&&o.altKey){if(o.char&&1<o.char.length)return o.char;if(o.which)return String.fromCharCode(o.which)}return null;case"compositionend":return Is&&o.locale!=="ko"?null:o.data;default:return null}}var Ol={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 Au(i){var o=i&&i.nodeName&&i.nodeName.toLowerCase();return o==="input"?!!Ol[i.type]:o==="textarea"}function fi(i,o,f,p){lo?Ut?Ut.push(p):Ut=[p]:lo=p,o=Zd(o,"onChange"),0<o.length&&(f=new bi("onChange","change",null,f,p),i.push({event:f,listeners:o}))}var Hi=null,Us=null;function Nu(i){pb(i,0)}function Vi(i){var o=Mr(i);if(mu(o))return i}function fo(i,o){if(i==="change")return o}var Xa=!1;if(da){var Ba;if(da){var ds="oninput"in document;if(!ds){var ps=document.createElement("div");ps.setAttribute("oninput","return;"),ds=typeof ps.oninput=="function"}Ba=ds}else Ba=!1;Xa=Ba&&(!document.documentMode||9<document.documentMode)}function Bs(){Hi&&(Hi.detachEvent("onpropertychange",jl),Us=Hi=null)}function jl(i){if(i.propertyName==="value"&&Vi(Us)){var o=[];fi(o,Us,i,Fo(i)),dc(Nu,o)}}function Rl(i,o,f){i==="focusin"?(Bs(),Hi=o,Us=f,Hi.attachEvent("onpropertychange",jl)):i==="focusout"&&Bs()}function Tr(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return Vi(Us)}function vc(i,o){if(i==="click")return Vi(o)}function ms(i,o){if(i==="input"||i==="change")return Vi(o)}function gs(i,o){return i===o&&(i!==0||1/i===1/o)||i!==i&&o!==o}var ma=typeof Object.is=="function"?Object.is:gs;function $s(i,o){if(ma(i,o))return!0;if(typeof i!="object"||i===null||typeof o!="object"||o===null)return!1;var f=Object.keys(i),p=Object.keys(o);if(f.length!==p.length)return!1;for(p=0;p<f.length;p++){var b=f[p];if(!Ye.call(o,b)||!ma(i[b],o[b]))return!1}return!0}function Dl(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function kl(i,o){var f=Dl(i);i=0;for(var p;f;){if(f.nodeType===3){if(p=i+f.textContent.length,i<=o&&p>=o)return{node:f,offset:o-i};i=p}e:{for(;f;){if(f.nextSibling){f=f.nextSibling;break e}f=f.parentNode}f=void 0}f=Dl(f)}}function zs(i,o){return i&&o?i===o?!0:i&&i.nodeType===3?!1:o&&o.nodeType===3?zs(i,o.parentNode):"contains"in i?i.contains(o):i.compareDocumentPosition?!!(i.compareDocumentPosition(o)&16):!1:!1}function qs(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var o=Ia(i.document);o instanceof i.HTMLIFrameElement;){try{var f=typeof o.contentWindow.location.href=="string"}catch{f=!1}if(f)i=o.contentWindow;else break;o=Ia(i.document)}return o}function vs(i){var o=i&&i.nodeName&&i.nodeName.toLowerCase();return o&&(o==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||o==="textarea"||i.contentEditable==="true")}var Ho=da&&"documentMode"in document&&11>=document.documentMode,hi=null,Hs=null,Ca=null,wi=!1;function Dn(i,o,f){var p=f.window===f?f.document:f.nodeType===9?f:f.ownerDocument;wi||hi==null||hi!==Ia(p)||(p=hi,"selectionStart"in p&&vs(p)?p={start:p.selectionStart,end:p.selectionEnd}:(p=(p.ownerDocument&&p.ownerDocument.defaultView||window).getSelection(),p={anchorNode:p.anchorNode,anchorOffset:p.anchorOffset,focusNode:p.focusNode,focusOffset:p.focusOffset}),Ca&&$s(Ca,p)||(Ca=p,p=Zd(Hs,"onSelect"),0<p.length&&(o=new bi("onSelect","select",null,o,f),i.push({event:o,listeners:p}),o.target=hi)))}function Cn(i,o){var f={};return f[i.toLowerCase()]=o.toLowerCase(),f["Webkit"+i]="webkit"+o,f["Moz"+i]="moz"+o,f}var rr={animationend:Cn("Animation","AnimationEnd"),animationiteration:Cn("Animation","AnimationIteration"),animationstart:Cn("Animation","AnimationStart"),transitionrun:Cn("Transition","TransitionRun"),transitionstart:Cn("Transition","TransitionStart"),transitioncancel:Cn("Transition","TransitionCancel"),transitionend:Cn("Transition","TransitionEnd")},Lr={},ys={};da&&(ys=document.createElement("div").style,"AnimationEvent"in window||(delete rr.animationend.animation,delete rr.animationiteration.animation,delete rr.animationstart.animation),"TransitionEvent"in window||delete rr.transitionend.transition);function Yi(i){if(Lr[i])return Lr[i];if(!rr[i])return i;var o=rr[i],f;for(f in o)if(o.hasOwnProperty(f)&&f in ys)return Lr[i]=o[f];return i}var Vo=Yi("animationend"),Cu=Yi("animationiteration"),$f=Yi("animationstart"),xd=Yi("transitionrun"),Sd=Yi("transitionstart"),_d=Yi("transitioncancel"),zf=Yi("transitionend"),qf=new Map,Yo="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error 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(" ");Yo.push("scrollEnd");function xi(i,o){qf.set(i,o),Ma(o,[i])}var Tu=typeof reportError=="function"?reportError:function(i){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var o=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof i=="object"&&i!==null&&typeof i.message=="string"?String(i.message):String(i),error:i});if(!window.dispatchEvent(o))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",i);return}console.error(i)},di=[],Go=0,yc=0;function Lu(){for(var i=Go,o=yc=Go=0;o<i;){var f=di[o];di[o++]=null;var p=di[o];di[o++]=null;var b=di[o];di[o++]=null;var S=di[o];if(di[o++]=null,p!==null&&b!==null){var M=p.pending;M===null?b.next=b:(b.next=M.next,M.next=b),p.pending=b}S!==0&&ju(f,b,S)}}function Ou(i,o,f,p){di[Go++]=i,di[Go++]=o,di[Go++]=f,di[Go++]=p,yc|=p,i.lanes|=p,i=i.alternate,i!==null&&(i.lanes|=p)}function bc(i,o,f,p){return Ou(i,o,f,p),Ta(i)}function Vs(i,o){return Ou(i,null,null,o),Ta(i)}function ju(i,o,f){i.lanes|=f;var p=i.alternate;p!==null&&(p.lanes|=f);for(var b=!1,S=i.return;S!==null;)S.childLanes|=f,p=S.alternate,p!==null&&(p.childLanes|=f),S.tag===22&&(i=S.stateNode,i===null||i._visibility&1||(b=!0)),i=S,S=S.return;return i.tag===3?(S=i.stateNode,b&&o!==null&&(b=31-pn(f),i=S.hiddenUpdates,p=i[b],p===null?i[b]=[o]:p.push(o),o.lane=f|536870912),S):null}function Ta(i){if(50<fh)throw fh=0,Xg=null,Error(r(185));for(var o=i.return;o!==null;)i=o,o=i.return;return i.tag===3?i.stateNode:null}var ga={};function wc(i,o,f,p){this.tag=i,this.key=f,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=o,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=p,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function La(i,o,f,p){return new wc(i,o,f,p)}function xc(i){return i=i.prototype,!(!i||!i.isReactComponent)}function Si(i,o){var f=i.alternate;return f===null?(f=La(i.tag,o,i.key,i.mode),f.elementType=i.elementType,f.type=i.type,f.stateNode=i.stateNode,f.alternate=i,i.alternate=f):(f.pendingProps=o,f.type=i.type,f.flags=0,f.subtreeFlags=0,f.deletions=null),f.flags=i.flags&65011712,f.childLanes=i.childLanes,f.lanes=i.lanes,f.child=i.child,f.memoizedProps=i.memoizedProps,f.memoizedState=i.memoizedState,f.updateQueue=i.updateQueue,o=i.dependencies,f.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext},f.sibling=i.sibling,f.index=i.index,f.ref=i.ref,f.refCleanup=i.refCleanup,f}function Ru(i,o){i.flags&=65011714;var f=i.alternate;return f===null?(i.childLanes=0,i.lanes=o,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=f.childLanes,i.lanes=f.lanes,i.child=f.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=f.memoizedProps,i.memoizedState=f.memoizedState,i.updateQueue=f.updateQueue,i.type=f.type,o=f.dependencies,i.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext}),i}function Ml(i,o,f,p,b,S){var M=0;if(p=i,typeof i=="function")xc(i)&&(M=1);else if(typeof i=="string")M=tA(i,f,K.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case B:return i=La(31,f,o,b),i.elementType=B,i.lanes=S,i;case E:return ho(f.children,b,S,o);case A:M=8,b|=24;break;case N:return i=La(12,f,o,b|2),i.elementType=N,i.lanes=S,i;case F:return i=La(13,f,o,b),i.elementType=F,i.lanes=S,i;case Q:return i=La(19,f,o,b),i.elementType=Q,i.lanes=S,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case T:M=10;break e;case O:M=9;break e;case D:M=11;break e;case P:M=14;break e;case $:M=16,p=null;break e}M=29,f=Error(r(130,i===null?"null":typeof i,"")),p=null}return o=La(M,f,o,b),o.elementType=i,o.type=p,o.lanes=S,o}function ho(i,o,f,p){return i=La(7,i,p,o),i.lanes=f,i}function Du(i,o,f){return i=La(6,i,null,o),i.lanes=f,i}function Sc(i){var o=La(18,null,null,0);return o.stateNode=i,o}function Pl(i,o,f){return o=La(4,i.children!==null?i.children:[],i.key,o),o.lanes=f,o.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},o}var _c=new WeakMap;function _i(i,o){if(typeof i=="object"&&i!==null){var f=_c.get(i);return f!==void 0?f:(o={value:i,source:o,stack:tt(o)},_c.set(i,o),o)}return{value:i,source:o,stack:tt(o)}}var Il=[],Wo=0,Ec=null,ku=0,Ei=[],Ai=0,po=null,Ni=1,Ci="";function pi(i,o){Il[Wo++]=ku,Il[Wo++]=Ec,Ec=i,ku=o}function Ed(i,o,f){Ei[Ai++]=Ni,Ei[Ai++]=Ci,Ei[Ai++]=po,po=i;var p=Ni;i=Ci;var b=32-pn(p)-1;p&=~(1<<b),f+=1;var S=32-pn(o)+b;if(30<S){var M=b-b%5;S=(p&(1<<M)-1).toString(32),p>>=M,b-=M,Ni=1<<32-pn(o)+b|f<<b|p,Ci=S+i}else Ni=1<<S|f<<b|p,Ci=i}function Hf(i){i.return!==null&&(pi(i,1),Ed(i,1,0))}function Ac(i){for(;i===Ec;)Ec=Il[--Wo],Il[Wo]=null,ku=Il[--Wo],Il[Wo]=null;for(;i===po;)po=Ei[--Ai],Ei[Ai]=null,Ci=Ei[--Ai],Ei[Ai]=null,Ni=Ei[--Ai],Ei[Ai]=null}function Ad(i,o){Ei[Ai++]=Ni,Ei[Ai++]=Ci,Ei[Ai++]=po,Ni=o.id,Ci=o.overflow,po=i}var va=null,ur=null,xn=!1,$a=null,Sr=!1,Gi=Error(r(519));function mo(i){var o=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Fl(_i(o,i)),Gi}function Vf(i){var o=i.stateNode,f=i.type,p=i.memoizedProps;switch(o[Qe]=i,o[et]=p,f){case"dialog":_n("cancel",o),_n("close",o);break;case"iframe":case"object":case"embed":_n("load",o);break;case"video":case"audio":for(f=0;f<dh.length;f++)_n(dh[f],o);break;case"source":_n("error",o);break;case"img":case"image":case"link":_n("error",o),_n("load",o);break;case"details":_n("toggle",o);break;case"input":_n("invalid",o),lc(o,p.value,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name,!0);break;case"select":_n("invalid",o);break;case"textarea":_n("invalid",o),yu(o,p.value,p.defaultValue,p.children)}f=p.children,typeof f!="string"&&typeof f!="number"&&typeof f!="bigint"||o.textContent===""+f||p.suppressHydrationWarning===!0||yb(o.textContent,f)?(p.popover!=null&&(_n("beforetoggle",o),_n("toggle",o)),p.onScroll!=null&&_n("scroll",o),p.onScrollEnd!=null&&_n("scrollend",o),p.onClick!=null&&(o.onclick=$i),o=!0):o=!1,o||mo(i,!0)}function Ys(i){for(va=i.return;va;)switch(va.tag){case 5:case 31:case 13:Sr=!1;return;case 27:case 3:Sr=!0;return;default:va=va.return}}function ya(i){if(i!==va)return!1;if(!xn)return Ys(i),xn=!0,!1;var o=i.tag,f;if((f=o!==3&&o!==27)&&((f=o===5)&&(f=i.type,f=!(f!=="form"&&f!=="button")||h0(i.type,i.memoizedProps)),f=!f),f&&ur&&mo(i),Ys(i),o===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));ur=Cb(i)}else if(o===31){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));ur=Cb(i)}else o===27?(o=ur,Zl(i.type)?(i=v0,v0=null,ur=i):ur=o):ur=va?Ss(i.stateNode.nextSibling):null;return!0}function Ko(){ur=va=null,xn=!1}function Yf(){var i=$a;return i!==null&&(Di===null?Di=i:Di.push.apply(Di,i),$a=null),i}function Fl(i){$a===null?$a=[i]:$a.push(i)}var Nc=U(null),go=null,bs=null;function vo(i,o,f){Y(Nc,o._currentValue),o._currentValue=f}function Ti(i){i._currentValue=Nc.current,j(Nc)}function Ul(i,o,f){for(;i!==null;){var p=i.alternate;if((i.childLanes&o)!==o?(i.childLanes|=o,p!==null&&(p.childLanes|=o)):p!==null&&(p.childLanes&o)!==o&&(p.childLanes|=o),i===f)break;i=i.return}}function Jo(i,o,f,p){var b=i.child;for(b!==null&&(b.return=i);b!==null;){var S=b.dependencies;if(S!==null){var M=b.child;S=S.firstContext;e:for(;S!==null;){var X=S;S=b;for(var pe=0;pe<o.length;pe++)if(X.context===o[pe]){S.lanes|=f,X=S.alternate,X!==null&&(X.lanes|=f),Ul(S.return,f,i),p||(M=null);break e}S=X.next}}else if(b.tag===18){if(M=b.return,M===null)throw Error(r(341));M.lanes|=f,S=M.alternate,S!==null&&(S.lanes|=f),Ul(M,f,i),M=null}else M=b.child;if(M!==null)M.return=b;else for(M=b;M!==null;){if(M===i){M=null;break}if(b=M.sibling,b!==null){b.return=M.return,M=b;break}M=M.return}b=M}}function yo(i,o,f,p){i=null;for(var b=o,S=!1;b!==null;){if(!S){if((b.flags&524288)!==0)S=!0;else if((b.flags&262144)!==0)break}if(b.tag===10){var M=b.alternate;if(M===null)throw Error(r(387));if(M=M.memoizedProps,M!==null){var X=b.type;ma(b.pendingProps.value,M.value)||(i!==null?i.push(X):i=[X])}}else if(b===se.current){if(M=b.alternate,M===null)throw Error(r(387));M.memoizedState.memoizedState!==b.memoizedState.memoizedState&&(i!==null?i.push(yh):i=[yh])}b=b.return}i!==null&&Jo(o,i,f,p),o.flags|=262144}function Cc(i){for(i=i.firstContext;i!==null;){if(!ma(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function bo(i){go=i,bs=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function ba(i){return Nd(go,i)}function Tc(i,o){return go===null&&bo(i),Nd(i,o)}function Nd(i,o){var f=o._currentValue;if(o={context:o,memoizedValue:f,next:null},bs===null){if(i===null)throw Error(r(308));bs=o,i.dependencies={lanes:0,firstContext:o},i.flags|=524288}else bs=bs.next=o;return f}var gg=typeof AbortController<"u"?AbortController:function(){var i=[],o=this.signal={aborted:!1,addEventListener:function(f,p){i.push(p)}};this.abort=function(){o.aborted=!0,i.forEach(function(f){return f()})}},vg=t.unstable_scheduleCallback,yg=t.unstable_NormalPriority,Or={$$typeof:T,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Bl(){return{controller:new gg,data:new Map,refCount:0}}function Mu(i){i.refCount--,i.refCount===0&&vg(yg,function(){i.controller.abort()})}var Pu=null,Lc=0,v=0,w=null;function L(i,o){if(Pu===null){var f=Pu=[];Lc=0,v=r0(),w={status:"pending",value:void 0,then:function(p){f.push(p)}}}return Lc++,o.then(R,R),o}function R(){if(--Lc===0&&Pu!==null){w!==null&&(w.status="fulfilled");var i=Pu;Pu=null,v=0,w=null;for(var o=0;o<i.length;o++)(0,i[o])()}}function H(i,o){var f=[],p={status:"pending",value:null,reason:null,then:function(b){f.push(b)}};return i.then(function(){p.status="fulfilled",p.value=o;for(var b=0;b<f.length;b++)(0,f[b])(o)},function(b){for(p.status="rejected",p.reason=b,b=0;b<f.length;b++)(0,f[b])(void 0)}),p}var G=Z.S;Z.S=function(i,o){zy=Ft(),typeof o=="object"&&o!==null&&typeof o.then=="function"&&L(i,o),G!==null&&G(i,o)};var W=U(null);function te(){var i=W.current;return i!==null?i:fr.pooledCache}function re(i,o){o===null?Y(W,W.current):Y(W,o.pool)}function ue(){var i=te();return i===null?null:{parent:Or._currentValue,pool:i}}var ye=Error(r(460)),Le=Error(r(474)),le=Error(r(542)),_e={then:function(){}};function Ce(i){return i=i.status,i==="fulfilled"||i==="rejected"}function Ie(i,o,f){switch(f=i[f],f===void 0?i.push(o):f!==o&&(o.then($i,$i),o=f),o.status){case"fulfilled":return o.value;case"rejected":throw i=o.reason,Ze(i),i;default:if(typeof o.status=="string")o.then($i,$i);else{if(i=fr,i!==null&&100<i.shellSuspendCounter)throw Error(r(482));i=o,i.status="pending",i.then(function(p){if(o.status==="pending"){var b=o;b.status="fulfilled",b.value=p}},function(p){if(o.status==="pending"){var b=o;b.status="rejected",b.reason=p}})}switch(o.status){case"fulfilled":return o.value;case"rejected":throw i=o.reason,Ze(i),i}throw Pe=o,ye}}function Te(i){try{var o=i._init;return o(i._payload)}catch(f){throw f!==null&&typeof f=="object"&&typeof f.then=="function"?(Pe=f,ye):f}}var Pe=null;function ze(){if(Pe===null)throw Error(r(459));var i=Pe;return Pe=null,i}function Ze(i){if(i===ye||i===le)throw Error(r(483))}var We=null,vt=0;function lt(i){var o=vt;return vt+=1,We===null&&(We=[]),Ie(We,i,o)}function en(i,o){o=o.props.ref,i.ref=o!==void 0?o:null}function dt(i,o){throw o.$$typeof===y?Error(r(525)):(i=Object.prototype.toString.call(o),Error(r(31,i==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":i)))}function wn(i){function o(Ae,we){if(i){var je=Ae.deletions;je===null?(Ae.deletions=[we],Ae.flags|=16):je.push(we)}}function f(Ae,we){if(!i)return null;for(;we!==null;)o(Ae,we),we=we.sibling;return null}function p(Ae){for(var we=new Map;Ae!==null;)Ae.key!==null?we.set(Ae.key,Ae):we.set(Ae.index,Ae),Ae=Ae.sibling;return we}function b(Ae,we){return Ae=Si(Ae,we),Ae.index=0,Ae.sibling=null,Ae}function S(Ae,we,je){return Ae.index=je,i?(je=Ae.alternate,je!==null?(je=je.index,je<we?(Ae.flags|=67108866,we):je):(Ae.flags|=67108866,we)):(Ae.flags|=1048576,we)}function M(Ae){return i&&Ae.alternate===null&&(Ae.flags|=67108866),Ae}function X(Ae,we,je,Ve){return we===null||we.tag!==6?(we=Du(je,Ae.mode,Ve),we.return=Ae,we):(we=b(we,je),we.return=Ae,we)}function pe(Ae,we,je,Ve){var kt=je.type;return kt===E?Fe(Ae,we,je.props.children,Ve,je.key):we!==null&&(we.elementType===kt||typeof kt=="object"&&kt!==null&&kt.$$typeof===$&&Te(kt)===we.type)?(we=b(we,je.props),en(we,je),we.return=Ae,we):(we=Ml(je.type,je.key,je.props,null,Ae.mode,Ve),en(we,je),we.return=Ae,we)}function Re(Ae,we,je,Ve){return we===null||we.tag!==4||we.stateNode.containerInfo!==je.containerInfo||we.stateNode.implementation!==je.implementation?(we=Pl(je,Ae.mode,Ve),we.return=Ae,we):(we=b(we,je.children||[]),we.return=Ae,we)}function Fe(Ae,we,je,Ve,kt){return we===null||we.tag!==7?(we=ho(je,Ae.mode,Ve,kt),we.return=Ae,we):(we=b(we,je),we.return=Ae,we)}function Ge(Ae,we,je){if(typeof we=="string"&&we!==""||typeof we=="number"||typeof we=="bigint")return we=Du(""+we,Ae.mode,je),we.return=Ae,we;if(typeof we=="object"&&we!==null){switch(we.$$typeof){case m:return je=Ml(we.type,we.key,we.props,null,Ae.mode,je),en(je,we),je.return=Ae,je;case x:return we=Pl(we,Ae.mode,je),we.return=Ae,we;case $:return we=Te(we),Ge(Ae,we,je)}if(me(we)||z(we))return we=ho(we,Ae.mode,je,null),we.return=Ae,we;if(typeof we.then=="function")return Ge(Ae,lt(we),je);if(we.$$typeof===T)return Ge(Ae,Tc(Ae,we),je);dt(Ae,we)}return null}function De(Ae,we,je,Ve){var kt=we!==null?we.key:null;if(typeof je=="string"&&je!==""||typeof je=="number"||typeof je=="bigint")return kt!==null?null:X(Ae,we,""+je,Ve);if(typeof je=="object"&&je!==null){switch(je.$$typeof){case m:return je.key===kt?pe(Ae,we,je,Ve):null;case x:return je.key===kt?Re(Ae,we,je,Ve):null;case $:return je=Te(je),De(Ae,we,je,Ve)}if(me(je)||z(je))return kt!==null?null:Fe(Ae,we,je,Ve,null);if(typeof je.then=="function")return De(Ae,we,lt(je),Ve);if(je.$$typeof===T)return De(Ae,we,Tc(Ae,je),Ve);dt(Ae,je)}return null}function ke(Ae,we,je,Ve,kt){if(typeof Ve=="string"&&Ve!==""||typeof Ve=="number"||typeof Ve=="bigint")return Ae=Ae.get(je)||null,X(we,Ae,""+Ve,kt);if(typeof Ve=="object"&&Ve!==null){switch(Ve.$$typeof){case m:return Ae=Ae.get(Ve.key===null?je:Ve.key)||null,pe(we,Ae,Ve,kt);case x:return Ae=Ae.get(Ve.key===null?je:Ve.key)||null,Re(we,Ae,Ve,kt);case $:return Ve=Te(Ve),ke(Ae,we,je,Ve,kt)}if(me(Ve)||z(Ve))return Ae=Ae.get(je)||null,Fe(we,Ae,Ve,kt,null);if(typeof Ve.then=="function")return ke(Ae,we,je,lt(Ve),kt);if(Ve.$$typeof===T)return ke(Ae,we,je,Tc(we,Ve),kt);dt(we,Ve)}return null}function mt(Ae,we,je,Ve){for(var kt=null,In=null,St=we,mn=we=0,An=null;St!==null&&mn<je.length;mn++){St.index>mn?(An=St,St=null):An=St.sibling;var Fn=De(Ae,St,je[mn],Ve);if(Fn===null){St===null&&(St=An);break}i&&St&&Fn.alternate===null&&o(Ae,St),we=S(Fn,we,mn),In===null?kt=Fn:In.sibling=Fn,In=Fn,St=An}if(mn===je.length)return f(Ae,St),xn&&pi(Ae,mn),kt;if(St===null){for(;mn<je.length;mn++)St=Ge(Ae,je[mn],Ve),St!==null&&(we=S(St,we,mn),In===null?kt=St:In.sibling=St,In=St);return xn&&pi(Ae,mn),kt}for(St=p(St);mn<je.length;mn++)An=ke(St,Ae,mn,je[mn],Ve),An!==null&&(i&&An.alternate!==null&&St.delete(An.key===null?mn:An.key),we=S(An,we,mn),In===null?kt=An:In.sibling=An,In=An);return i&&St.forEach(function(ru){return o(Ae,ru)}),xn&&pi(Ae,mn),kt}function Vt(Ae,we,je,Ve){if(je==null)throw Error(r(151));for(var kt=null,In=null,St=we,mn=we=0,An=null,Fn=je.next();St!==null&&!Fn.done;mn++,Fn=je.next()){St.index>mn?(An=St,St=null):An=St.sibling;var ru=De(Ae,St,Fn.value,Ve);if(ru===null){St===null&&(St=An);break}i&&St&&ru.alternate===null&&o(Ae,St),we=S(ru,we,mn),In===null?kt=ru:In.sibling=ru,In=ru,St=An}if(Fn.done)return f(Ae,St),xn&&pi(Ae,mn),kt;if(St===null){for(;!Fn.done;mn++,Fn=je.next())Fn=Ge(Ae,Fn.value,Ve),Fn!==null&&(we=S(Fn,we,mn),In===null?kt=Fn:In.sibling=Fn,In=Fn);return xn&&pi(Ae,mn),kt}for(St=p(St);!Fn.done;mn++,Fn=je.next())Fn=ke(St,Ae,mn,Fn.value,Ve),Fn!==null&&(i&&Fn.alternate!==null&&St.delete(Fn.key===null?mn:Fn.key),we=S(Fn,we,mn),In===null?kt=Fn:In.sibling=Fn,In=Fn);return i&&St.forEach(function(hA){return o(Ae,hA)}),xn&&pi(Ae,mn),kt}function or(Ae,we,je,Ve){if(typeof je=="object"&&je!==null&&je.type===E&&je.key===null&&(je=je.props.children),typeof je=="object"&&je!==null){switch(je.$$typeof){case m:e:{for(var kt=je.key;we!==null;){if(we.key===kt){if(kt=je.type,kt===E){if(we.tag===7){f(Ae,we.sibling),Ve=b(we,je.props.children),Ve.return=Ae,Ae=Ve;break e}}else if(we.elementType===kt||typeof kt=="object"&&kt!==null&&kt.$$typeof===$&&Te(kt)===we.type){f(Ae,we.sibling),Ve=b(we,je.props),en(Ve,je),Ve.return=Ae,Ae=Ve;break e}f(Ae,we);break}else o(Ae,we);we=we.sibling}je.type===E?(Ve=ho(je.props.children,Ae.mode,Ve,je.key),Ve.return=Ae,Ae=Ve):(Ve=Ml(je.type,je.key,je.props,null,Ae.mode,Ve),en(Ve,je),Ve.return=Ae,Ae=Ve)}return M(Ae);case x:e:{for(kt=je.key;we!==null;){if(we.key===kt)if(we.tag===4&&we.stateNode.containerInfo===je.containerInfo&&we.stateNode.implementation===je.implementation){f(Ae,we.sibling),Ve=b(we,je.children||[]),Ve.return=Ae,Ae=Ve;break e}else{f(Ae,we);break}else o(Ae,we);we=we.sibling}Ve=Pl(je,Ae.mode,Ve),Ve.return=Ae,Ae=Ve}return M(Ae);case $:return je=Te(je),or(Ae,we,je,Ve)}if(me(je))return mt(Ae,we,je,Ve);if(z(je)){if(kt=z(je),typeof kt!="function")throw Error(r(150));return je=kt.call(je),Vt(Ae,we,je,Ve)}if(typeof je.then=="function")return or(Ae,we,lt(je),Ve);if(je.$$typeof===T)return or(Ae,we,Tc(Ae,je),Ve);dt(Ae,je)}return typeof je=="string"&&je!==""||typeof je=="number"||typeof je=="bigint"?(je=""+je,we!==null&&we.tag===6?(f(Ae,we.sibling),Ve=b(we,je),Ve.return=Ae,Ae=Ve):(f(Ae,we),Ve=Du(je,Ae.mode,Ve),Ve.return=Ae,Ae=Ve),M(Ae)):f(Ae,we)}return function(Ae,we,je,Ve){try{vt=0;var kt=or(Ae,we,je,Ve);return We=null,kt}catch(St){if(St===ye||St===le)throw St;var In=La(29,St,null,Ae.mode);return In.lanes=Ve,In.return=Ae,In}finally{}}}var cr=wn(!0),sn=wn(!1),ut=!1;function nt(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function gr(i,o){i=i.updateQueue,o.updateQueue===i&&(o.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,callbacks:null})}function Bt(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function un(i,o,f){var p=i.updateQueue;if(p===null)return null;if(p=p.shared,(qn&2)!==0){var b=p.pending;return b===null?o.next=o:(o.next=b.next,b.next=o),p.pending=o,o=Ta(i),ju(i,null,f),o}return Ou(i,p,o,f),Ta(i)}function $n(i,o,f){if(o=o.updateQueue,o!==null&&(o=o.shared,(f&4194048)!==0)){var p=o.lanes;p&=i.pendingLanes,f|=p,o.lanes=f,de(i,f)}}function Zr(i,o){var f=i.updateQueue,p=i.alternate;if(p!==null&&(p=p.updateQueue,f===p)){var b=null,S=null;if(f=f.firstBaseUpdate,f!==null){do{var M={lane:f.lane,tag:f.tag,payload:f.payload,callback:null,next:null};S===null?b=S=M:S=S.next=M,f=f.next}while(f!==null);S===null?b=S=o:S=S.next=o}else b=S=o;f={baseState:p.baseState,firstBaseUpdate:b,lastBaseUpdate:S,shared:p.shared,callbacks:p.callbacks},i.updateQueue=f;return}i=f.lastBaseUpdate,i===null?f.firstBaseUpdate=o:i.next=o,f.lastBaseUpdate=o}var wa=!1;function ar(){if(wa){var i=w;if(i!==null)throw i}}function Fr(i,o,f,p){wa=!1;var b=i.updateQueue;ut=!1;var S=b.firstBaseUpdate,M=b.lastBaseUpdate,X=b.shared.pending;if(X!==null){b.shared.pending=null;var pe=X,Re=pe.next;pe.next=null,M===null?S=Re:M.next=Re,M=pe;var Fe=i.alternate;Fe!==null&&(Fe=Fe.updateQueue,X=Fe.lastBaseUpdate,X!==M&&(X===null?Fe.firstBaseUpdate=Re:X.next=Re,Fe.lastBaseUpdate=pe))}if(S!==null){var Ge=b.baseState;M=0,Fe=Re=pe=null,X=S;do{var De=X.lane&-536870913,ke=De!==X.lane;if(ke?(En&De)===De:(p&De)===De){De!==0&&De===v&&(wa=!0),Fe!==null&&(Fe=Fe.next={lane:0,tag:X.tag,payload:X.payload,callback:null,next:null});e:{var mt=i,Vt=X;De=o;var or=f;switch(Vt.tag){case 1:if(mt=Vt.payload,typeof mt=="function"){Ge=mt.call(or,Ge,De);break e}Ge=mt;break e;case 3:mt.flags=mt.flags&-65537|128;case 0:if(mt=Vt.payload,De=typeof mt=="function"?mt.call(or,Ge,De):mt,De==null)break e;Ge=g({},Ge,De);break e;case 2:ut=!0}}De=X.callback,De!==null&&(i.flags|=64,ke&&(i.flags|=8192),ke=b.callbacks,ke===null?b.callbacks=[De]:ke.push(De))}else ke={lane:De,tag:X.tag,payload:X.payload,callback:X.callback,next:null},Fe===null?(Re=Fe=ke,pe=Ge):Fe=Fe.next=ke,M|=De;if(X=X.next,X===null){if(X=b.shared.pending,X===null)break;ke=X,X=ke.next,ke.next=null,b.lastBaseUpdate=ke,b.shared.pending=null}}while(!0);Fe===null&&(pe=Ge),b.baseState=pe,b.firstBaseUpdate=Re,b.lastBaseUpdate=Fe,S===null&&(b.shared.lanes=0),Gl|=M,i.lanes=M,i.memoizedState=Ge}}function Oa(i,o){if(typeof i!="function")throw Error(r(191,i));i.call(o)}function Ur(i,o){var f=i.callbacks;if(f!==null)for(i.callbacks=null,i=0;i<f.length;i++)Oa(f[i],o)}var vn=U(null),Ln=U(0);function vr(i,o){i=sl,Y(Ln,i),Y(vn,o),sl=i|o.baseLanes}function kn(){Y(Ln,sl),Y(vn,vn.current)}function Qr(){sl=Ln.current,j(vn),j(Ln)}var yr=U(null),On=null;function jr(i){var o=i.alternate;Y(Tn,Tn.current&1),Y(yr,i),On===null&&(o===null||vn.current!==null||o.memoizedState!==null)&&(On=i)}function zn(i){Y(Tn,Tn.current),Y(yr,i),On===null&&(On=i)}function Br(i){i.tag===22?(Y(Tn,Tn.current),Y(yr,i),On===null&&(On=i)):$r()}function $r(){Y(Tn,Tn.current),Y(yr,yr.current)}function Zn(i){j(yr),On===i&&(On=null),j(Tn)}var Tn=U(0);function ja(i){for(var o=i;o!==null;){if(o.tag===13){var f=o.memoizedState;if(f!==null&&(f=f.dehydrated,f===null||m0(f)||g0(f)))return o}else if(o.tag===19&&(o.memoizedProps.revealOrder==="forwards"||o.memoizedProps.revealOrder==="backwards"||o.memoizedProps.revealOrder==="unstable_legacy-backwards"||o.memoizedProps.revealOrder==="together")){if((o.flags&128)!==0)return o}else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===i)break;for(;o.sibling===null;){if(o.return===null||o.return===i)return null;o=o.return}o.sibling.return=o.return,o=o.sibling}return null}var _r=0,Rt=null,Dt=null,jn=null,Za=!1,Li=!1,za=!1,zr=0,wo=0,xo=null,Oc=0;function ir(){throw Error(r(321))}function Gf(i,o){if(o===null)return!1;for(var f=0;f<o.length&&f<i.length;f++)if(!ma(i[f],o[f]))return!1;return!0}function Wf(i,o,f,p,b,S){return _r=S,Rt=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,Z.H=i===null||i.memoizedState===null?Q2:Ng,za=!1,S=f(p,b),za=!1,Li&&(S=Gs(o,f,p,b)),jc(i),S}function jc(i){Z.H=nh;var o=Dt!==null&&Dt.next!==null;if(_r=0,jn=Dt=Rt=null,Za=!1,wo=0,xo=null,o)throw Error(r(300));i===null||oa||(i=i.dependencies,i!==null&&Cc(i)&&(oa=!0))}function Gs(i,o,f,p){Rt=i;var b=0;do{if(Li&&(xo=null),wo=0,Li=!1,25<=b)throw Error(r(301));if(b+=1,jn=Dt=null,i.updateQueue!=null){var S=i.updateQueue;S.lastEffect=null,S.events=null,S.stores=null,S.memoCache!=null&&(S.memoCache.index=0)}Z.H=ey,S=o(f,p)}while(Li);return S}function bg(){var i=Z.H,o=i.useState()[0];return o=typeof o.then=="function"?So(o):o,i=i.useState()[0],(Dt!==null?Dt.memoizedState:null)!==i&&(Rt.flags|=1024),o}function Kf(){var i=zr!==0;return zr=0,i}function Jf(i,o,f){o.updateQueue=i.updateQueue,o.flags&=-2053,i.lanes&=~f}function Rc(i){if(Za){for(i=i.memoizedState;i!==null;){var o=i.queue;o!==null&&(o.pending=null),i=i.next}Za=!1}_r=0,jn=Dt=Rt=null,Li=!1,wo=zr=0,xo=null}function sa(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return jn===null?Rt.memoizedState=jn=i:jn=jn.next=i,jn}function Er(){if(Dt===null){var i=Rt.alternate;i=i!==null?i.memoizedState:null}else i=Dt.next;var o=jn===null?Rt.memoizedState:jn.next;if(o!==null)jn=o,Dt=i;else{if(i===null)throw Rt.alternate===null?Error(r(467)):Error(r(310));Dt=i,i={memoizedState:Dt.memoizedState,baseState:Dt.baseState,baseQueue:Dt.baseQueue,queue:Dt.queue,next:null},jn===null?Rt.memoizedState=jn=i:jn=jn.next=i}return jn}function Iu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function So(i){var o=wo;return wo+=1,xo===null&&(xo=[]),i=Ie(xo,i,o),o=Rt,(jn===null?o.memoizedState:jn.next)===null&&(o=o.alternate,Z.H=o===null||o.memoizedState===null?Q2:Ng),i}function $l(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return So(i);if(i.$$typeof===T)return ba(i)}throw Error(r(438,String(i)))}function Xo(i){var o=null,f=Rt.updateQueue;if(f!==null&&(o=f.memoCache),o==null){var p=Rt.alternate;p!==null&&(p=p.updateQueue,p!==null&&(p=p.memoCache,p!=null&&(o={data:p.data.map(function(b){return b.slice()}),index:0})))}if(o==null&&(o={data:[],index:0}),f===null&&(f=Iu(),Rt.updateQueue=f),f.memoCache=o,f=o.data[o.index],f===void 0)for(f=o.data[o.index]=Array(i),p=0;p<i;p++)f[p]=ne;return o.index++,f}function ws(i,o){return typeof o=="function"?o(i):o}function Dc(i){var o=Er();return zl(o,Dt,i)}function zl(i,o,f){var p=i.queue;if(p===null)throw Error(r(311));p.lastRenderedReducer=f;var b=i.baseQueue,S=p.pending;if(S!==null){if(b!==null){var M=b.next;b.next=S.next,S.next=M}o.baseQueue=b=S,p.pending=null}if(S=i.baseState,b===null)i.memoizedState=S;else{o=b.next;var X=M=null,pe=null,Re=o,Fe=!1;do{var Ge=Re.lane&-536870913;if(Ge!==Re.lane?(En&Ge)===Ge:(_r&Ge)===Ge){var De=Re.revertLane;if(De===0)pe!==null&&(pe=pe.next={lane:0,revertLane:0,gesture:null,action:Re.action,hasEagerState:Re.hasEagerState,eagerState:Re.eagerState,next:null}),Ge===v&&(Fe=!0);else if((_r&De)===De){Re=Re.next,De===v&&(Fe=!0);continue}else Ge={lane:0,revertLane:Re.revertLane,gesture:null,action:Re.action,hasEagerState:Re.hasEagerState,eagerState:Re.eagerState,next:null},pe===null?(X=pe=Ge,M=S):pe=pe.next=Ge,Rt.lanes|=De,Gl|=De;Ge=Re.action,za&&f(S,Ge),S=Re.hasEagerState?Re.eagerState:f(S,Ge)}else De={lane:Ge,revertLane:Re.revertLane,gesture:Re.gesture,action:Re.action,hasEagerState:Re.hasEagerState,eagerState:Re.eagerState,next:null},pe===null?(X=pe=De,M=S):pe=pe.next=De,Rt.lanes|=Ge,Gl|=Ge;Re=Re.next}while(Re!==null&&Re!==o);if(pe===null?M=S:pe.next=X,!ma(S,i.memoizedState)&&(oa=!0,Fe&&(f=w,f!==null)))throw f;i.memoizedState=S,i.baseState=M,i.baseQueue=pe,p.lastRenderedState=S}return b===null&&(p.lanes=0),[i.memoizedState,p.dispatch]}function kc(i){var o=Er(),f=o.queue;if(f===null)throw Error(r(311));f.lastRenderedReducer=i;var p=f.dispatch,b=f.pending,S=o.memoizedState;if(b!==null){f.pending=null;var M=b=b.next;do S=i(S,M.action),M=M.next;while(M!==b);ma(S,o.memoizedState)||(oa=!0),o.memoizedState=S,o.baseQueue===null&&(o.baseState=S),f.lastRenderedState=S}return[S,p]}function Mc(i,o,f){var p=Rt,b=Er(),S=xn;if(S){if(f===void 0)throw Error(r(407));f=f()}else f=o();var M=!ma((Dt||b).memoizedState,f);if(M&&(b.memoizedState=f,oa=!0),b=b.queue,wg(Zf.bind(null,p,b,i),[i]),b.getSnapshot!==o||M||jn!==null&&jn.memoizedState.tag&1){if(p.flags|=2048,Qo(9,{destroy:void 0},Xf.bind(null,p,b,f,o),null),fr===null)throw Error(r(349));S||(_r&127)!==0||Ws(p,o,f)}return f}function Ws(i,o,f){i.flags|=16384,i={getSnapshot:o,value:f},o=Rt.updateQueue,o===null?(o=Iu(),Rt.updateQueue=o,o.stores=[i]):(f=o.stores,f===null?o.stores=[i]:f.push(i))}function Xf(i,o,f,p){o.value=f,o.getSnapshot=p,Cd(o)&&Qf(i)}function Zf(i,o,f){return f(function(){Cd(o)&&Qf(i)})}function Cd(i){var o=i.getSnapshot;i=i.value;try{var f=o();return!ma(i,f)}catch{return!0}}function Qf(i){var o=Vs(i,2);o!==null&&ki(o,i,2)}function _o(i){var o=sa();if(typeof i=="function"){var f=i;if(i=f(),za){qt(!0);try{f()}finally{qt(!1)}}}return o.memoizedState=o.baseState=i,o.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ws,lastRenderedState:i},o}function Td(i,o,f,p){return i.baseState=f,zl(i,Dt,typeof p=="function"?p:ws)}function Ld(i,o,f,p,b){if(Dd(i))throw Error(r(485));if(i=o.action,i!==null){var S={payload:b,action:i,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(M){S.listeners.push(M)}};Z.T!==null?f(!0):S.isTransition=!1,p(S),f=o.pending,f===null?(S.next=o.pending=S,Od(o,S)):(S.next=f.next,o.pending=f.next=S)}}function Od(i,o){var f=o.action,p=o.payload,b=i.state;if(o.isTransition){var S=Z.T,M={};Z.T=M;try{var X=f(b,p),pe=Z.S;pe!==null&&pe(M,X),eh(i,o,X)}catch(Re){Zo(i,o,Re)}finally{S!==null&&M.types!==null&&(S.types=M.types),Z.T=S}}else try{S=f(b,p),eh(i,o,S)}catch(Re){Zo(i,o,Re)}}function eh(i,o,f){f!==null&&typeof f=="object"&&typeof f.then=="function"?f.then(function(p){jd(i,o,p)},function(p){return Zo(i,o,p)}):jd(i,o,f)}function jd(i,o,f){o.status="fulfilled",o.value=f,Pc(o),i.state=f,o=i.pending,o!==null&&(f=o.next,f===o?i.pending=null:(f=f.next,o.next=f,Od(i,f)))}function Zo(i,o,f){var p=i.pending;if(i.pending=null,p!==null){p=p.next;do o.status="rejected",o.reason=f,Pc(o),o=o.next;while(o!==p)}i.action=null}function Pc(i){i=i.listeners;for(var o=0;o<i.length;o++)(0,i[o])()}function Fu(i,o){return o}function xs(i,o){if(xn){var f=fr.formState;if(f!==null){e:{var p=Rt;if(xn){if(ur){t:{for(var b=ur,S=Sr;b.nodeType!==8;){if(!S){b=null;break t}if(b=Ss(b.nextSibling),b===null){b=null;break t}}S=b.data,b=S==="F!"||S==="F"?b:null}if(b){ur=Ss(b.nextSibling),p=b.data==="F!";break e}}mo(p)}p=!1}p&&(o=f[0])}}return f=sa(),f.memoizedState=f.baseState=o,p={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fu,lastRenderedState:o},f.queue=p,f=J2.bind(null,Rt,p),p.dispatch=f,p=_o(!1),S=Ag.bind(null,Rt,!1,p.queue),p=sa(),b={state:o,dispatch:null,action:i,pending:null},p.queue=b,f=Ld.bind(null,Rt,b,S,f),b.dispatch=f,p.memoizedState=i,[o,f,!1]}function Ks(i){var o=Er();return Js(o,Dt,i)}function Js(i,o,f){if(o=zl(i,o,Fu)[0],i=Dc(ws)[0],typeof o=="object"&&o!==null&&typeof o.then=="function")try{var p=So(o)}catch(M){throw M===ye?le:M}else p=o;o=Er();var b=o.queue,S=b.dispatch;return f!==o.memoizedState&&(Rt.flags|=2048,Qo(9,{destroy:void 0},Ic.bind(null,b,f),null)),[p,S,i]}function Ic(i,o){i.action=o}function Fc(i){var o=Er(),f=Dt;if(f!==null)return Js(o,f,i);Er(),o=o.memoizedState,f=Er();var p=f.queue.dispatch;return f.memoizedState=i,[o,p,!1]}function Qo(i,o,f,p){return i={tag:i,create:f,deps:p,inst:o,next:null},o=Rt.updateQueue,o===null&&(o=Iu(),Rt.updateQueue=o),f=o.lastEffect,f===null?o.lastEffect=i.next=i:(p=f.next,f.next=i,i.next=p,o.lastEffect=i),i}function Rd(){return Er().memoizedState}function ql(i,o,f,p){var b=sa();Rt.flags|=i,b.memoizedState=Qo(1|o,{destroy:void 0},f,p===void 0?null:p)}function Hl(i,o,f,p){var b=Er();p=p===void 0?null:p;var S=b.memoizedState.inst;Dt!==null&&p!==null&&Gf(p,Dt.memoizedState.deps)?b.memoizedState=Qo(o,S,f,p):(Rt.flags|=i,b.memoizedState=Qo(1|o,S,f,p))}function P2(i,o){ql(8390656,8,i,o)}function wg(i,o){Hl(2048,8,i,o)}function sE(i){Rt.flags|=4;var o=Rt.updateQueue;if(o===null)o=Iu(),Rt.updateQueue=o,o.events=[i];else{var f=o.events;f===null?o.events=[i]:f.push(i)}}function I2(i){var o=Er().memoizedState;return sE({ref:o,nextImpl:i}),function(){if((qn&2)!==0)throw Error(r(440));return o.impl.apply(void 0,arguments)}}function F2(i,o){return Hl(4,2,i,o)}function U2(i,o){return Hl(4,4,i,o)}function B2(i,o){if(typeof o=="function"){i=i();var f=o(i);return function(){typeof f=="function"?f():o(null)}}if(o!=null)return i=i(),o.current=i,function(){o.current=null}}function $2(i,o,f){f=f!=null?f.concat([i]):null,Hl(4,4,B2.bind(null,o,i),f)}function xg(){}function z2(i,o){var f=Er();o=o===void 0?null:o;var p=f.memoizedState;return o!==null&&Gf(o,p[1])?p[0]:(f.memoizedState=[i,o],i)}function q2(i,o){var f=Er();o=o===void 0?null:o;var p=f.memoizedState;if(o!==null&&Gf(o,p[1]))return p[0];if(p=i(),za){qt(!0);try{i()}finally{qt(!1)}}return f.memoizedState=[p,o],p}function Sg(i,o,f){return f===void 0||(_r&1073741824)!==0&&(En&261930)===0?i.memoizedState=o:(i.memoizedState=f,i=Hy(),Rt.lanes|=i,Gl|=i,f)}function H2(i,o,f,p){return ma(f,o)?f:vn.current!==null?(i=Sg(i,f,p),ma(i,o)||(oa=!0),i):(_r&42)===0||(_r&1073741824)!==0&&(En&261930)===0?(oa=!0,i.memoizedState=f):(i=Hy(),Rt.lanes|=i,Gl|=i,o)}function V2(i,o,f,p,b){var S=ce.p;ce.p=S!==0&&8>S?S:8;var M=Z.T,X={};Z.T=X,Ag(i,!1,o,f);try{var pe=b(),Re=Z.S;if(Re!==null&&Re(X,pe),pe!==null&&typeof pe=="object"&&typeof pe.then=="function"){var Fe=H(pe,p);th(i,o,Fe,Ji(i))}else th(i,o,p,Ji(i))}catch(Ge){th(i,o,{then:function(){},status:"rejected",reason:Ge},Ji())}finally{ce.p=S,M!==null&&X.types!==null&&(M.types=X.types),Z.T=M}}function oE(){}function _g(i,o,f,p){if(i.tag!==5)throw Error(r(476));var b=Y2(i).queue;V2(i,b,o,oe,f===null?oE:function(){return G2(i),f(p)})}function Y2(i){var o=i.memoizedState;if(o!==null)return o;o={memoizedState:oe,baseState:oe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ws,lastRenderedState:oe},next:null};var f={};return o.next={memoizedState:f,baseState:f,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ws,lastRenderedState:f},next:null},i.memoizedState=o,i=i.alternate,i!==null&&(i.memoizedState=o),o}function G2(i){var o=Y2(i);o.next===null&&(o=i.alternate.memoizedState),th(i,o.next.queue,{},Ji())}function Eg(){return ba(yh)}function W2(){return Er().memoizedState}function K2(){return Er().memoizedState}function lE(i){for(var o=i.return;o!==null;){switch(o.tag){case 24:case 3:var f=Ji();i=Bt(f);var p=un(o,i,f);p!==null&&(ki(p,o,f),$n(p,o,f)),o={cache:Bl()},i.payload=o;return}o=o.return}}function uE(i,o,f){var p=Ji();f={lane:p,revertLane:0,gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null},Dd(i)?X2(o,f):(f=bc(i,o,f,p),f!==null&&(ki(f,i,p),Z2(f,o,p)))}function J2(i,o,f){var p=Ji();th(i,o,f,p)}function th(i,o,f,p){var b={lane:p,revertLane:0,gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null};if(Dd(i))X2(o,b);else{var S=i.alternate;if(i.lanes===0&&(S===null||S.lanes===0)&&(S=o.lastRenderedReducer,S!==null))try{var M=o.lastRenderedState,X=S(M,f);if(b.hasEagerState=!0,b.eagerState=X,ma(X,M))return Ou(i,o,b,0),fr===null&&Lu(),!1}catch{}finally{}if(f=bc(i,o,b,p),f!==null)return ki(f,i,p),Z2(f,o,p),!0}return!1}function Ag(i,o,f,p){if(p={lane:2,revertLane:r0(),gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null},Dd(i)){if(o)throw Error(r(479))}else o=bc(i,f,p,2),o!==null&&ki(o,i,2)}function Dd(i){var o=i.alternate;return i===Rt||o!==null&&o===Rt}function X2(i,o){Li=Za=!0;var f=i.pending;f===null?o.next=o:(o.next=f.next,f.next=o),i.pending=o}function Z2(i,o,f){if((f&4194048)!==0){var p=o.lanes;p&=i.pendingLanes,f|=p,o.lanes=f,de(i,f)}}var nh={readContext:ba,use:$l,useCallback:ir,useContext:ir,useEffect:ir,useImperativeHandle:ir,useLayoutEffect:ir,useInsertionEffect:ir,useMemo:ir,useReducer:ir,useRef:ir,useState:ir,useDebugValue:ir,useDeferredValue:ir,useTransition:ir,useSyncExternalStore:ir,useId:ir,useHostTransitionStatus:ir,useFormState:ir,useActionState:ir,useOptimistic:ir,useMemoCache:ir,useCacheRefresh:ir};nh.useEffectEvent=ir;var Q2={readContext:ba,use:$l,useCallback:function(i,o){return sa().memoizedState=[i,o===void 0?null:o],i},useContext:ba,useEffect:P2,useImperativeHandle:function(i,o,f){f=f!=null?f.concat([i]):null,ql(4194308,4,B2.bind(null,o,i),f)},useLayoutEffect:function(i,o){return ql(4194308,4,i,o)},useInsertionEffect:function(i,o){ql(4,2,i,o)},useMemo:function(i,o){var f=sa();o=o===void 0?null:o;var p=i();if(za){qt(!0);try{i()}finally{qt(!1)}}return f.memoizedState=[p,o],p},useReducer:function(i,o,f){var p=sa();if(f!==void 0){var b=f(o);if(za){qt(!0);try{f(o)}finally{qt(!1)}}}else b=o;return p.memoizedState=p.baseState=b,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:b},p.queue=i,i=i.dispatch=uE.bind(null,Rt,i),[p.memoizedState,i]},useRef:function(i){var o=sa();return i={current:i},o.memoizedState=i},useState:function(i){i=_o(i);var o=i.queue,f=J2.bind(null,Rt,o);return o.dispatch=f,[i.memoizedState,f]},useDebugValue:xg,useDeferredValue:function(i,o){var f=sa();return Sg(f,i,o)},useTransition:function(){var i=_o(!1);return i=V2.bind(null,Rt,i.queue,!0,!1),sa().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,o,f){var p=Rt,b=sa();if(xn){if(f===void 0)throw Error(r(407));f=f()}else{if(f=o(),fr===null)throw Error(r(349));(En&127)!==0||Ws(p,o,f)}b.memoizedState=f;var S={value:f,getSnapshot:o};return b.queue=S,P2(Zf.bind(null,p,S,i),[i]),p.flags|=2048,Qo(9,{destroy:void 0},Xf.bind(null,p,S,f,o),null),f},useId:function(){var i=sa(),o=fr.identifierPrefix;if(xn){var f=Ci,p=Ni;f=(p&~(1<<32-pn(p)-1)).toString(32)+f,o="_"+o+"R_"+f,f=zr++,0<f&&(o+="H"+f.toString(32)),o+="_"}else f=Oc++,o="_"+o+"r_"+f.toString(32)+"_";return i.memoizedState=o},useHostTransitionStatus:Eg,useFormState:xs,useActionState:xs,useOptimistic:function(i){var o=sa();o.memoizedState=o.baseState=i;var f={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return o.queue=f,o=Ag.bind(null,Rt,!0,f),f.dispatch=o,[i,o]},useMemoCache:Xo,useCacheRefresh:function(){return sa().memoizedState=lE.bind(null,Rt)},useEffectEvent:function(i){var o=sa(),f={impl:i};return o.memoizedState=f,function(){if((qn&2)!==0)throw Error(r(440));return f.impl.apply(void 0,arguments)}}},Ng={readContext:ba,use:$l,useCallback:z2,useContext:ba,useEffect:wg,useImperativeHandle:$2,useInsertionEffect:F2,useLayoutEffect:U2,useMemo:q2,useReducer:Dc,useRef:Rd,useState:function(){return Dc(ws)},useDebugValue:xg,useDeferredValue:function(i,o){var f=Er();return H2(f,Dt.memoizedState,i,o)},useTransition:function(){var i=Dc(ws)[0],o=Er().memoizedState;return[typeof i=="boolean"?i:So(i),o]},useSyncExternalStore:Mc,useId:W2,useHostTransitionStatus:Eg,useFormState:Ks,useActionState:Ks,useOptimistic:function(i,o){var f=Er();return Td(f,Dt,i,o)},useMemoCache:Xo,useCacheRefresh:K2};Ng.useEffectEvent=I2;var ey={readContext:ba,use:$l,useCallback:z2,useContext:ba,useEffect:wg,useImperativeHandle:$2,useInsertionEffect:F2,useLayoutEffect:U2,useMemo:q2,useReducer:kc,useRef:Rd,useState:function(){return kc(ws)},useDebugValue:xg,useDeferredValue:function(i,o){var f=Er();return Dt===null?Sg(f,i,o):H2(f,Dt.memoizedState,i,o)},useTransition:function(){var i=kc(ws)[0],o=Er().memoizedState;return[typeof i=="boolean"?i:So(i),o]},useSyncExternalStore:Mc,useId:W2,useHostTransitionStatus:Eg,useFormState:Fc,useActionState:Fc,useOptimistic:function(i,o){var f=Er();return Dt!==null?Td(f,Dt,i,o):(f.baseState=i,[i,f.queue.dispatch])},useMemoCache:Xo,useCacheRefresh:K2};ey.useEffectEvent=I2;function Cg(i,o,f,p){o=i.memoizedState,f=f(p,o),f=f==null?o:g({},o,f),i.memoizedState=f,i.lanes===0&&(i.updateQueue.baseState=f)}var Tg={enqueueSetState:function(i,o,f){i=i._reactInternals;var p=Ji(),b=Bt(p);b.payload=o,f!=null&&(b.callback=f),o=un(i,b,p),o!==null&&(ki(o,i,p),$n(o,i,p))},enqueueReplaceState:function(i,o,f){i=i._reactInternals;var p=Ji(),b=Bt(p);b.tag=1,b.payload=o,f!=null&&(b.callback=f),o=un(i,b,p),o!==null&&(ki(o,i,p),$n(o,i,p))},enqueueForceUpdate:function(i,o){i=i._reactInternals;var f=Ji(),p=Bt(f);p.tag=2,o!=null&&(p.callback=o),o=un(i,p,f),o!==null&&(ki(o,i,f),$n(o,i,f))}};function ty(i,o,f,p,b,S,M){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(p,S,M):o.prototype&&o.prototype.isPureReactComponent?!$s(f,p)||!$s(b,S):!0}function ny(i,o,f,p){i=o.state,typeof o.componentWillReceiveProps=="function"&&o.componentWillReceiveProps(f,p),typeof o.UNSAFE_componentWillReceiveProps=="function"&&o.UNSAFE_componentWillReceiveProps(f,p),o.state!==i&&Tg.enqueueReplaceState(o,o.state,null)}function Uu(i,o){var f=o;if("ref"in o){f={};for(var p in o)p!=="ref"&&(f[p]=o[p])}if(i=i.defaultProps){f===o&&(f=g({},f));for(var b in i)f[b]===void 0&&(f[b]=i[b])}return f}function ry(i){Tu(i)}function ay(i){console.error(i)}function iy(i){Tu(i)}function kd(i,o){try{var f=i.onUncaughtError;f(o.value,{componentStack:o.stack})}catch(p){setTimeout(function(){throw p})}}function sy(i,o,f){try{var p=i.onCaughtError;p(f.value,{componentStack:f.stack,errorBoundary:o.tag===1?o.stateNode:null})}catch(b){setTimeout(function(){throw b})}}function Lg(i,o,f){return f=Bt(f),f.tag=3,f.payload={element:null},f.callback=function(){kd(i,o)},f}function oy(i){return i=Bt(i),i.tag=3,i}function ly(i,o,f,p){var b=f.type.getDerivedStateFromError;if(typeof b=="function"){var S=p.value;i.payload=function(){return b(S)},i.callback=function(){sy(o,f,p)}}var M=f.stateNode;M!==null&&typeof M.componentDidCatch=="function"&&(i.callback=function(){sy(o,f,p),typeof b!="function"&&(Wl===null?Wl=new Set([this]):Wl.add(this));var X=p.stack;this.componentDidCatch(p.value,{componentStack:X!==null?X:""})})}function cE(i,o,f,p,b){if(f.flags|=32768,p!==null&&typeof p=="object"&&typeof p.then=="function"){if(o=f.alternate,o!==null&&yo(o,f,b,!0),f=yr.current,f!==null){switch(f.tag){case 31:case 13:return On===null?Yd():f.alternate===null&&qr===0&&(qr=3),f.flags&=-257,f.flags|=65536,f.lanes=b,p===_e?f.flags|=16384:(o=f.updateQueue,o===null?f.updateQueue=new Set([p]):o.add(p),e0(i,p,b)),!1;case 22:return f.flags|=65536,p===_e?f.flags|=16384:(o=f.updateQueue,o===null?(o={transitions:null,markerInstances:null,retryQueue:new Set([p])},f.updateQueue=o):(f=o.retryQueue,f===null?o.retryQueue=new Set([p]):f.add(p)),e0(i,p,b)),!1}throw Error(r(435,f.tag))}return e0(i,p,b),Yd(),!1}if(xn)return o=yr.current,o!==null?((o.flags&65536)===0&&(o.flags|=256),o.flags|=65536,o.lanes=b,p!==Gi&&(i=Error(r(422),{cause:p}),Fl(_i(i,f)))):(p!==Gi&&(o=Error(r(423),{cause:p}),Fl(_i(o,f))),i=i.current.alternate,i.flags|=65536,b&=-b,i.lanes|=b,p=_i(p,f),b=Lg(i.stateNode,p,b),Zr(i,b),qr!==4&&(qr=2)),!1;var S=Error(r(520),{cause:p});if(S=_i(S,f),ch===null?ch=[S]:ch.push(S),qr!==4&&(qr=2),o===null)return!0;p=_i(p,f),f=o;do{switch(f.tag){case 3:return f.flags|=65536,i=b&-b,f.lanes|=i,i=Lg(f.stateNode,p,i),Zr(f,i),!1;case 1:if(o=f.type,S=f.stateNode,(f.flags&128)===0&&(typeof o.getDerivedStateFromError=="function"||S!==null&&typeof S.componentDidCatch=="function"&&(Wl===null||!Wl.has(S))))return f.flags|=65536,b&=-b,f.lanes|=b,b=oy(b),ly(b,i,f,p),Zr(f,b),!1}f=f.return}while(f!==null);return!1}var Og=Error(r(461)),oa=!1;function qa(i,o,f,p){o.child=i===null?sn(o,null,f,p):cr(o,i.child,f,p)}function uy(i,o,f,p,b){f=f.render;var S=o.ref;if("ref"in p){var M={};for(var X in p)X!=="ref"&&(M[X]=p[X])}else M=p;return bo(o),p=Wf(i,o,f,M,S,b),X=Kf(),i!==null&&!oa?(Jf(i,o,b),el(i,o,b)):(xn&&X&&Hf(o),o.flags|=1,qa(i,o,p,b),o.child)}function cy(i,o,f,p,b){if(i===null){var S=f.type;return typeof S=="function"&&!xc(S)&&S.defaultProps===void 0&&f.compare===null?(o.tag=15,o.type=S,fy(i,o,S,p,b)):(i=Ml(f.type,null,p,o,o.mode,b),i.ref=o.ref,i.return=o,o.child=i)}if(S=i.child,!Fg(i,b)){var M=S.memoizedProps;if(f=f.compare,f=f!==null?f:$s,f(M,p)&&i.ref===o.ref)return el(i,o,b)}return o.flags|=1,i=Si(S,p),i.ref=o.ref,i.return=o,o.child=i}function fy(i,o,f,p,b){if(i!==null){var S=i.memoizedProps;if($s(S,p)&&i.ref===o.ref)if(oa=!1,o.pendingProps=p=S,Fg(i,b))(i.flags&131072)!==0&&(oa=!0);else return o.lanes=i.lanes,el(i,o,b)}return jg(i,o,f,p,b)}function hy(i,o,f,p){var b=p.children,S=i!==null?i.memoizedState:null;if(i===null&&o.stateNode===null&&(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),p.mode==="hidden"){if((o.flags&128)!==0){if(S=S!==null?S.baseLanes|f:f,i!==null){for(p=o.child=i.child,b=0;p!==null;)b=b|p.lanes|p.childLanes,p=p.sibling;p=b&~S}else p=0,o.child=null;return dy(i,o,S,f,p)}if((f&536870912)!==0)o.memoizedState={baseLanes:0,cachePool:null},i!==null&&re(o,S!==null?S.cachePool:null),S!==null?vr(o,S):kn(),Br(o);else return p=o.lanes=536870912,dy(i,o,S!==null?S.baseLanes|f:f,f,p)}else S!==null?(re(o,S.cachePool),vr(o,S),$r(),o.memoizedState=null):(i!==null&&re(o,null),kn(),$r());return qa(i,o,b,f),o.child}function rh(i,o){return i!==null&&i.tag===22||o.stateNode!==null||(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.sibling}function dy(i,o,f,p,b){var S=te();return S=S===null?null:{parent:Or._currentValue,pool:S},o.memoizedState={baseLanes:f,cachePool:S},i!==null&&re(o,null),kn(),Br(o),i!==null&&yo(i,o,p,!0),o.childLanes=b,null}function Md(i,o){return o=Id({mode:o.mode,children:o.children},i.mode),o.ref=i.ref,i.child=o,o.return=i,o}function py(i,o,f){return cr(o,i.child,null,f),i=Md(o,o.pendingProps),i.flags|=2,Zn(o),o.memoizedState=null,i}function fE(i,o,f){var p=o.pendingProps,b=(o.flags&128)!==0;if(o.flags&=-129,i===null){if(xn){if(p.mode==="hidden")return i=Md(o,p),o.lanes=536870912,rh(null,i);if(zn(o),(i=ur)?(i=Nb(i,Sr),i=i!==null&&i.data==="&"?i:null,i!==null&&(o.memoizedState={dehydrated:i,treeContext:po!==null?{id:Ni,overflow:Ci}:null,retryLane:536870912,hydrationErrors:null},f=Sc(i),f.return=o,o.child=f,va=o,ur=null)):i=null,i===null)throw mo(o);return o.lanes=536870912,null}return Md(o,p)}var S=i.memoizedState;if(S!==null){var M=S.dehydrated;if(zn(o),b)if(o.flags&256)o.flags&=-257,o=py(i,o,f);else if(o.memoizedState!==null)o.child=i.child,o.flags|=128,o=null;else throw Error(r(558));else if(oa||yo(i,o,f,!1),b=(f&i.childLanes)!==0,oa||b){if(p=fr,p!==null&&(M=Se(p,f),M!==0&&M!==S.retryLane))throw S.retryLane=M,Vs(i,M),ki(p,i,M),Og;Yd(),o=py(i,o,f)}else i=S.treeContext,ur=Ss(M.nextSibling),va=o,xn=!0,$a=null,Sr=!1,i!==null&&Ad(o,i),o=Md(o,p),o.flags|=4096;return o}return i=Si(i.child,{mode:p.mode,children:p.children}),i.ref=o.ref,o.child=i,i.return=o,i}function Pd(i,o){var f=o.ref;if(f===null)i!==null&&i.ref!==null&&(o.flags|=4194816);else{if(typeof f!="function"&&typeof f!="object")throw Error(r(284));(i===null||i.ref!==f)&&(o.flags|=4194816)}}function jg(i,o,f,p,b){return bo(o),f=Wf(i,o,f,p,void 0,b),p=Kf(),i!==null&&!oa?(Jf(i,o,b),el(i,o,b)):(xn&&p&&Hf(o),o.flags|=1,qa(i,o,f,b),o.child)}function my(i,o,f,p,b,S){return bo(o),o.updateQueue=null,f=Gs(o,p,f,b),jc(i),p=Kf(),i!==null&&!oa?(Jf(i,o,S),el(i,o,S)):(xn&&p&&Hf(o),o.flags|=1,qa(i,o,f,S),o.child)}function gy(i,o,f,p,b){if(bo(o),o.stateNode===null){var S=ga,M=f.contextType;typeof M=="object"&&M!==null&&(S=ba(M)),S=new f(p,S),o.memoizedState=S.state!==null&&S.state!==void 0?S.state:null,S.updater=Tg,o.stateNode=S,S._reactInternals=o,S=o.stateNode,S.props=p,S.state=o.memoizedState,S.refs={},nt(o),M=f.contextType,S.context=typeof M=="object"&&M!==null?ba(M):ga,S.state=o.memoizedState,M=f.getDerivedStateFromProps,typeof M=="function"&&(Cg(o,f,M,p),S.state=o.memoizedState),typeof f.getDerivedStateFromProps=="function"||typeof S.getSnapshotBeforeUpdate=="function"||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(M=S.state,typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount(),M!==S.state&&Tg.enqueueReplaceState(S,S.state,null),Fr(o,p,S,b),ar(),S.state=o.memoizedState),typeof S.componentDidMount=="function"&&(o.flags|=4194308),p=!0}else if(i===null){S=o.stateNode;var X=o.memoizedProps,pe=Uu(f,X);S.props=pe;var Re=S.context,Fe=f.contextType;M=ga,typeof Fe=="object"&&Fe!==null&&(M=ba(Fe));var Ge=f.getDerivedStateFromProps;Fe=typeof Ge=="function"||typeof S.getSnapshotBeforeUpdate=="function",X=o.pendingProps!==X,Fe||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(X||Re!==M)&&ny(o,S,p,M),ut=!1;var De=o.memoizedState;S.state=De,Fr(o,p,S,b),ar(),Re=o.memoizedState,X||De!==Re||ut?(typeof Ge=="function"&&(Cg(o,f,Ge,p),Re=o.memoizedState),(pe=ut||ty(o,f,pe,p,De,Re,M))?(Fe||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount()),typeof S.componentDidMount=="function"&&(o.flags|=4194308)):(typeof S.componentDidMount=="function"&&(o.flags|=4194308),o.memoizedProps=p,o.memoizedState=Re),S.props=p,S.state=Re,S.context=M,p=pe):(typeof S.componentDidMount=="function"&&(o.flags|=4194308),p=!1)}else{S=o.stateNode,gr(i,o),M=o.memoizedProps,Fe=Uu(f,M),S.props=Fe,Ge=o.pendingProps,De=S.context,Re=f.contextType,pe=ga,typeof Re=="object"&&Re!==null&&(pe=ba(Re)),X=f.getDerivedStateFromProps,(Re=typeof X=="function"||typeof S.getSnapshotBeforeUpdate=="function")||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(M!==Ge||De!==pe)&&ny(o,S,p,pe),ut=!1,De=o.memoizedState,S.state=De,Fr(o,p,S,b),ar();var ke=o.memoizedState;M!==Ge||De!==ke||ut||i!==null&&i.dependencies!==null&&Cc(i.dependencies)?(typeof X=="function"&&(Cg(o,f,X,p),ke=o.memoizedState),(Fe=ut||ty(o,f,Fe,p,De,ke,pe)||i!==null&&i.dependencies!==null&&Cc(i.dependencies))?(Re||typeof S.UNSAFE_componentWillUpdate!="function"&&typeof S.componentWillUpdate!="function"||(typeof S.componentWillUpdate=="function"&&S.componentWillUpdate(p,ke,pe),typeof S.UNSAFE_componentWillUpdate=="function"&&S.UNSAFE_componentWillUpdate(p,ke,pe)),typeof S.componentDidUpdate=="function"&&(o.flags|=4),typeof S.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof S.componentDidUpdate!="function"||M===i.memoizedProps&&De===i.memoizedState||(o.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||M===i.memoizedProps&&De===i.memoizedState||(o.flags|=1024),o.memoizedProps=p,o.memoizedState=ke),S.props=p,S.state=ke,S.context=pe,p=Fe):(typeof S.componentDidUpdate!="function"||M===i.memoizedProps&&De===i.memoizedState||(o.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||M===i.memoizedProps&&De===i.memoizedState||(o.flags|=1024),p=!1)}return S=p,Pd(i,o),p=(o.flags&128)!==0,S||p?(S=o.stateNode,f=p&&typeof f.getDerivedStateFromError!="function"?null:S.render(),o.flags|=1,i!==null&&p?(o.child=cr(o,i.child,null,b),o.child=cr(o,null,f,b)):qa(i,o,f,b),o.memoizedState=S.state,i=o.child):i=el(i,o,b),i}function vy(i,o,f,p){return Ko(),o.flags|=256,qa(i,o,f,p),o.child}var Rg={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Dg(i){return{baseLanes:i,cachePool:ue()}}function kg(i,o,f){return i=i!==null?i.childLanes&~f:0,o&&(i|=Ki),i}function yy(i,o,f){var p=o.pendingProps,b=!1,S=(o.flags&128)!==0,M;if((M=S)||(M=i!==null&&i.memoizedState===null?!1:(Tn.current&2)!==0),M&&(b=!0,o.flags&=-129),M=(o.flags&32)!==0,o.flags&=-33,i===null){if(xn){if(b?jr(o):$r(),(i=ur)?(i=Nb(i,Sr),i=i!==null&&i.data!=="&"?i:null,i!==null&&(o.memoizedState={dehydrated:i,treeContext:po!==null?{id:Ni,overflow:Ci}:null,retryLane:536870912,hydrationErrors:null},f=Sc(i),f.return=o,o.child=f,va=o,ur=null)):i=null,i===null)throw mo(o);return g0(i)?o.lanes=32:o.lanes=536870912,null}var X=p.children;return p=p.fallback,b?($r(),b=o.mode,X=Id({mode:"hidden",children:X},b),p=ho(p,b,f,null),X.return=o,p.return=o,X.sibling=p,o.child=X,p=o.child,p.memoizedState=Dg(f),p.childLanes=kg(i,M,f),o.memoizedState=Rg,rh(null,p)):(jr(o),Mg(o,X))}var pe=i.memoizedState;if(pe!==null&&(X=pe.dehydrated,X!==null)){if(S)o.flags&256?(jr(o),o.flags&=-257,o=Pg(i,o,f)):o.memoizedState!==null?($r(),o.child=i.child,o.flags|=128,o=null):($r(),X=p.fallback,b=o.mode,p=Id({mode:"visible",children:p.children},b),X=ho(X,b,f,null),X.flags|=2,p.return=o,X.return=o,p.sibling=X,o.child=p,cr(o,i.child,null,f),p=o.child,p.memoizedState=Dg(f),p.childLanes=kg(i,M,f),o.memoizedState=Rg,o=rh(null,p));else if(jr(o),g0(X)){if(M=X.nextSibling&&X.nextSibling.dataset,M)var Re=M.dgst;M=Re,p=Error(r(419)),p.stack="",p.digest=M,Fl({value:p,source:null,stack:null}),o=Pg(i,o,f)}else if(oa||yo(i,o,f,!1),M=(f&i.childLanes)!==0,oa||M){if(M=fr,M!==null&&(p=Se(M,f),p!==0&&p!==pe.retryLane))throw pe.retryLane=p,Vs(i,p),ki(M,i,p),Og;m0(X)||Yd(),o=Pg(i,o,f)}else m0(X)?(o.flags|=192,o.child=i.child,o=null):(i=pe.treeContext,ur=Ss(X.nextSibling),va=o,xn=!0,$a=null,Sr=!1,i!==null&&Ad(o,i),o=Mg(o,p.children),o.flags|=4096);return o}return b?($r(),X=p.fallback,b=o.mode,pe=i.child,Re=pe.sibling,p=Si(pe,{mode:"hidden",children:p.children}),p.subtreeFlags=pe.subtreeFlags&65011712,Re!==null?X=Si(Re,X):(X=ho(X,b,f,null),X.flags|=2),X.return=o,p.return=o,p.sibling=X,o.child=p,rh(null,p),p=o.child,X=i.child.memoizedState,X===null?X=Dg(f):(b=X.cachePool,b!==null?(pe=Or._currentValue,b=b.parent!==pe?{parent:pe,pool:pe}:b):b=ue(),X={baseLanes:X.baseLanes|f,cachePool:b}),p.memoizedState=X,p.childLanes=kg(i,M,f),o.memoizedState=Rg,rh(i.child,p)):(jr(o),f=i.child,i=f.sibling,f=Si(f,{mode:"visible",children:p.children}),f.return=o,f.sibling=null,i!==null&&(M=o.deletions,M===null?(o.deletions=[i],o.flags|=16):M.push(i)),o.child=f,o.memoizedState=null,f)}function Mg(i,o){return o=Id({mode:"visible",children:o},i.mode),o.return=i,i.child=o}function Id(i,o){return i=La(22,i,null,o),i.lanes=0,i}function Pg(i,o,f){return cr(o,i.child,null,f),i=Mg(o,o.pendingProps.children),i.flags|=2,o.memoizedState=null,i}function by(i,o,f){i.lanes|=o;var p=i.alternate;p!==null&&(p.lanes|=o),Ul(i.return,o,f)}function Ig(i,o,f,p,b,S){var M=i.memoizedState;M===null?i.memoizedState={isBackwards:o,rendering:null,renderingStartTime:0,last:p,tail:f,tailMode:b,treeForkCount:S}:(M.isBackwards=o,M.rendering=null,M.renderingStartTime=0,M.last=p,M.tail=f,M.tailMode=b,M.treeForkCount=S)}function wy(i,o,f){var p=o.pendingProps,b=p.revealOrder,S=p.tail;p=p.children;var M=Tn.current,X=(M&2)!==0;if(X?(M=M&1|2,o.flags|=128):M&=1,Y(Tn,M),qa(i,o,p,f),p=xn?ku:0,!X&&i!==null&&(i.flags&128)!==0)e:for(i=o.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&by(i,f,o);else if(i.tag===19)by(i,f,o);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===o)break e;for(;i.sibling===null;){if(i.return===null||i.return===o)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}switch(b){case"forwards":for(f=o.child,b=null;f!==null;)i=f.alternate,i!==null&&ja(i)===null&&(b=f),f=f.sibling;f=b,f===null?(b=o.child,o.child=null):(b=f.sibling,f.sibling=null),Ig(o,!1,b,f,S,p);break;case"backwards":case"unstable_legacy-backwards":for(f=null,b=o.child,o.child=null;b!==null;){if(i=b.alternate,i!==null&&ja(i)===null){o.child=b;break}i=b.sibling,b.sibling=f,f=b,b=i}Ig(o,!0,f,null,S,p);break;case"together":Ig(o,!1,null,null,void 0,p);break;default:o.memoizedState=null}return o.child}function el(i,o,f){if(i!==null&&(o.dependencies=i.dependencies),Gl|=o.lanes,(f&o.childLanes)===0)if(i!==null){if(yo(i,o,f,!1),(f&o.childLanes)===0)return null}else return null;if(i!==null&&o.child!==i.child)throw Error(r(153));if(o.child!==null){for(i=o.child,f=Si(i,i.pendingProps),o.child=f,f.return=o;i.sibling!==null;)i=i.sibling,f=f.sibling=Si(i,i.pendingProps),f.return=o;f.sibling=null}return o.child}function Fg(i,o){return(i.lanes&o)!==0?!0:(i=i.dependencies,!!(i!==null&&Cc(i)))}function hE(i,o,f){switch(o.tag){case 3:be(o,o.stateNode.containerInfo),vo(o,Or,i.memoizedState.cache),Ko();break;case 27:case 5:Oe(o);break;case 4:be(o,o.stateNode.containerInfo);break;case 10:vo(o,o.type,o.memoizedProps.value);break;case 31:if(o.memoizedState!==null)return o.flags|=128,zn(o),null;break;case 13:var p=o.memoizedState;if(p!==null)return p.dehydrated!==null?(jr(o),o.flags|=128,null):(f&o.child.childLanes)!==0?yy(i,o,f):(jr(o),i=el(i,o,f),i!==null?i.sibling:null);jr(o);break;case 19:var b=(i.flags&128)!==0;if(p=(f&o.childLanes)!==0,p||(yo(i,o,f,!1),p=(f&o.childLanes)!==0),b){if(p)return wy(i,o,f);o.flags|=128}if(b=o.memoizedState,b!==null&&(b.rendering=null,b.tail=null,b.lastEffect=null),Y(Tn,Tn.current),p)break;return null;case 22:return o.lanes=0,hy(i,o,f,o.pendingProps);case 24:vo(o,Or,i.memoizedState.cache)}return el(i,o,f)}function xy(i,o,f){if(i!==null)if(i.memoizedProps!==o.pendingProps)oa=!0;else{if(!Fg(i,f)&&(o.flags&128)===0)return oa=!1,hE(i,o,f);oa=(i.flags&131072)!==0}else oa=!1,xn&&(o.flags&1048576)!==0&&Ed(o,ku,o.index);switch(o.lanes=0,o.tag){case 16:e:{var p=o.pendingProps;if(i=Te(o.elementType),o.type=i,typeof i=="function")xc(i)?(p=Uu(i,p),o.tag=1,o=gy(null,o,i,p,f)):(o.tag=0,o=jg(null,o,i,p,f));else{if(i!=null){var b=i.$$typeof;if(b===D){o.tag=11,o=uy(null,o,i,p,f);break e}else if(b===P){o.tag=14,o=cy(null,o,i,p,f);break e}}throw o=ae(i)||i,Error(r(306,o,""))}}return o;case 0:return jg(i,o,o.type,o.pendingProps,f);case 1:return p=o.type,b=Uu(p,o.pendingProps),gy(i,o,p,b,f);case 3:e:{if(be(o,o.stateNode.containerInfo),i===null)throw Error(r(387));p=o.pendingProps;var S=o.memoizedState;b=S.element,gr(i,o),Fr(o,p,null,f);var M=o.memoizedState;if(p=M.cache,vo(o,Or,p),p!==S.cache&&Jo(o,[Or],f,!0),ar(),p=M.element,S.isDehydrated)if(S={element:p,isDehydrated:!1,cache:M.cache},o.updateQueue.baseState=S,o.memoizedState=S,o.flags&256){o=vy(i,o,p,f);break e}else if(p!==b){b=_i(Error(r(424)),o),Fl(b),o=vy(i,o,p,f);break e}else{switch(i=o.stateNode.containerInfo,i.nodeType){case 9:i=i.body;break;default:i=i.nodeName==="HTML"?i.ownerDocument.body:i}for(ur=Ss(i.firstChild),va=o,xn=!0,$a=null,Sr=!0,f=sn(o,null,p,f),o.child=f;f;)f.flags=f.flags&-3|4096,f=f.sibling}else{if(Ko(),p===b){o=el(i,o,f);break e}qa(i,o,p,f)}o=o.child}return o;case 26:return Pd(i,o),i===null?(f=Rb(o.type,null,o.pendingProps,null))?o.memoizedState=f:xn||(f=o.type,i=o.pendingProps,p=Qd(V.current).createElement(f),p[Qe]=o,p[et]=i,Ha(p,f,i),Xn(p),o.stateNode=p):o.memoizedState=Rb(o.type,i.memoizedProps,o.pendingProps,i.memoizedState),null;case 27:return Oe(o),i===null&&xn&&(p=o.stateNode=Lb(o.type,o.pendingProps,V.current),va=o,Sr=!0,b=ur,Zl(o.type)?(v0=b,ur=Ss(p.firstChild)):ur=b),qa(i,o,o.pendingProps.children,f),Pd(i,o),i===null&&(o.flags|=4194304),o.child;case 5:return i===null&&xn&&((b=p=ur)&&(p=zE(p,o.type,o.pendingProps,Sr),p!==null?(o.stateNode=p,va=o,ur=Ss(p.firstChild),Sr=!1,b=!0):b=!1),b||mo(o)),Oe(o),b=o.type,S=o.pendingProps,M=i!==null?i.memoizedProps:null,p=S.children,h0(b,S)?p=null:M!==null&&h0(b,M)&&(o.flags|=32),o.memoizedState!==null&&(b=Wf(i,o,bg,null,null,f),yh._currentValue=b),Pd(i,o),qa(i,o,p,f),o.child;case 6:return i===null&&xn&&((i=f=ur)&&(f=qE(f,o.pendingProps,Sr),f!==null?(o.stateNode=f,va=o,ur=null,i=!0):i=!1),i||mo(o)),null;case 13:return yy(i,o,f);case 4:return be(o,o.stateNode.containerInfo),p=o.pendingProps,i===null?o.child=cr(o,null,p,f):qa(i,o,p,f),o.child;case 11:return uy(i,o,o.type,o.pendingProps,f);case 7:return qa(i,o,o.pendingProps,f),o.child;case 8:return qa(i,o,o.pendingProps.children,f),o.child;case 12:return qa(i,o,o.pendingProps.children,f),o.child;case 10:return p=o.pendingProps,vo(o,o.type,p.value),qa(i,o,p.children,f),o.child;case 9:return b=o.type._context,p=o.pendingProps.children,bo(o),b=ba(b),p=p(b),o.flags|=1,qa(i,o,p,f),o.child;case 14:return cy(i,o,o.type,o.pendingProps,f);case 15:return fy(i,o,o.type,o.pendingProps,f);case 19:return wy(i,o,f);case 31:return fE(i,o,f);case 22:return hy(i,o,f,o.pendingProps);case 24:return bo(o),p=ba(Or),i===null?(b=te(),b===null&&(b=fr,S=Bl(),b.pooledCache=S,S.refCount++,S!==null&&(b.pooledCacheLanes|=f),b=S),o.memoizedState={parent:p,cache:b},nt(o),vo(o,Or,b)):((i.lanes&f)!==0&&(gr(i,o),Fr(o,null,null,f),ar()),b=i.memoizedState,S=o.memoizedState,b.parent!==p?(b={parent:p,cache:p},o.memoizedState=b,o.lanes===0&&(o.memoizedState=o.updateQueue.baseState=b),vo(o,Or,p)):(p=S.cache,vo(o,Or,p),p!==b.cache&&Jo(o,[Or],f,!0))),qa(i,o,o.pendingProps.children,f),o.child;case 29:throw o.pendingProps}throw Error(r(156,o.tag))}function tl(i){i.flags|=4}function Ug(i,o,f,p,b){if((o=(i.mode&32)!==0)&&(o=!1),o){if(i.flags|=16777216,(b&335544128)===b)if(i.stateNode.complete)i.flags|=8192;else if(Wy())i.flags|=8192;else throw Pe=_e,Le}else i.flags&=-16777217}function Sy(i,o){if(o.type!=="stylesheet"||(o.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!Ib(o))if(Wy())i.flags|=8192;else throw Pe=_e,Le}function Fd(i,o){o!==null&&(i.flags|=4),i.flags&16384&&(o=i.tag!==22?ka():536870912,i.lanes|=o,zc|=o)}function ah(i,o){if(!xn)switch(i.tailMode){case"hidden":o=i.tail;for(var f=null;o!==null;)o.alternate!==null&&(f=o),o=o.sibling;f===null?i.tail=null:f.sibling=null;break;case"collapsed":f=i.tail;for(var p=null;f!==null;)f.alternate!==null&&(p=f),f=f.sibling;p===null?o||i.tail===null?i.tail=null:i.tail.sibling=null:p.sibling=null}}function br(i){var o=i.alternate!==null&&i.alternate.child===i.child,f=0,p=0;if(o)for(var b=i.child;b!==null;)f|=b.lanes|b.childLanes,p|=b.subtreeFlags&65011712,p|=b.flags&65011712,b.return=i,b=b.sibling;else for(b=i.child;b!==null;)f|=b.lanes|b.childLanes,p|=b.subtreeFlags,p|=b.flags,b.return=i,b=b.sibling;return i.subtreeFlags|=p,i.childLanes=f,o}function dE(i,o,f){var p=o.pendingProps;switch(Ac(o),o.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return br(o),null;case 1:return br(o),null;case 3:return f=o.stateNode,p=null,i!==null&&(p=i.memoizedState.cache),o.memoizedState.cache!==p&&(o.flags|=2048),Ti(Or),xe(),f.pendingContext&&(f.context=f.pendingContext,f.pendingContext=null),(i===null||i.child===null)&&(ya(o)?tl(o):i===null||i.memoizedState.isDehydrated&&(o.flags&256)===0||(o.flags|=1024,Yf())),br(o),null;case 26:var b=o.type,S=o.memoizedState;return i===null?(tl(o),S!==null?(br(o),Sy(o,S)):(br(o),Ug(o,b,null,p,f))):S?S!==i.memoizedState?(tl(o),br(o),Sy(o,S)):(br(o),o.flags&=-16777217):(i=i.memoizedProps,i!==p&&tl(o),br(o),Ug(o,b,i,p,f)),null;case 27:if(Me(o),f=V.current,b=o.type,i!==null&&o.stateNode!=null)i.memoizedProps!==p&&tl(o);else{if(!p){if(o.stateNode===null)throw Error(r(166));return br(o),null}i=K.current,ya(o)?Vf(o):(i=Lb(b,p,f),o.stateNode=i,tl(o))}return br(o),null;case 5:if(Me(o),b=o.type,i!==null&&o.stateNode!=null)i.memoizedProps!==p&&tl(o);else{if(!p){if(o.stateNode===null)throw Error(r(166));return br(o),null}if(S=K.current,ya(o))Vf(o);else{var M=Qd(V.current);switch(S){case 1:S=M.createElementNS("http://www.w3.org/2000/svg",b);break;case 2:S=M.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;default:switch(b){case"svg":S=M.createElementNS("http://www.w3.org/2000/svg",b);break;case"math":S=M.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;case"script":S=M.createElement("div"),S.innerHTML="<script><\/script>",S=S.removeChild(S.firstChild);break;case"select":S=typeof p.is=="string"?M.createElement("select",{is:p.is}):M.createElement("select"),p.multiple?S.multiple=!0:p.size&&(S.size=p.size);break;default:S=typeof p.is=="string"?M.createElement(b,{is:p.is}):M.createElement(b)}}S[Qe]=o,S[et]=p;e:for(M=o.child;M!==null;){if(M.tag===5||M.tag===6)S.appendChild(M.stateNode);else if(M.tag!==4&&M.tag!==27&&M.child!==null){M.child.return=M,M=M.child;continue}if(M===o)break e;for(;M.sibling===null;){if(M.return===null||M.return===o)break e;M=M.return}M.sibling.return=M.return,M=M.sibling}o.stateNode=S;e:switch(Ha(S,b,p),b){case"button":case"input":case"select":case"textarea":p=!!p.autoFocus;break e;case"img":p=!0;break e;default:p=!1}p&&tl(o)}}return br(o),Ug(o,o.type,i===null?null:i.memoizedProps,o.pendingProps,f),null;case 6:if(i&&o.stateNode!=null)i.memoizedProps!==p&&tl(o);else{if(typeof p!="string"&&o.stateNode===null)throw Error(r(166));if(i=V.current,ya(o)){if(i=o.stateNode,f=o.memoizedProps,p=null,b=va,b!==null)switch(b.tag){case 27:case 5:p=b.memoizedProps}i[Qe]=o,i=!!(i.nodeValue===f||p!==null&&p.suppressHydrationWarning===!0||yb(i.nodeValue,f)),i||mo(o,!0)}else i=Qd(i).createTextNode(p),i[Qe]=o,o.stateNode=i}return br(o),null;case 31:if(f=o.memoizedState,i===null||i.memoizedState!==null){if(p=ya(o),f!==null){if(i===null){if(!p)throw Error(r(318));if(i=o.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(557));i[Qe]=o}else Ko(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;br(o),i=!1}else f=Yf(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=f),i=!0;if(!i)return o.flags&256?(Zn(o),o):(Zn(o),null);if((o.flags&128)!==0)throw Error(r(558))}return br(o),null;case 13:if(p=o.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(b=ya(o),p!==null&&p.dehydrated!==null){if(i===null){if(!b)throw Error(r(318));if(b=o.memoizedState,b=b!==null?b.dehydrated:null,!b)throw Error(r(317));b[Qe]=o}else Ko(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;br(o),b=!1}else b=Yf(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=b),b=!0;if(!b)return o.flags&256?(Zn(o),o):(Zn(o),null)}return Zn(o),(o.flags&128)!==0?(o.lanes=f,o):(f=p!==null,i=i!==null&&i.memoizedState!==null,f&&(p=o.child,b=null,p.alternate!==null&&p.alternate.memoizedState!==null&&p.alternate.memoizedState.cachePool!==null&&(b=p.alternate.memoizedState.cachePool.pool),S=null,p.memoizedState!==null&&p.memoizedState.cachePool!==null&&(S=p.memoizedState.cachePool.pool),S!==b&&(p.flags|=2048)),f!==i&&f&&(o.child.flags|=8192),Fd(o,o.updateQueue),br(o),null);case 4:return xe(),i===null&&o0(o.stateNode.containerInfo),br(o),null;case 10:return Ti(o.type),br(o),null;case 19:if(j(Tn),p=o.memoizedState,p===null)return br(o),null;if(b=(o.flags&128)!==0,S=p.rendering,S===null)if(b)ah(p,!1);else{if(qr!==0||i!==null&&(i.flags&128)!==0)for(i=o.child;i!==null;){if(S=ja(i),S!==null){for(o.flags|=128,ah(p,!1),i=S.updateQueue,o.updateQueue=i,Fd(o,i),o.subtreeFlags=0,i=f,f=o.child;f!==null;)Ru(f,i),f=f.sibling;return Y(Tn,Tn.current&1|2),xn&&pi(o,p.treeForkCount),o.child}i=i.sibling}p.tail!==null&&Ft()>qd&&(o.flags|=128,b=!0,ah(p,!1),o.lanes=4194304)}else{if(!b)if(i=ja(S),i!==null){if(o.flags|=128,b=!0,i=i.updateQueue,o.updateQueue=i,Fd(o,i),ah(p,!0),p.tail===null&&p.tailMode==="hidden"&&!S.alternate&&!xn)return br(o),null}else 2*Ft()-p.renderingStartTime>qd&&f!==536870912&&(o.flags|=128,b=!0,ah(p,!1),o.lanes=4194304);p.isBackwards?(S.sibling=o.child,o.child=S):(i=p.last,i!==null?i.sibling=S:o.child=S,p.last=S)}return p.tail!==null?(i=p.tail,p.rendering=i,p.tail=i.sibling,p.renderingStartTime=Ft(),i.sibling=null,f=Tn.current,Y(Tn,b?f&1|2:f&1),xn&&pi(o,p.treeForkCount),i):(br(o),null);case 22:case 23:return Zn(o),Qr(),p=o.memoizedState!==null,i!==null?i.memoizedState!==null!==p&&(o.flags|=8192):p&&(o.flags|=8192),p?(f&536870912)!==0&&(o.flags&128)===0&&(br(o),o.subtreeFlags&6&&(o.flags|=8192)):br(o),f=o.updateQueue,f!==null&&Fd(o,f.retryQueue),f=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(f=i.memoizedState.cachePool.pool),p=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(p=o.memoizedState.cachePool.pool),p!==f&&(o.flags|=2048),i!==null&&j(W),null;case 24:return f=null,i!==null&&(f=i.memoizedState.cache),o.memoizedState.cache!==f&&(o.flags|=2048),Ti(Or),br(o),null;case 25:return null;case 30:return null}throw Error(r(156,o.tag))}function pE(i,o){switch(Ac(o),o.tag){case 1:return i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 3:return Ti(Or),xe(),i=o.flags,(i&65536)!==0&&(i&128)===0?(o.flags=i&-65537|128,o):null;case 26:case 27:case 5:return Me(o),null;case 31:if(o.memoizedState!==null){if(Zn(o),o.alternate===null)throw Error(r(340));Ko()}return i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 13:if(Zn(o),i=o.memoizedState,i!==null&&i.dehydrated!==null){if(o.alternate===null)throw Error(r(340));Ko()}return i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 19:return j(Tn),null;case 4:return xe(),null;case 10:return Ti(o.type),null;case 22:case 23:return Zn(o),Qr(),i!==null&&j(W),i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 24:return Ti(Or),null;case 25:return null;default:return null}}function _y(i,o){switch(Ac(o),o.tag){case 3:Ti(Or),xe();break;case 26:case 27:case 5:Me(o);break;case 4:xe();break;case 31:o.memoizedState!==null&&Zn(o);break;case 13:Zn(o);break;case 19:j(Tn);break;case 10:Ti(o.type);break;case 22:case 23:Zn(o),Qr(),i!==null&&j(W);break;case 24:Ti(Or)}}function ih(i,o){try{var f=o.updateQueue,p=f!==null?f.lastEffect:null;if(p!==null){var b=p.next;f=b;do{if((f.tag&i)===i){p=void 0;var S=f.create,M=f.inst;p=S(),M.destroy=p}f=f.next}while(f!==b)}}catch(X){er(o,o.return,X)}}function Vl(i,o,f){try{var p=o.updateQueue,b=p!==null?p.lastEffect:null;if(b!==null){var S=b.next;p=S;do{if((p.tag&i)===i){var M=p.inst,X=M.destroy;if(X!==void 0){M.destroy=void 0,b=o;var pe=f,Re=X;try{Re()}catch(Fe){er(b,pe,Fe)}}}p=p.next}while(p!==S)}}catch(Fe){er(o,o.return,Fe)}}function Ey(i){var o=i.updateQueue;if(o!==null){var f=i.stateNode;try{Ur(o,f)}catch(p){er(i,i.return,p)}}}function Ay(i,o,f){f.props=Uu(i.type,i.memoizedProps),f.state=i.memoizedState;try{f.componentWillUnmount()}catch(p){er(i,o,p)}}function sh(i,o){try{var f=i.ref;if(f!==null){switch(i.tag){case 26:case 27:case 5:var p=i.stateNode;break;case 30:p=i.stateNode;break;default:p=i.stateNode}typeof f=="function"?i.refCleanup=f(p):f.current=p}}catch(b){er(i,o,b)}}function Eo(i,o){var f=i.ref,p=i.refCleanup;if(f!==null)if(typeof p=="function")try{p()}catch(b){er(i,o,b)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof f=="function")try{f(null)}catch(b){er(i,o,b)}else f.current=null}function Ny(i){var o=i.type,f=i.memoizedProps,p=i.stateNode;try{e:switch(o){case"button":case"input":case"select":case"textarea":f.autoFocus&&p.focus();break e;case"img":f.src?p.src=f.src:f.srcSet&&(p.srcset=f.srcSet)}}catch(b){er(i,i.return,b)}}function Bg(i,o,f){try{var p=i.stateNode;PE(p,i.type,f,o),p[et]=o}catch(b){er(i,i.return,b)}}function Cy(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&Zl(i.type)||i.tag===4}function $g(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||Cy(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.tag===27&&Zl(i.type)||i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function zg(i,o,f){var p=i.tag;if(p===5||p===6)i=i.stateNode,o?(f.nodeType===9?f.body:f.nodeName==="HTML"?f.ownerDocument.body:f).insertBefore(i,o):(o=f.nodeType===9?f.body:f.nodeName==="HTML"?f.ownerDocument.body:f,o.appendChild(i),f=f._reactRootContainer,f!=null||o.onclick!==null||(o.onclick=$i));else if(p!==4&&(p===27&&Zl(i.type)&&(f=i.stateNode,o=null),i=i.child,i!==null))for(zg(i,o,f),i=i.sibling;i!==null;)zg(i,o,f),i=i.sibling}function Ud(i,o,f){var p=i.tag;if(p===5||p===6)i=i.stateNode,o?f.insertBefore(i,o):f.appendChild(i);else if(p!==4&&(p===27&&Zl(i.type)&&(f=i.stateNode),i=i.child,i!==null))for(Ud(i,o,f),i=i.sibling;i!==null;)Ud(i,o,f),i=i.sibling}function Ty(i){var o=i.stateNode,f=i.memoizedProps;try{for(var p=i.type,b=o.attributes;b.length;)o.removeAttributeNode(b[0]);Ha(o,p,f),o[Qe]=i,o[et]=f}catch(S){er(i,i.return,S)}}var nl=!1,la=!1,qg=!1,Ly=typeof WeakSet=="function"?WeakSet:Set,Ra=null;function mE(i,o){if(i=i.containerInfo,c0=sp,i=qs(i),vs(i)){if("selectionStart"in i)var f={start:i.selectionStart,end:i.selectionEnd};else e:{f=(f=i.ownerDocument)&&f.defaultView||window;var p=f.getSelection&&f.getSelection();if(p&&p.rangeCount!==0){f=p.anchorNode;var b=p.anchorOffset,S=p.focusNode;p=p.focusOffset;try{f.nodeType,S.nodeType}catch{f=null;break e}var M=0,X=-1,pe=-1,Re=0,Fe=0,Ge=i,De=null;t:for(;;){for(var ke;Ge!==f||b!==0&&Ge.nodeType!==3||(X=M+b),Ge!==S||p!==0&&Ge.nodeType!==3||(pe=M+p),Ge.nodeType===3&&(M+=Ge.nodeValue.length),(ke=Ge.firstChild)!==null;)De=Ge,Ge=ke;for(;;){if(Ge===i)break t;if(De===f&&++Re===b&&(X=M),De===S&&++Fe===p&&(pe=M),(ke=Ge.nextSibling)!==null)break;Ge=De,De=Ge.parentNode}Ge=ke}f=X===-1||pe===-1?null:{start:X,end:pe}}else f=null}f=f||{start:0,end:0}}else f=null;for(f0={focusedElem:i,selectionRange:f},sp=!1,Ra=o;Ra!==null;)if(o=Ra,i=o.child,(o.subtreeFlags&1028)!==0&&i!==null)i.return=o,Ra=i;else for(;Ra!==null;){switch(o=Ra,S=o.alternate,i=o.flags,o.tag){case 0:if((i&4)!==0&&(i=o.updateQueue,i=i!==null?i.events:null,i!==null))for(f=0;f<i.length;f++)b=i[f],b.ref.impl=b.nextImpl;break;case 11:case 15:break;case 1:if((i&1024)!==0&&S!==null){i=void 0,f=o,b=S.memoizedProps,S=S.memoizedState,p=f.stateNode;try{var mt=Uu(f.type,b);i=p.getSnapshotBeforeUpdate(mt,S),p.__reactInternalSnapshotBeforeUpdate=i}catch(Vt){er(f,f.return,Vt)}}break;case 3:if((i&1024)!==0){if(i=o.stateNode.containerInfo,f=i.nodeType,f===9)p0(i);else if(f===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":p0(i);break;default:i.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((i&1024)!==0)throw Error(r(163))}if(i=o.sibling,i!==null){i.return=o.return,Ra=i;break}Ra=o.return}}function Oy(i,o,f){var p=f.flags;switch(f.tag){case 0:case 11:case 15:al(i,f),p&4&&ih(5,f);break;case 1:if(al(i,f),p&4)if(i=f.stateNode,o===null)try{i.componentDidMount()}catch(M){er(f,f.return,M)}else{var b=Uu(f.type,o.memoizedProps);o=o.memoizedState;try{i.componentDidUpdate(b,o,i.__reactInternalSnapshotBeforeUpdate)}catch(M){er(f,f.return,M)}}p&64&&Ey(f),p&512&&sh(f,f.return);break;case 3:if(al(i,f),p&64&&(i=f.updateQueue,i!==null)){if(o=null,f.child!==null)switch(f.child.tag){case 27:case 5:o=f.child.stateNode;break;case 1:o=f.child.stateNode}try{Ur(i,o)}catch(M){er(f,f.return,M)}}break;case 27:o===null&&p&4&&Ty(f);case 26:case 5:al(i,f),o===null&&p&4&&Ny(f),p&512&&sh(f,f.return);break;case 12:al(i,f);break;case 31:al(i,f),p&4&&Dy(i,f);break;case 13:al(i,f),p&4&&ky(i,f),p&64&&(i=f.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(f=EE.bind(null,f),HE(i,f))));break;case 22:if(p=f.memoizedState!==null||nl,!p){o=o!==null&&o.memoizedState!==null||la,b=nl;var S=la;nl=p,(la=o)&&!S?il(i,f,(f.subtreeFlags&8772)!==0):al(i,f),nl=b,la=S}break;case 30:break;default:al(i,f)}}function jy(i){var o=i.alternate;o!==null&&(i.alternate=null,jy(o)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(o=i.stateNode,o!==null&&Kn(o)),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}var Ar=null,Oi=!1;function rl(i,o,f){for(f=f.child;f!==null;)Ry(i,o,f),f=f.sibling}function Ry(i,o,f){if(bt&&typeof bt.onCommitFiberUnmount=="function")try{bt.onCommitFiberUnmount(dn,f)}catch{}switch(f.tag){case 26:la||Eo(f,o),rl(i,o,f),f.memoizedState?f.memoizedState.count--:f.stateNode&&(f=f.stateNode,f.parentNode.removeChild(f));break;case 27:la||Eo(f,o);var p=Ar,b=Oi;Zl(f.type)&&(Ar=f.stateNode,Oi=!1),rl(i,o,f),mh(f.stateNode),Ar=p,Oi=b;break;case 5:la||Eo(f,o);case 6:if(p=Ar,b=Oi,Ar=null,rl(i,o,f),Ar=p,Oi=b,Ar!==null)if(Oi)try{(Ar.nodeType===9?Ar.body:Ar.nodeName==="HTML"?Ar.ownerDocument.body:Ar).removeChild(f.stateNode)}catch(S){er(f,o,S)}else try{Ar.removeChild(f.stateNode)}catch(S){er(f,o,S)}break;case 18:Ar!==null&&(Oi?(i=Ar,Eb(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,f.stateNode),Jc(i)):Eb(Ar,f.stateNode));break;case 4:p=Ar,b=Oi,Ar=f.stateNode.containerInfo,Oi=!0,rl(i,o,f),Ar=p,Oi=b;break;case 0:case 11:case 14:case 15:Vl(2,f,o),la||Vl(4,f,o),rl(i,o,f);break;case 1:la||(Eo(f,o),p=f.stateNode,typeof p.componentWillUnmount=="function"&&Ay(f,o,p)),rl(i,o,f);break;case 21:rl(i,o,f);break;case 22:la=(p=la)||f.memoizedState!==null,rl(i,o,f),la=p;break;default:rl(i,o,f)}}function Dy(i,o){if(o.memoizedState===null&&(i=o.alternate,i!==null&&(i=i.memoizedState,i!==null))){i=i.dehydrated;try{Jc(i)}catch(f){er(o,o.return,f)}}}function ky(i,o){if(o.memoizedState===null&&(i=o.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{Jc(i)}catch(f){er(o,o.return,f)}}function gE(i){switch(i.tag){case 31:case 13:case 19:var o=i.stateNode;return o===null&&(o=i.stateNode=new Ly),o;case 22:return i=i.stateNode,o=i._retryCache,o===null&&(o=i._retryCache=new Ly),o;default:throw Error(r(435,i.tag))}}function Bd(i,o){var f=gE(i);o.forEach(function(p){if(!f.has(p)){f.add(p);var b=AE.bind(null,i,p);p.then(b,b)}})}function ji(i,o){var f=o.deletions;if(f!==null)for(var p=0;p<f.length;p++){var b=f[p],S=i,M=o,X=M;e:for(;X!==null;){switch(X.tag){case 27:if(Zl(X.type)){Ar=X.stateNode,Oi=!1;break e}break;case 5:Ar=X.stateNode,Oi=!1;break e;case 3:case 4:Ar=X.stateNode.containerInfo,Oi=!0;break e}X=X.return}if(Ar===null)throw Error(r(160));Ry(S,M,b),Ar=null,Oi=!1,S=b.alternate,S!==null&&(S.return=null),b.return=null}if(o.subtreeFlags&13886)for(o=o.child;o!==null;)My(o,i),o=o.sibling}var Xs=null;function My(i,o){var f=i.alternate,p=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:ji(o,i),Ri(i),p&4&&(Vl(3,i,i.return),ih(3,i),Vl(5,i,i.return));break;case 1:ji(o,i),Ri(i),p&512&&(la||f===null||Eo(f,f.return)),p&64&&nl&&(i=i.updateQueue,i!==null&&(p=i.callbacks,p!==null&&(f=i.shared.hiddenCallbacks,i.shared.hiddenCallbacks=f===null?p:f.concat(p))));break;case 26:var b=Xs;if(ji(o,i),Ri(i),p&512&&(la||f===null||Eo(f,f.return)),p&4){var S=f!==null?f.memoizedState:null;if(p=i.memoizedState,f===null)if(p===null)if(i.stateNode===null){e:{p=i.type,f=i.memoizedProps,b=b.ownerDocument||b;t:switch(p){case"title":S=b.getElementsByTagName("title")[0],(!S||S[Bn]||S[Qe]||S.namespaceURI==="http://www.w3.org/2000/svg"||S.hasAttribute("itemprop"))&&(S=b.createElement(p),b.head.insertBefore(S,b.querySelector("head > title"))),Ha(S,p,f),S[Qe]=i,Xn(S),p=S;break e;case"link":var M=Mb("link","href",b).get(p+(f.href||""));if(M){for(var X=0;X<M.length;X++)if(S=M[X],S.getAttribute("href")===(f.href==null||f.href===""?null:f.href)&&S.getAttribute("rel")===(f.rel==null?null:f.rel)&&S.getAttribute("title")===(f.title==null?null:f.title)&&S.getAttribute("crossorigin")===(f.crossOrigin==null?null:f.crossOrigin)){M.splice(X,1);break t}}S=b.createElement(p),Ha(S,p,f),b.head.appendChild(S);break;case"meta":if(M=Mb("meta","content",b).get(p+(f.content||""))){for(X=0;X<M.length;X++)if(S=M[X],S.getAttribute("content")===(f.content==null?null:""+f.content)&&S.getAttribute("name")===(f.name==null?null:f.name)&&S.getAttribute("property")===(f.property==null?null:f.property)&&S.getAttribute("http-equiv")===(f.httpEquiv==null?null:f.httpEquiv)&&S.getAttribute("charset")===(f.charSet==null?null:f.charSet)){M.splice(X,1);break t}}S=b.createElement(p),Ha(S,p,f),b.head.appendChild(S);break;default:throw Error(r(468,p))}S[Qe]=i,Xn(S),p=S}i.stateNode=p}else Pb(b,i.type,i.stateNode);else i.stateNode=kb(b,p,i.memoizedProps);else S!==p?(S===null?f.stateNode!==null&&(f=f.stateNode,f.parentNode.removeChild(f)):S.count--,p===null?Pb(b,i.type,i.stateNode):kb(b,p,i.memoizedProps)):p===null&&i.stateNode!==null&&Bg(i,i.memoizedProps,f.memoizedProps)}break;case 27:ji(o,i),Ri(i),p&512&&(la||f===null||Eo(f,f.return)),f!==null&&p&4&&Bg(i,i.memoizedProps,f.memoizedProps);break;case 5:if(ji(o,i),Ri(i),p&512&&(la||f===null||Eo(f,f.return)),i.flags&32){b=i.stateNode;try{Bi(b,"")}catch(mt){er(i,i.return,mt)}}p&4&&i.stateNode!=null&&(b=i.memoizedProps,Bg(i,b,f!==null?f.memoizedProps:b)),p&1024&&(qg=!0);break;case 6:if(ji(o,i),Ri(i),p&4){if(i.stateNode===null)throw Error(r(162));p=i.memoizedProps,f=i.stateNode;try{f.nodeValue=p}catch(mt){er(i,i.return,mt)}}break;case 3:if(np=null,b=Xs,Xs=ep(o.containerInfo),ji(o,i),Xs=b,Ri(i),p&4&&f!==null&&f.memoizedState.isDehydrated)try{Jc(o.containerInfo)}catch(mt){er(i,i.return,mt)}qg&&(qg=!1,Py(i));break;case 4:p=Xs,Xs=ep(i.stateNode.containerInfo),ji(o,i),Ri(i),Xs=p;break;case 12:ji(o,i),Ri(i);break;case 31:ji(o,i),Ri(i),p&4&&(p=i.updateQueue,p!==null&&(i.updateQueue=null,Bd(i,p)));break;case 13:ji(o,i),Ri(i),i.child.flags&8192&&i.memoizedState!==null!=(f!==null&&f.memoizedState!==null)&&(zd=Ft()),p&4&&(p=i.updateQueue,p!==null&&(i.updateQueue=null,Bd(i,p)));break;case 22:b=i.memoizedState!==null;var pe=f!==null&&f.memoizedState!==null,Re=nl,Fe=la;if(nl=Re||b,la=Fe||pe,ji(o,i),la=Fe,nl=Re,Ri(i),p&8192)e:for(o=i.stateNode,o._visibility=b?o._visibility&-2:o._visibility|1,b&&(f===null||pe||nl||la||Bu(i)),f=null,o=i;;){if(o.tag===5||o.tag===26){if(f===null){pe=f=o;try{if(S=pe.stateNode,b)M=S.style,typeof M.setProperty=="function"?M.setProperty("display","none","important"):M.display="none";else{X=pe.stateNode;var Ge=pe.memoizedProps.style,De=Ge!=null&&Ge.hasOwnProperty("display")?Ge.display:null;X.style.display=De==null||typeof De=="boolean"?"":(""+De).trim()}}catch(mt){er(pe,pe.return,mt)}}}else if(o.tag===6){if(f===null){pe=o;try{pe.stateNode.nodeValue=b?"":pe.memoizedProps}catch(mt){er(pe,pe.return,mt)}}}else if(o.tag===18){if(f===null){pe=o;try{var ke=pe.stateNode;b?Ab(ke,!0):Ab(pe.stateNode,!1)}catch(mt){er(pe,pe.return,mt)}}}else if((o.tag!==22&&o.tag!==23||o.memoizedState===null||o===i)&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===i)break e;for(;o.sibling===null;){if(o.return===null||o.return===i)break e;f===o&&(f=null),o=o.return}f===o&&(f=null),o.sibling.return=o.return,o=o.sibling}p&4&&(p=i.updateQueue,p!==null&&(f=p.retryQueue,f!==null&&(p.retryQueue=null,Bd(i,f))));break;case 19:ji(o,i),Ri(i),p&4&&(p=i.updateQueue,p!==null&&(i.updateQueue=null,Bd(i,p)));break;case 30:break;case 21:break;default:ji(o,i),Ri(i)}}function Ri(i){var o=i.flags;if(o&2){try{for(var f,p=i.return;p!==null;){if(Cy(p)){f=p;break}p=p.return}if(f==null)throw Error(r(160));switch(f.tag){case 27:var b=f.stateNode,S=$g(i);Ud(i,S,b);break;case 5:var M=f.stateNode;f.flags&32&&(Bi(M,""),f.flags&=-33);var X=$g(i);Ud(i,X,M);break;case 3:case 4:var pe=f.stateNode.containerInfo,Re=$g(i);zg(i,Re,pe);break;default:throw Error(r(161))}}catch(Fe){er(i,i.return,Fe)}i.flags&=-3}o&4096&&(i.flags&=-4097)}function Py(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var o=i;Py(o),o.tag===5&&o.flags&1024&&o.stateNode.reset(),i=i.sibling}}function al(i,o){if(o.subtreeFlags&8772)for(o=o.child;o!==null;)Oy(i,o.alternate,o),o=o.sibling}function Bu(i){for(i=i.child;i!==null;){var o=i;switch(o.tag){case 0:case 11:case 14:case 15:Vl(4,o,o.return),Bu(o);break;case 1:Eo(o,o.return);var f=o.stateNode;typeof f.componentWillUnmount=="function"&&Ay(o,o.return,f),Bu(o);break;case 27:mh(o.stateNode);case 26:case 5:Eo(o,o.return),Bu(o);break;case 22:o.memoizedState===null&&Bu(o);break;case 30:Bu(o);break;default:Bu(o)}i=i.sibling}}function il(i,o,f){for(f=f&&(o.subtreeFlags&8772)!==0,o=o.child;o!==null;){var p=o.alternate,b=i,S=o,M=S.flags;switch(S.tag){case 0:case 11:case 15:il(b,S,f),ih(4,S);break;case 1:if(il(b,S,f),p=S,b=p.stateNode,typeof b.componentDidMount=="function")try{b.componentDidMount()}catch(Re){er(p,p.return,Re)}if(p=S,b=p.updateQueue,b!==null){var X=p.stateNode;try{var pe=b.shared.hiddenCallbacks;if(pe!==null)for(b.shared.hiddenCallbacks=null,b=0;b<pe.length;b++)Oa(pe[b],X)}catch(Re){er(p,p.return,Re)}}f&&M&64&&Ey(S),sh(S,S.return);break;case 27:Ty(S);case 26:case 5:il(b,S,f),f&&p===null&&M&4&&Ny(S),sh(S,S.return);break;case 12:il(b,S,f);break;case 31:il(b,S,f),f&&M&4&&Dy(b,S);break;case 13:il(b,S,f),f&&M&4&&ky(b,S);break;case 22:S.memoizedState===null&&il(b,S,f),sh(S,S.return);break;case 30:break;default:il(b,S,f)}o=o.sibling}}function Hg(i,o){var f=null;i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(f=i.memoizedState.cachePool.pool),i=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(i=o.memoizedState.cachePool.pool),i!==f&&(i!=null&&i.refCount++,f!=null&&Mu(f))}function Vg(i,o){i=null,o.alternate!==null&&(i=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==i&&(o.refCount++,i!=null&&Mu(i))}function Zs(i,o,f,p){if(o.subtreeFlags&10256)for(o=o.child;o!==null;)Iy(i,o,f,p),o=o.sibling}function Iy(i,o,f,p){var b=o.flags;switch(o.tag){case 0:case 11:case 15:Zs(i,o,f,p),b&2048&&ih(9,o);break;case 1:Zs(i,o,f,p);break;case 3:Zs(i,o,f,p),b&2048&&(i=null,o.alternate!==null&&(i=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==i&&(o.refCount++,i!=null&&Mu(i)));break;case 12:if(b&2048){Zs(i,o,f,p),i=o.stateNode;try{var S=o.memoizedProps,M=S.id,X=S.onPostCommit;typeof X=="function"&&X(M,o.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch(pe){er(o,o.return,pe)}}else Zs(i,o,f,p);break;case 31:Zs(i,o,f,p);break;case 13:Zs(i,o,f,p);break;case 23:break;case 22:S=o.stateNode,M=o.alternate,o.memoizedState!==null?S._visibility&2?Zs(i,o,f,p):oh(i,o):S._visibility&2?Zs(i,o,f,p):(S._visibility|=2,Uc(i,o,f,p,(o.subtreeFlags&10256)!==0||!1)),b&2048&&Hg(M,o);break;case 24:Zs(i,o,f,p),b&2048&&Vg(o.alternate,o);break;default:Zs(i,o,f,p)}}function Uc(i,o,f,p,b){for(b=b&&((o.subtreeFlags&10256)!==0||!1),o=o.child;o!==null;){var S=i,M=o,X=f,pe=p,Re=M.flags;switch(M.tag){case 0:case 11:case 15:Uc(S,M,X,pe,b),ih(8,M);break;case 23:break;case 22:var Fe=M.stateNode;M.memoizedState!==null?Fe._visibility&2?Uc(S,M,X,pe,b):oh(S,M):(Fe._visibility|=2,Uc(S,M,X,pe,b)),b&&Re&2048&&Hg(M.alternate,M);break;case 24:Uc(S,M,X,pe,b),b&&Re&2048&&Vg(M.alternate,M);break;default:Uc(S,M,X,pe,b)}o=o.sibling}}function oh(i,o){if(o.subtreeFlags&10256)for(o=o.child;o!==null;){var f=i,p=o,b=p.flags;switch(p.tag){case 22:oh(f,p),b&2048&&Hg(p.alternate,p);break;case 24:oh(f,p),b&2048&&Vg(p.alternate,p);break;default:oh(f,p)}o=o.sibling}}var lh=8192;function Bc(i,o,f){if(i.subtreeFlags&lh)for(i=i.child;i!==null;)Fy(i,o,f),i=i.sibling}function Fy(i,o,f){switch(i.tag){case 26:Bc(i,o,f),i.flags&lh&&i.memoizedState!==null&&nA(f,Xs,i.memoizedState,i.memoizedProps);break;case 5:Bc(i,o,f);break;case 3:case 4:var p=Xs;Xs=ep(i.stateNode.containerInfo),Bc(i,o,f),Xs=p;break;case 22:i.memoizedState===null&&(p=i.alternate,p!==null&&p.memoizedState!==null?(p=lh,lh=16777216,Bc(i,o,f),lh=p):Bc(i,o,f));break;default:Bc(i,o,f)}}function Uy(i){var o=i.alternate;if(o!==null&&(i=o.child,i!==null)){o.child=null;do o=i.sibling,i.sibling=null,i=o;while(i!==null)}}function uh(i){var o=i.deletions;if((i.flags&16)!==0){if(o!==null)for(var f=0;f<o.length;f++){var p=o[f];Ra=p,$y(p,i)}Uy(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)By(i),i=i.sibling}function By(i){switch(i.tag){case 0:case 11:case 15:uh(i),i.flags&2048&&Vl(9,i,i.return);break;case 3:uh(i);break;case 12:uh(i);break;case 22:var o=i.stateNode;i.memoizedState!==null&&o._visibility&2&&(i.return===null||i.return.tag!==13)?(o._visibility&=-3,$d(i)):uh(i);break;default:uh(i)}}function $d(i){var o=i.deletions;if((i.flags&16)!==0){if(o!==null)for(var f=0;f<o.length;f++){var p=o[f];Ra=p,$y(p,i)}Uy(i)}for(i=i.child;i!==null;){switch(o=i,o.tag){case 0:case 11:case 15:Vl(8,o,o.return),$d(o);break;case 22:f=o.stateNode,f._visibility&2&&(f._visibility&=-3,$d(o));break;default:$d(o)}i=i.sibling}}function $y(i,o){for(;Ra!==null;){var f=Ra;switch(f.tag){case 0:case 11:case 15:Vl(8,f,o);break;case 23:case 22:if(f.memoizedState!==null&&f.memoizedState.cachePool!==null){var p=f.memoizedState.cachePool.pool;p!=null&&p.refCount++}break;case 24:Mu(f.memoizedState.cache)}if(p=f.child,p!==null)p.return=f,Ra=p;else e:for(f=i;Ra!==null;){p=Ra;var b=p.sibling,S=p.return;if(jy(p),p===f){Ra=null;break e}if(b!==null){b.return=S,Ra=b;break e}Ra=S}}}var vE={getCacheForType:function(i){var o=ba(Or),f=o.data.get(i);return f===void 0&&(f=i(),o.data.set(i,f)),f},cacheSignal:function(){return ba(Or).controller.signal}},yE=typeof WeakMap=="function"?WeakMap:Map,qn=0,fr=null,Sn=null,En=0,Qn=0,Wi=null,Yl=!1,$c=!1,Yg=!1,sl=0,qr=0,Gl=0,$u=0,Gg=0,Ki=0,zc=0,ch=null,Di=null,Wg=!1,zd=0,zy=0,qd=1/0,Hd=null,Wl=null,xa=0,Kl=null,qc=null,ol=0,Kg=0,Jg=null,qy=null,fh=0,Xg=null;function Ji(){return(qn&2)!==0&&En!==0?En&-En:Z.T!==null?r0():Xe()}function Hy(){if(Ki===0)if((En&536870912)===0||xn){var i=Mn;Mn<<=1,(Mn&3932160)===0&&(Mn=262144),Ki=i}else Ki=536870912;return i=yr.current,i!==null&&(i.flags|=32),Ki}function ki(i,o,f){(i===fr&&(Qn===2||Qn===9)||i.cancelPendingCommit!==null)&&(Hc(i,0),Jl(i,En,Ki,!1)),Et(i,f),((qn&2)===0||i!==fr)&&(i===fr&&((qn&2)===0&&($u|=f),qr===4&&Jl(i,En,Ki,!1)),Ao(i))}function Vy(i,o,f){if((qn&6)!==0)throw Error(r(327));var p=!f&&(o&127)===0&&(o&i.expiredLanes)===0||si(i,o),b=p?xE(i,o):Qg(i,o,!0),S=p;do{if(b===0){$c&&!p&&Jl(i,o,0,!1);break}else{if(f=i.current.alternate,S&&!bE(f)){b=Qg(i,o,!1),S=!1;continue}if(b===2){if(S=o,i.errorRecoveryDisabledLanes&S)var M=0;else M=i.pendingLanes&-536870913,M=M!==0?M:M&536870912?536870912:0;if(M!==0){o=M;e:{var X=i;b=ch;var pe=X.current.memoizedState.isDehydrated;if(pe&&(Hc(X,M).flags|=256),M=Qg(X,M,!1),M!==2){if(Yg&&!pe){X.errorRecoveryDisabledLanes|=S,$u|=S,b=4;break e}S=Di,Di=b,S!==null&&(Di===null?Di=S:Di.push.apply(Di,S))}b=M}if(S=!1,b!==2)continue}}if(b===1){Hc(i,0),Jl(i,o,0,!0);break}e:{switch(p=i,S=b,S){case 0:case 1:throw Error(r(345));case 4:if((o&4194048)!==o)break;case 6:Jl(p,o,Ki,!Yl);break e;case 2:Di=null;break;case 3:case 5:break;default:throw Error(r(329))}if((o&62914560)===o&&(b=zd+300-Ft(),10<b)){if(Jl(p,o,Ki,!Yl),bn(p,0,!0)!==0)break e;ol=o,p.timeoutHandle=Sb(Yy.bind(null,p,f,Di,Hd,Wg,o,Ki,$u,zc,Yl,S,"Throttled",-0,0),b);break e}Yy(p,f,Di,Hd,Wg,o,Ki,$u,zc,Yl,S,null,-0,0)}}break}while(!0);Ao(i)}function Yy(i,o,f,p,b,S,M,X,pe,Re,Fe,Ge,De,ke){if(i.timeoutHandle=-1,Ge=o.subtreeFlags,Ge&8192||(Ge&16785408)===16785408){Ge={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:$i},Fy(o,S,Ge);var mt=(S&62914560)===S?zd-Ft():(S&4194048)===S?zy-Ft():0;if(mt=rA(Ge,mt),mt!==null){ol=S,i.cancelPendingCommit=mt(eb.bind(null,i,o,S,f,p,b,M,X,pe,Fe,Ge,null,De,ke)),Jl(i,S,M,!Re);return}}eb(i,o,S,f,p,b,M,X,pe)}function bE(i){for(var o=i;;){var f=o.tag;if((f===0||f===11||f===15)&&o.flags&16384&&(f=o.updateQueue,f!==null&&(f=f.stores,f!==null)))for(var p=0;p<f.length;p++){var b=f[p],S=b.getSnapshot;b=b.value;try{if(!ma(S(),b))return!1}catch{return!1}}if(f=o.child,o.subtreeFlags&16384&&f!==null)f.return=o,o=f;else{if(o===i)break;for(;o.sibling===null;){if(o.return===null||o.return===i)return!0;o=o.return}o.sibling.return=o.return,o=o.sibling}}return!0}function Jl(i,o,f,p){o&=~Gg,o&=~$u,i.suspendedLanes|=o,i.pingedLanes&=~o,p&&(i.warmLanes|=o),p=i.expirationTimes;for(var b=o;0<b;){var S=31-pn(b),M=1<<S;p[S]=-1,b&=~M}f!==0&&vi(i,f,o)}function Vd(){return(qn&6)===0?(hh(0),!1):!0}function Zg(){if(Sn!==null){if(Qn===0)var i=Sn.return;else i=Sn,bs=go=null,Rc(i),We=null,vt=0,i=Sn;for(;i!==null;)_y(i.alternate,i),i=i.return;Sn=null}}function Hc(i,o){var f=i.timeoutHandle;f!==-1&&(i.timeoutHandle=-1,UE(f)),f=i.cancelPendingCommit,f!==null&&(i.cancelPendingCommit=null,f()),ol=0,Zg(),fr=i,Sn=f=Si(i.current,null),En=o,Qn=0,Wi=null,Yl=!1,$c=si(i,o),Yg=!1,zc=Ki=Gg=$u=Gl=qr=0,Di=ch=null,Wg=!1,(o&8)!==0&&(o|=o&32);var p=i.entangledLanes;if(p!==0)for(i=i.entanglements,p&=o;0<p;){var b=31-pn(p),S=1<<b;o|=i[b],p&=~S}return sl=o,Lu(),f}function Gy(i,o){Rt=null,Z.H=nh,o===ye||o===le?(o=ze(),Qn=3):o===Le?(o=ze(),Qn=4):Qn=o===Og?8:o!==null&&typeof o=="object"&&typeof o.then=="function"?6:1,Wi=o,Sn===null&&(qr=1,kd(i,_i(o,i.current)))}function Wy(){var i=yr.current;return i===null?!0:(En&4194048)===En?On===null:(En&62914560)===En||(En&536870912)!==0?i===On:!1}function Ky(){var i=Z.H;return Z.H=nh,i===null?nh:i}function Jy(){var i=Z.A;return Z.A=vE,i}function Yd(){qr=4,Yl||(En&4194048)!==En&&yr.current!==null||($c=!0),(Gl&134217727)===0&&($u&134217727)===0||fr===null||Jl(fr,En,Ki,!1)}function Qg(i,o,f){var p=qn;qn|=2;var b=Ky(),S=Jy();(fr!==i||En!==o)&&(Hd=null,Hc(i,o)),o=!1;var M=qr;e:do try{if(Qn!==0&&Sn!==null){var X=Sn,pe=Wi;switch(Qn){case 8:Zg(),M=6;break e;case 3:case 2:case 9:case 6:yr.current===null&&(o=!0);var Re=Qn;if(Qn=0,Wi=null,Vc(i,X,pe,Re),f&&$c){M=0;break e}break;default:Re=Qn,Qn=0,Wi=null,Vc(i,X,pe,Re)}}wE(),M=qr;break}catch(Fe){Gy(i,Fe)}while(!0);return o&&i.shellSuspendCounter++,bs=go=null,qn=p,Z.H=b,Z.A=S,Sn===null&&(fr=null,En=0,Lu()),M}function wE(){for(;Sn!==null;)Xy(Sn)}function xE(i,o){var f=qn;qn|=2;var p=Ky(),b=Jy();fr!==i||En!==o?(Hd=null,qd=Ft()+500,Hc(i,o)):$c=si(i,o);e:do try{if(Qn!==0&&Sn!==null){o=Sn;var S=Wi;t:switch(Qn){case 1:Qn=0,Wi=null,Vc(i,o,S,1);break;case 2:case 9:if(Ce(S)){Qn=0,Wi=null,Zy(o);break}o=function(){Qn!==2&&Qn!==9||fr!==i||(Qn=7),Ao(i)},S.then(o,o);break e;case 3:Qn=7;break e;case 4:Qn=5;break e;case 7:Ce(S)?(Qn=0,Wi=null,Zy(o)):(Qn=0,Wi=null,Vc(i,o,S,7));break;case 5:var M=null;switch(Sn.tag){case 26:M=Sn.memoizedState;case 5:case 27:var X=Sn;if(M?Ib(M):X.stateNode.complete){Qn=0,Wi=null;var pe=X.sibling;if(pe!==null)Sn=pe;else{var Re=X.return;Re!==null?(Sn=Re,Gd(Re)):Sn=null}break t}}Qn=0,Wi=null,Vc(i,o,S,5);break;case 6:Qn=0,Wi=null,Vc(i,o,S,6);break;case 8:Zg(),qr=6;break e;default:throw Error(r(462))}}SE();break}catch(Fe){Gy(i,Fe)}while(!0);return bs=go=null,Z.H=p,Z.A=b,qn=f,Sn!==null?0:(fr=null,En=0,Lu(),qr)}function SE(){for(;Sn!==null&&!Ot();)Xy(Sn)}function Xy(i){var o=xy(i.alternate,i,sl);i.memoizedProps=i.pendingProps,o===null?Gd(i):Sn=o}function Zy(i){var o=i,f=o.alternate;switch(o.tag){case 15:case 0:o=my(f,o,o.pendingProps,o.type,void 0,En);break;case 11:o=my(f,o,o.pendingProps,o.type.render,o.ref,En);break;case 5:Rc(o);default:_y(f,o),o=Sn=Ru(o,sl),o=xy(f,o,sl)}i.memoizedProps=i.pendingProps,o===null?Gd(i):Sn=o}function Vc(i,o,f,p){bs=go=null,Rc(o),We=null,vt=0;var b=o.return;try{if(cE(i,b,o,f,En)){qr=1,kd(i,_i(f,i.current)),Sn=null;return}}catch(S){if(b!==null)throw Sn=b,S;qr=1,kd(i,_i(f,i.current)),Sn=null;return}o.flags&32768?(xn||p===1?i=!0:$c||(En&536870912)!==0?i=!1:(Yl=i=!0,(p===2||p===9||p===3||p===6)&&(p=yr.current,p!==null&&p.tag===13&&(p.flags|=16384))),Qy(o,i)):Gd(o)}function Gd(i){var o=i;do{if((o.flags&32768)!==0){Qy(o,Yl);return}i=o.return;var f=dE(o.alternate,o,sl);if(f!==null){Sn=f;return}if(o=o.sibling,o!==null){Sn=o;return}Sn=o=i}while(o!==null);qr===0&&(qr=5)}function Qy(i,o){do{var f=pE(i.alternate,i);if(f!==null){f.flags&=32767,Sn=f;return}if(f=i.return,f!==null&&(f.flags|=32768,f.subtreeFlags=0,f.deletions=null),!o&&(i=i.sibling,i!==null)){Sn=i;return}Sn=i=f}while(i!==null);qr=6,Sn=null}function eb(i,o,f,p,b,S,M,X,pe){i.cancelPendingCommit=null;do Wd();while(xa!==0);if((qn&6)!==0)throw Error(r(327));if(o!==null){if(o===i.current)throw Error(r(177));if(S=o.lanes|o.childLanes,S|=yc,Ui(i,f,S,M,X,pe),i===fr&&(Sn=fr=null,En=0),qc=o,Kl=i,ol=f,Kg=S,Jg=b,qy=p,(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,NE(zt,function(){return ib(),null})):(i.callbackNode=null,i.callbackPriority=0),p=(o.flags&13878)!==0,(o.subtreeFlags&13878)!==0||p){p=Z.T,Z.T=null,b=ce.p,ce.p=2,M=qn,qn|=4;try{mE(i,o,f)}finally{qn=M,ce.p=b,Z.T=p}}xa=1,tb(),nb(),rb()}}function tb(){if(xa===1){xa=0;var i=Kl,o=qc,f=(o.flags&13878)!==0;if((o.subtreeFlags&13878)!==0||f){f=Z.T,Z.T=null;var p=ce.p;ce.p=2;var b=qn;qn|=4;try{My(o,i);var S=f0,M=qs(i.containerInfo),X=S.focusedElem,pe=S.selectionRange;if(M!==X&&X&&X.ownerDocument&&zs(X.ownerDocument.documentElement,X)){if(pe!==null&&vs(X)){var Re=pe.start,Fe=pe.end;if(Fe===void 0&&(Fe=Re),"selectionStart"in X)X.selectionStart=Re,X.selectionEnd=Math.min(Fe,X.value.length);else{var Ge=X.ownerDocument||document,De=Ge&&Ge.defaultView||window;if(De.getSelection){var ke=De.getSelection(),mt=X.textContent.length,Vt=Math.min(pe.start,mt),or=pe.end===void 0?Vt:Math.min(pe.end,mt);!ke.extend&&Vt>or&&(M=or,or=Vt,Vt=M);var Ae=kl(X,Vt),we=kl(X,or);if(Ae&&we&&(ke.rangeCount!==1||ke.anchorNode!==Ae.node||ke.anchorOffset!==Ae.offset||ke.focusNode!==we.node||ke.focusOffset!==we.offset)){var je=Ge.createRange();je.setStart(Ae.node,Ae.offset),ke.removeAllRanges(),Vt>or?(ke.addRange(je),ke.extend(we.node,we.offset)):(je.setEnd(we.node,we.offset),ke.addRange(je))}}}}for(Ge=[],ke=X;ke=ke.parentNode;)ke.nodeType===1&&Ge.push({element:ke,left:ke.scrollLeft,top:ke.scrollTop});for(typeof X.focus=="function"&&X.focus(),X=0;X<Ge.length;X++){var Ve=Ge[X];Ve.element.scrollLeft=Ve.left,Ve.element.scrollTop=Ve.top}}sp=!!c0,f0=c0=null}finally{qn=b,ce.p=p,Z.T=f}}i.current=o,xa=2}}function nb(){if(xa===2){xa=0;var i=Kl,o=qc,f=(o.flags&8772)!==0;if((o.subtreeFlags&8772)!==0||f){f=Z.T,Z.T=null;var p=ce.p;ce.p=2;var b=qn;qn|=4;try{Oy(i,o.alternate,o)}finally{qn=b,ce.p=p,Z.T=f}}xa=3}}function rb(){if(xa===4||xa===3){xa=0,At();var i=Kl,o=qc,f=ol,p=qy;(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?xa=5:(xa=0,qc=Kl=null,ab(i,i.pendingLanes));var b=i.pendingLanes;if(b===0&&(Wl=null),He(f),o=o.stateNode,bt&&typeof bt.onCommitFiberRoot=="function")try{bt.onCommitFiberRoot(dn,o,void 0,(o.current.flags&128)===128)}catch{}if(p!==null){o=Z.T,b=ce.p,ce.p=2,Z.T=null;try{for(var S=i.onRecoverableError,M=0;M<p.length;M++){var X=p[M];S(X.value,{componentStack:X.stack})}}finally{Z.T=o,ce.p=b}}(ol&3)!==0&&Wd(),Ao(i),b=i.pendingLanes,(f&261930)!==0&&(b&42)!==0?i===Xg?fh++:(fh=0,Xg=i):fh=0,hh(0)}}function ab(i,o){(i.pooledCacheLanes&=o)===0&&(o=i.pooledCache,o!=null&&(i.pooledCache=null,Mu(o)))}function Wd(){return tb(),nb(),rb(),ib()}function ib(){if(xa!==5)return!1;var i=Kl,o=Kg;Kg=0;var f=He(ol),p=Z.T,b=ce.p;try{ce.p=32>f?32:f,Z.T=null,f=Jg,Jg=null;var S=Kl,M=ol;if(xa=0,qc=Kl=null,ol=0,(qn&6)!==0)throw Error(r(331));var X=qn;if(qn|=4,By(S.current),Iy(S,S.current,M,f),qn=X,hh(0,!1),bt&&typeof bt.onPostCommitFiberRoot=="function")try{bt.onPostCommitFiberRoot(dn,S)}catch{}return!0}finally{ce.p=b,Z.T=p,ab(i,o)}}function sb(i,o,f){o=_i(f,o),o=Lg(i.stateNode,o,2),i=un(i,o,2),i!==null&&(Et(i,2),Ao(i))}function er(i,o,f){if(i.tag===3)sb(i,i,f);else for(;o!==null;){if(o.tag===3){sb(o,i,f);break}else if(o.tag===1){var p=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof p.componentDidCatch=="function"&&(Wl===null||!Wl.has(p))){i=_i(f,i),f=oy(2),p=un(o,f,2),p!==null&&(ly(f,p,o,i),Et(p,2),Ao(p));break}}o=o.return}}function e0(i,o,f){var p=i.pingCache;if(p===null){p=i.pingCache=new yE;var b=new Set;p.set(o,b)}else b=p.get(o),b===void 0&&(b=new Set,p.set(o,b));b.has(f)||(Yg=!0,b.add(f),i=_E.bind(null,i,o,f),o.then(i,i))}function _E(i,o,f){var p=i.pingCache;p!==null&&p.delete(o),i.pingedLanes|=i.suspendedLanes&f,i.warmLanes&=~f,fr===i&&(En&f)===f&&(qr===4||qr===3&&(En&62914560)===En&&300>Ft()-zd?(qn&2)===0&&Hc(i,0):Gg|=f,zc===En&&(zc=0)),Ao(i)}function ob(i,o){o===0&&(o=ka()),i=Vs(i,o),i!==null&&(Et(i,o),Ao(i))}function EE(i){var o=i.memoizedState,f=0;o!==null&&(f=o.retryLane),ob(i,f)}function AE(i,o){var f=0;switch(i.tag){case 31:case 13:var p=i.stateNode,b=i.memoizedState;b!==null&&(f=b.retryLane);break;case 19:p=i.stateNode;break;case 22:p=i.stateNode._retryCache;break;default:throw Error(r(314))}p!==null&&p.delete(o),ob(i,f)}function NE(i,o){return gt(i,o)}var Kd=null,Yc=null,t0=!1,Jd=!1,n0=!1,Xl=0;function Ao(i){i!==Yc&&i.next===null&&(Yc===null?Kd=Yc=i:Yc=Yc.next=i),Jd=!0,t0||(t0=!0,TE())}function hh(i,o){if(!n0&&Jd){n0=!0;do for(var f=!1,p=Kd;p!==null;){if(i!==0){var b=p.pendingLanes;if(b===0)var S=0;else{var M=p.suspendedLanes,X=p.pingedLanes;S=(1<<31-pn(42|i)+1)-1,S&=b&~(M&~X),S=S&201326741?S&201326741|1:S?S|2:0}S!==0&&(f=!0,fb(p,S))}else S=En,S=bn(p,p===fr?S:0,p.cancelPendingCommit!==null||p.timeoutHandle!==-1),(S&3)===0||si(p,S)||(f=!0,fb(p,S));p=p.next}while(f);n0=!1}}function CE(){lb()}function lb(){Jd=t0=!1;var i=0;Xl!==0&&FE()&&(i=Xl);for(var o=Ft(),f=null,p=Kd;p!==null;){var b=p.next,S=ub(p,o);S===0?(p.next=null,f===null?Kd=b:f.next=b,b===null&&(Yc=f)):(f=p,(i!==0||(S&3)!==0)&&(Jd=!0)),p=b}xa!==0&&xa!==5||hh(i),Xl!==0&&(Xl=0)}function ub(i,o){for(var f=i.suspendedLanes,p=i.pingedLanes,b=i.expirationTimes,S=i.pendingLanes&-62914561;0<S;){var M=31-pn(S),X=1<<M,pe=b[M];pe===-1?((X&f)===0||(X&p)!==0)&&(b[M]=Wr(X,o)):pe<=o&&(i.expiredLanes|=X),S&=~X}if(o=fr,f=En,f=bn(i,i===o?f:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),p=i.callbackNode,f===0||i===o&&(Qn===2||Qn===9)||i.cancelPendingCommit!==null)return p!==null&&p!==null&&ot(p),i.callbackNode=null,i.callbackPriority=0;if((f&3)===0||si(i,f)){if(o=f&-f,o===i.callbackPriority)return o;switch(p!==null&&ot(p),He(f)){case 2:case 8:f=fn;break;case 32:f=zt;break;case 268435456:f=Xt;break;default:f=zt}return p=cb.bind(null,i),f=gt(f,p),i.callbackPriority=o,i.callbackNode=f,o}return p!==null&&p!==null&&ot(p),i.callbackPriority=2,i.callbackNode=null,2}function cb(i,o){if(xa!==0&&xa!==5)return i.callbackNode=null,i.callbackPriority=0,null;var f=i.callbackNode;if(Wd()&&i.callbackNode!==f)return null;var p=En;return p=bn(i,i===fr?p:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),p===0?null:(Vy(i,p,o),ub(i,Ft()),i.callbackNode!=null&&i.callbackNode===f?cb.bind(null,i):null)}function fb(i,o){if(Wd())return null;Vy(i,o,!0)}function TE(){BE(function(){(qn&6)!==0?gt(Jt,CE):lb()})}function r0(){if(Xl===0){var i=v;i===0&&(i=It,It<<=1,(It&261888)===0&&(It=256)),Xl=i}return Xl}function hb(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:Ja(""+i)}function db(i,o){var f=o.ownerDocument.createElement("input");return f.name=o.name,f.value=o.value,i.id&&f.setAttribute("form",i.id),o.parentNode.insertBefore(f,o),i=new FormData(i),f.parentNode.removeChild(f),i}function LE(i,o,f,p,b){if(o==="submit"&&f&&f.stateNode===b){var S=hb((b[et]||null).action),M=p.submitter;M&&(o=(o=M[et]||null)?hb(o.formAction):M.getAttribute("formAction"),o!==null&&(S=o,M=null));var X=new bi("action","action",null,p,b);i.push({event:X,listeners:[{instance:null,listener:function(){if(p.defaultPrevented){if(Xl!==0){var pe=M?db(b,M):new FormData(b);_g(f,{pending:!0,data:pe,method:b.method,action:S},null,pe)}}else typeof S=="function"&&(X.preventDefault(),pe=M?db(b,M):new FormData(b),_g(f,{pending:!0,data:pe,method:b.method,action:S},S,pe))},currentTarget:b}]})}}for(var a0=0;a0<Yo.length;a0++){var i0=Yo[a0],OE=i0.toLowerCase(),jE=i0[0].toUpperCase()+i0.slice(1);xi(OE,"on"+jE)}xi(Vo,"onAnimationEnd"),xi(Cu,"onAnimationIteration"),xi($f,"onAnimationStart"),xi("dblclick","onDoubleClick"),xi("focusin","onFocus"),xi("focusout","onBlur"),xi(xd,"onTransitionRun"),xi(Sd,"onTransitionStart"),xi(_d,"onTransitionCancel"),xi(zf,"onTransitionEnd"),Pa("onMouseEnter",["mouseout","mouseover"]),Pa("onMouseLeave",["mouseout","mouseover"]),Pa("onPointerEnter",["pointerout","pointerover"]),Pa("onPointerLeave",["pointerout","pointerover"]),Ma("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ma("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ma("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ma("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ma("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ma("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var dh="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(" "),RE=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(dh));function pb(i,o){o=(o&4)!==0;for(var f=0;f<i.length;f++){var p=i[f],b=p.event;p=p.listeners;e:{var S=void 0;if(o)for(var M=p.length-1;0<=M;M--){var X=p[M],pe=X.instance,Re=X.currentTarget;if(X=X.listener,pe!==S&&b.isPropagationStopped())break e;S=X,b.currentTarget=Re;try{S(b)}catch(Fe){Tu(Fe)}b.currentTarget=null,S=pe}else for(M=0;M<p.length;M++){if(X=p[M],pe=X.instance,Re=X.currentTarget,X=X.listener,pe!==S&&b.isPropagationStopped())break e;S=X,b.currentTarget=Re;try{S(b)}catch(Fe){Tu(Fe)}b.currentTarget=null,S=pe}}}}function _n(i,o){var f=o[Ct];f===void 0&&(f=o[Ct]=new Set);var p=i+"__bubble";f.has(p)||(mb(o,i,2,!1),f.add(p))}function s0(i,o,f){var p=0;o&&(p|=4),mb(f,i,p,o)}var Xd="_reactListening"+Math.random().toString(36).slice(2);function o0(i){if(!i[Xd]){i[Xd]=!0,Ka.forEach(function(f){f!=="selectionchange"&&(RE.has(f)||s0(f,!1,i),s0(f,!0,i))});var o=i.nodeType===9?i:i.ownerDocument;o===null||o[Xd]||(o[Xd]=!0,s0("selectionchange",!1,o))}}function mb(i,o,f,p){switch(Hb(o)){case 2:var b=sA;break;case 8:b=oA;break;default:b=S0}f=b.bind(null,o,f,i),b=void 0,!Su||o!=="touchstart"&&o!=="touchmove"&&o!=="wheel"||(b=!0),p?b!==void 0?i.addEventListener(o,f,{capture:!0,passive:b}):i.addEventListener(o,f,!0):b!==void 0?i.addEventListener(o,f,{passive:b}):i.addEventListener(o,f,!1)}function l0(i,o,f,p,b){var S=p;if((o&1)===0&&(o&2)===0&&p!==null)e:for(;;){if(p===null)return;var M=p.tag;if(M===3||M===4){var X=p.stateNode.containerInfo;if(X===b)break;if(M===4)for(M=p.return;M!==null;){var pe=M.tag;if((pe===3||pe===4)&&M.stateNode.containerInfo===b)return;M=M.return}for(;X!==null;){if(M=Jn(X),M===null)return;if(pe=M.tag,pe===5||pe===6||pe===26||pe===27){p=S=M;continue e}X=X.parentNode}}p=p.return}dc(function(){var Re=S,Fe=Fo(f),Ge=[];e:{var De=qf.get(i);if(De!==void 0){var ke=bi,mt=i;switch(i){case"keypress":if(yi(f)===0)break e;case"keydown":case"keyup":ke=Nn;break;case"focusin":mt="focus",ke=ks;break;case"focusout":mt="blur",ke=ks;break;case"beforeblur":case"afterblur":ke=ks;break;case"click":if(f.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ke=_u;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ke=Ds;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ke=Xr;break;case Vo:case Cu:case $f:ke=C;break;case zf:ke=pa;break;case"scroll":case"scrollend":ke=Cl;break;case"wheel":ke=zi;break;case"copy":case"cut":case"paste":ke=fe;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ke=Cr;break;case"toggle":case"beforetoggle":ke=Eu}var Vt=(o&4)!==0,or=!Vt&&(i==="scroll"||i==="scrollend"),Ae=Vt?De!==null?De+"Capture":null:De;Vt=[];for(var we=Re,je;we!==null;){var Ve=we;if(je=Ve.stateNode,Ve=Ve.tag,Ve!==5&&Ve!==26&&Ve!==27||je===null||Ae===null||(Ve=ui(we,Ae),Ve!=null&&Vt.push(ph(we,Ve,je))),or)break;we=we.return}0<Vt.length&&(De=new ke(De,mt,null,f,Fe),Ge.push({event:De,listeners:Vt}))}}if((o&7)===0){e:{if(De=i==="mouseover"||i==="pointerover",ke=i==="mouseout"||i==="pointerout",De&&f!==Ts&&(mt=f.relatedTarget||f.fromElement)&&(Jn(mt)||mt[rt]))break e;if((ke||De)&&(De=Fe.window===Fe?Fe:(De=Fe.ownerDocument)?De.defaultView||De.parentWindow:window,ke?(mt=f.relatedTarget||f.toElement,ke=Re,mt=mt?Jn(mt):null,mt!==null&&(or=s(mt),Vt=mt.tag,mt!==or||Vt!==5&&Vt!==27&&Vt!==6)&&(mt=null)):(ke=null,mt=Re),ke!==mt)){if(Vt=_u,Ve="onMouseLeave",Ae="onMouseEnter",we="mouse",(i==="pointerout"||i==="pointerover")&&(Vt=Cr,Ve="onPointerLeave",Ae="onPointerEnter",we="pointer"),or=ke==null?De:Mr(ke),je=mt==null?De:Mr(mt),De=new Vt(Ve,we+"leave",ke,f,Fe),De.target=or,De.relatedTarget=je,Ve=null,Jn(Fe)===Re&&(Vt=new Vt(Ae,we+"enter",mt,f,Fe),Vt.target=je,Vt.relatedTarget=or,Ve=Vt),or=Ve,ke&&mt)t:{for(Vt=DE,Ae=ke,we=mt,je=0,Ve=Ae;Ve;Ve=Vt(Ve))je++;Ve=0;for(var kt=we;kt;kt=Vt(kt))Ve++;for(;0<je-Ve;)Ae=Vt(Ae),je--;for(;0<Ve-je;)we=Vt(we),Ve--;for(;je--;){if(Ae===we||we!==null&&Ae===we.alternate){Vt=Ae;break t}Ae=Vt(Ae),we=Vt(we)}Vt=null}else Vt=null;ke!==null&&gb(Ge,De,ke,Vt,!1),mt!==null&&or!==null&&gb(Ge,or,mt,Vt,!0)}}e:{if(De=Re?Mr(Re):window,ke=De.nodeName&&De.nodeName.toLowerCase(),ke==="select"||ke==="input"&&De.type==="file")var In=fo;else if(Au(De))if(Xa)In=ms;else{In=Tr;var St=Rl}else ke=De.nodeName,!ke||ke.toLowerCase()!=="input"||De.type!=="checkbox"&&De.type!=="radio"?Re&&bu(Re.elementType)&&(In=fo):In=vc;if(In&&(In=In(i,Re))){fi(Ge,In,f,Fe);break e}St&&St(i,De,Re),i==="focusout"&&Re&&De.type==="number"&&Re.memoizedProps.value!=null&&gu(De,"number",De.value)}switch(St=Re?Mr(Re):window,i){case"focusin":(Au(St)||St.contentEditable==="true")&&(hi=St,Hs=Re,Ca=null);break;case"focusout":Ca=Hs=hi=null;break;case"mousedown":wi=!0;break;case"contextmenu":case"mouseup":case"dragend":wi=!1,Dn(Ge,f,Fe);break;case"selectionchange":if(Ho)break;case"keydown":case"keyup":Dn(Ge,f,Fe)}var mn;if(fs)e:{switch(i){case"compositionstart":var An="onCompositionStart";break e;case"compositionend":An="onCompositionEnd";break e;case"compositionupdate":An="onCompositionUpdate";break e}An=void 0}else hs?co(i,f)&&(An="onCompositionEnd"):i==="keydown"&&f.keyCode===229&&(An="onCompositionStart");An&&(Is&&f.locale!=="ko"&&(hs||An!=="onCompositionStart"?An==="onCompositionEnd"&&hs&&(mn=pc()):(ci=Fe,Bo="value"in ci?ci.value:ci.textContent,hs=!0)),St=Zd(Re,An),0<St.length&&(An=new Ee(An,i,null,f,Fe),Ge.push({event:An,listeners:St}),mn?An.data=mn:(mn=Ll(f),mn!==null&&(An.data=mn)))),(mn=qo?Ua(i,f):Fs(i,f))&&(An=Zd(Re,"onBeforeInput"),0<An.length&&(St=new Ee("onBeforeInput","beforeinput",null,f,Fe),Ge.push({event:St,listeners:An}),St.data=mn)),LE(Ge,i,Re,f,Fe)}pb(Ge,o)})}function ph(i,o,f){return{instance:i,listener:o,currentTarget:f}}function Zd(i,o){for(var f=o+"Capture",p=[];i!==null;){var b=i,S=b.stateNode;if(b=b.tag,b!==5&&b!==26&&b!==27||S===null||(b=ui(i,f),b!=null&&p.unshift(ph(i,b,S)),b=ui(i,o),b!=null&&p.push(ph(i,b,S))),i.tag===3)return p;i=i.return}return[]}function DE(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function gb(i,o,f,p,b){for(var S=o._reactName,M=[];f!==null&&f!==p;){var X=f,pe=X.alternate,Re=X.stateNode;if(X=X.tag,pe!==null&&pe===p)break;X!==5&&X!==26&&X!==27||Re===null||(pe=Re,b?(Re=ui(f,S),Re!=null&&M.unshift(ph(f,Re,pe))):b||(Re=ui(f,S),Re!=null&&M.push(ph(f,Re,pe)))),f=f.return}M.length!==0&&i.push({event:o,listeners:M})}var kE=/\r\n?/g,ME=/\u0000|\uFFFD/g;function vb(i){return(typeof i=="string"?i:""+i).replace(kE,`
49
- `).replace(ME,"")}function yb(i,o){return o=vb(o),vb(i)===o}function sr(i,o,f,p,b,S){switch(f){case"children":typeof p=="string"?o==="body"||o==="textarea"&&p===""||Bi(i,p):(typeof p=="number"||typeof p=="bigint")&&o!=="body"&&Bi(i,""+p);break;case"className":Na(i,"class",p);break;case"tabIndex":Na(i,"tabindex",p);break;case"dir":case"role":case"viewBox":case"width":case"height":Na(i,f,p);break;case"style":cc(i,p,S);break;case"data":if(o!=="object"){Na(i,"data",p);break}case"src":case"href":if(p===""&&(o!=="a"||f!=="href")){i.removeAttribute(f);break}if(p==null||typeof p=="function"||typeof p=="symbol"||typeof p=="boolean"){i.removeAttribute(f);break}p=Ja(""+p),i.setAttribute(f,p);break;case"action":case"formAction":if(typeof p=="function"){i.setAttribute(f,"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}else typeof S=="function"&&(f==="formAction"?(o!=="input"&&sr(i,o,"name",b.name,b,null),sr(i,o,"formEncType",b.formEncType,b,null),sr(i,o,"formMethod",b.formMethod,b,null),sr(i,o,"formTarget",b.formTarget,b,null)):(sr(i,o,"encType",b.encType,b,null),sr(i,o,"method",b.method,b,null),sr(i,o,"target",b.target,b,null)));if(p==null||typeof p=="symbol"||typeof p=="boolean"){i.removeAttribute(f);break}p=Ja(""+p),i.setAttribute(f,p);break;case"onClick":p!=null&&(i.onclick=$i);break;case"onScroll":p!=null&&_n("scroll",i);break;case"onScrollEnd":p!=null&&_n("scrollend",i);break;case"dangerouslySetInnerHTML":if(p!=null){if(typeof p!="object"||!("__html"in p))throw Error(r(61));if(f=p.__html,f!=null){if(b.children!=null)throw Error(r(60));i.innerHTML=f}}break;case"multiple":i.multiple=p&&typeof p!="function"&&typeof p!="symbol";break;case"muted":i.muted=p&&typeof p!="function"&&typeof p!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(p==null||typeof p=="function"||typeof p=="boolean"||typeof p=="symbol"){i.removeAttribute("xlink:href");break}f=Ja(""+p),i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",f);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":p!=null&&typeof p!="function"&&typeof p!="symbol"?i.setAttribute(f,""+p):i.removeAttribute(f);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":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":p&&typeof p!="function"&&typeof p!="symbol"?i.setAttribute(f,""):i.removeAttribute(f);break;case"capture":case"download":p===!0?i.setAttribute(f,""):p!==!1&&p!=null&&typeof p!="function"&&typeof p!="symbol"?i.setAttribute(f,p):i.removeAttribute(f);break;case"cols":case"rows":case"size":case"span":p!=null&&typeof p!="function"&&typeof p!="symbol"&&!isNaN(p)&&1<=p?i.setAttribute(f,p):i.removeAttribute(f);break;case"rowSpan":case"start":p==null||typeof p=="function"||typeof p=="symbol"||isNaN(p)?i.removeAttribute(f):i.setAttribute(f,p);break;case"popover":_n("beforetoggle",i),_n("toggle",i),Pn(i,"popover",p);break;case"xlinkActuate":Kr(i,"http://www.w3.org/1999/xlink","xlink:actuate",p);break;case"xlinkArcrole":Kr(i,"http://www.w3.org/1999/xlink","xlink:arcrole",p);break;case"xlinkRole":Kr(i,"http://www.w3.org/1999/xlink","xlink:role",p);break;case"xlinkShow":Kr(i,"http://www.w3.org/1999/xlink","xlink:show",p);break;case"xlinkTitle":Kr(i,"http://www.w3.org/1999/xlink","xlink:title",p);break;case"xlinkType":Kr(i,"http://www.w3.org/1999/xlink","xlink:type",p);break;case"xmlBase":Kr(i,"http://www.w3.org/XML/1998/namespace","xml:base",p);break;case"xmlLang":Kr(i,"http://www.w3.org/XML/1998/namespace","xml:lang",p);break;case"xmlSpace":Kr(i,"http://www.w3.org/XML/1998/namespace","xml:space",p);break;case"is":Pn(i,"is",p);break;case"innerText":case"textContent":break;default:(!(2<f.length)||f[0]!=="o"&&f[0]!=="O"||f[1]!=="n"&&f[1]!=="N")&&(f=wu.get(f)||f,Pn(i,f,p))}}function u0(i,o,f,p,b,S){switch(f){case"style":cc(i,p,S);break;case"dangerouslySetInnerHTML":if(p!=null){if(typeof p!="object"||!("__html"in p))throw Error(r(61));if(f=p.__html,f!=null){if(b.children!=null)throw Error(r(60));i.innerHTML=f}}break;case"children":typeof p=="string"?Bi(i,p):(typeof p=="number"||typeof p=="bigint")&&Bi(i,""+p);break;case"onScroll":p!=null&&_n("scroll",i);break;case"onScrollEnd":p!=null&&_n("scrollend",i);break;case"onClick":p!=null&&(i.onclick=$i);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!dr.hasOwnProperty(f))e:{if(f[0]==="o"&&f[1]==="n"&&(b=f.endsWith("Capture"),o=f.slice(2,b?f.length-7:void 0),S=i[et]||null,S=S!=null?S[f]:null,typeof S=="function"&&i.removeEventListener(o,S,b),typeof p=="function")){typeof S!="function"&&S!==null&&(f in i?i[f]=null:i.hasAttribute(f)&&i.removeAttribute(f)),i.addEventListener(o,p,b);break e}f in i?i[f]=p:p===!0?i.setAttribute(f,""):Pn(i,f,p)}}}function Ha(i,o,f){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":_n("error",i),_n("load",i);var p=!1,b=!1,S;for(S in f)if(f.hasOwnProperty(S)){var M=f[S];if(M!=null)switch(S){case"src":p=!0;break;case"srcSet":b=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,o));default:sr(i,o,S,M,f,null)}}b&&sr(i,o,"srcSet",f.srcSet,f,null),p&&sr(i,o,"src",f.src,f,null);return;case"input":_n("invalid",i);var X=S=M=b=null,pe=null,Re=null;for(p in f)if(f.hasOwnProperty(p)){var Fe=f[p];if(Fe!=null)switch(p){case"name":b=Fe;break;case"type":M=Fe;break;case"checked":pe=Fe;break;case"defaultChecked":Re=Fe;break;case"value":S=Fe;break;case"defaultValue":X=Fe;break;case"children":case"dangerouslySetInnerHTML":if(Fe!=null)throw Error(r(137,o));break;default:sr(i,o,p,Fe,f,null)}}lc(i,S,X,pe,Re,M,b,!1);return;case"select":_n("invalid",i),p=M=S=null;for(b in f)if(f.hasOwnProperty(b)&&(X=f[b],X!=null))switch(b){case"value":S=X;break;case"defaultValue":M=X;break;case"multiple":p=X;default:sr(i,o,b,X,f,null)}o=S,f=M,i.multiple=!!p,o!=null?Fa(i,!!p,o,!1):f!=null&&Fa(i,!!p,f,!0);return;case"textarea":_n("invalid",i),S=b=p=null;for(M in f)if(f.hasOwnProperty(M)&&(X=f[M],X!=null))switch(M){case"value":p=X;break;case"defaultValue":b=X;break;case"children":S=X;break;case"dangerouslySetInnerHTML":if(X!=null)throw Error(r(91));break;default:sr(i,o,M,X,f,null)}yu(i,p,b,S);return;case"option":for(pe in f)if(f.hasOwnProperty(pe)&&(p=f[pe],p!=null))switch(pe){case"selected":i.selected=p&&typeof p!="function"&&typeof p!="symbol";break;default:sr(i,o,pe,p,f,null)}return;case"dialog":_n("beforetoggle",i),_n("toggle",i),_n("cancel",i),_n("close",i);break;case"iframe":case"object":_n("load",i);break;case"video":case"audio":for(p=0;p<dh.length;p++)_n(dh[p],i);break;case"image":_n("error",i),_n("load",i);break;case"details":_n("toggle",i);break;case"embed":case"source":case"link":_n("error",i),_n("load",i);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(Re in f)if(f.hasOwnProperty(Re)&&(p=f[Re],p!=null))switch(Re){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,o));default:sr(i,o,Re,p,f,null)}return;default:if(bu(o)){for(Fe in f)f.hasOwnProperty(Fe)&&(p=f[Fe],p!==void 0&&u0(i,o,Fe,p,f,void 0));return}}for(X in f)f.hasOwnProperty(X)&&(p=f[X],p!=null&&sr(i,o,X,p,f,null))}function PE(i,o,f,p){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var b=null,S=null,M=null,X=null,pe=null,Re=null,Fe=null;for(ke in f){var Ge=f[ke];if(f.hasOwnProperty(ke)&&Ge!=null)switch(ke){case"checked":break;case"value":break;case"defaultValue":pe=Ge;default:p.hasOwnProperty(ke)||sr(i,o,ke,null,p,Ge)}}for(var De in p){var ke=p[De];if(Ge=f[De],p.hasOwnProperty(De)&&(ke!=null||Ge!=null))switch(De){case"type":S=ke;break;case"name":b=ke;break;case"checked":Re=ke;break;case"defaultChecked":Fe=ke;break;case"value":M=ke;break;case"defaultValue":X=ke;break;case"children":case"dangerouslySetInnerHTML":if(ke!=null)throw Error(r(137,o));break;default:ke!==Ge&&sr(i,o,De,ke,p,Ge)}}El(i,M,X,pe,Re,Fe,S,b);return;case"select":ke=M=X=De=null;for(S in f)if(pe=f[S],f.hasOwnProperty(S)&&pe!=null)switch(S){case"value":break;case"multiple":ke=pe;default:p.hasOwnProperty(S)||sr(i,o,S,null,p,pe)}for(b in p)if(S=p[b],pe=f[b],p.hasOwnProperty(b)&&(S!=null||pe!=null))switch(b){case"value":De=S;break;case"defaultValue":X=S;break;case"multiple":M=S;default:S!==pe&&sr(i,o,b,S,p,pe)}o=X,f=M,p=ke,De!=null?Fa(i,!!f,De,!1):!!p!=!!f&&(o!=null?Fa(i,!!f,o,!0):Fa(i,!!f,f?[]:"",!1));return;case"textarea":ke=De=null;for(X in f)if(b=f[X],f.hasOwnProperty(X)&&b!=null&&!p.hasOwnProperty(X))switch(X){case"value":break;case"children":break;default:sr(i,o,X,null,p,b)}for(M in p)if(b=p[M],S=f[M],p.hasOwnProperty(M)&&(b!=null||S!=null))switch(M){case"value":De=b;break;case"defaultValue":ke=b;break;case"children":break;case"dangerouslySetInnerHTML":if(b!=null)throw Error(r(91));break;default:b!==S&&sr(i,o,M,b,p,S)}vu(i,De,ke);return;case"option":for(var mt in f)if(De=f[mt],f.hasOwnProperty(mt)&&De!=null&&!p.hasOwnProperty(mt))switch(mt){case"selected":i.selected=!1;break;default:sr(i,o,mt,null,p,De)}for(pe in p)if(De=p[pe],ke=f[pe],p.hasOwnProperty(pe)&&De!==ke&&(De!=null||ke!=null))switch(pe){case"selected":i.selected=De&&typeof De!="function"&&typeof De!="symbol";break;default:sr(i,o,pe,De,p,ke)}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 Vt in f)De=f[Vt],f.hasOwnProperty(Vt)&&De!=null&&!p.hasOwnProperty(Vt)&&sr(i,o,Vt,null,p,De);for(Re in p)if(De=p[Re],ke=f[Re],p.hasOwnProperty(Re)&&De!==ke&&(De!=null||ke!=null))switch(Re){case"children":case"dangerouslySetInnerHTML":if(De!=null)throw Error(r(137,o));break;default:sr(i,o,Re,De,p,ke)}return;default:if(bu(o)){for(var or in f)De=f[or],f.hasOwnProperty(or)&&De!==void 0&&!p.hasOwnProperty(or)&&u0(i,o,or,void 0,p,De);for(Fe in p)De=p[Fe],ke=f[Fe],!p.hasOwnProperty(Fe)||De===ke||De===void 0&&ke===void 0||u0(i,o,Fe,De,p,ke);return}}for(var Ae in f)De=f[Ae],f.hasOwnProperty(Ae)&&De!=null&&!p.hasOwnProperty(Ae)&&sr(i,o,Ae,null,p,De);for(Ge in p)De=p[Ge],ke=f[Ge],!p.hasOwnProperty(Ge)||De===ke||De==null&&ke==null||sr(i,o,Ge,De,p,ke)}function bb(i){switch(i){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function IE(){if(typeof performance.getEntriesByType=="function"){for(var i=0,o=0,f=performance.getEntriesByType("resource"),p=0;p<f.length;p++){var b=f[p],S=b.transferSize,M=b.initiatorType,X=b.duration;if(S&&X&&bb(M)){for(M=0,X=b.responseEnd,p+=1;p<f.length;p++){var pe=f[p],Re=pe.startTime;if(Re>X)break;var Fe=pe.transferSize,Ge=pe.initiatorType;Fe&&bb(Ge)&&(pe=pe.responseEnd,M+=Fe*(pe<X?1:(X-Re)/(pe-Re)))}if(--p,o+=8*(S+M)/(b.duration/1e3),i++,10<i)break}}if(0<i)return o/i/1e6}return navigator.connection&&(i=navigator.connection.downlink,typeof i=="number")?i:5}var c0=null,f0=null;function Qd(i){return i.nodeType===9?i:i.ownerDocument}function wb(i){switch(i){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function xb(i,o){if(i===0)switch(o){case"svg":return 1;case"math":return 2;default:return 0}return i===1&&o==="foreignObject"?0:i}function h0(i,o){return i==="textarea"||i==="noscript"||typeof o.children=="string"||typeof o.children=="number"||typeof o.children=="bigint"||typeof o.dangerouslySetInnerHTML=="object"&&o.dangerouslySetInnerHTML!==null&&o.dangerouslySetInnerHTML.__html!=null}var d0=null;function FE(){var i=window.event;return i&&i.type==="popstate"?i===d0?!1:(d0=i,!0):(d0=null,!1)}var Sb=typeof setTimeout=="function"?setTimeout:void 0,UE=typeof clearTimeout=="function"?clearTimeout:void 0,_b=typeof Promise=="function"?Promise:void 0,BE=typeof queueMicrotask=="function"?queueMicrotask:typeof _b<"u"?function(i){return _b.resolve(null).then(i).catch($E)}:Sb;function $E(i){setTimeout(function(){throw i})}function Zl(i){return i==="head"}function Eb(i,o){var f=o,p=0;do{var b=f.nextSibling;if(i.removeChild(f),b&&b.nodeType===8)if(f=b.data,f==="/$"||f==="/&"){if(p===0){i.removeChild(b),Jc(o);return}p--}else if(f==="$"||f==="$?"||f==="$~"||f==="$!"||f==="&")p++;else if(f==="html")mh(i.ownerDocument.documentElement);else if(f==="head"){f=i.ownerDocument.head,mh(f);for(var S=f.firstChild;S;){var M=S.nextSibling,X=S.nodeName;S[Bn]||X==="SCRIPT"||X==="STYLE"||X==="LINK"&&S.rel.toLowerCase()==="stylesheet"||f.removeChild(S),S=M}}else f==="body"&&mh(i.ownerDocument.body);f=b}while(f);Jc(o)}function Ab(i,o){var f=i;i=0;do{var p=f.nextSibling;if(f.nodeType===1?o?(f._stashedDisplay=f.style.display,f.style.display="none"):(f.style.display=f._stashedDisplay||"",f.getAttribute("style")===""&&f.removeAttribute("style")):f.nodeType===3&&(o?(f._stashedText=f.nodeValue,f.nodeValue=""):f.nodeValue=f._stashedText||""),p&&p.nodeType===8)if(f=p.data,f==="/$"){if(i===0)break;i--}else f!=="$"&&f!=="$?"&&f!=="$~"&&f!=="$!"||i++;f=p}while(f)}function p0(i){var o=i.firstChild;for(o&&o.nodeType===10&&(o=o.nextSibling);o;){var f=o;switch(o=o.nextSibling,f.nodeName){case"HTML":case"HEAD":case"BODY":p0(f),Kn(f);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(f.rel.toLowerCase()==="stylesheet")continue}i.removeChild(f)}}function zE(i,o,f,p){for(;i.nodeType===1;){var b=f;if(i.nodeName.toLowerCase()!==o.toLowerCase()){if(!p&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(p){if(!i[Bn])switch(o){case"meta":if(!i.hasAttribute("itemprop"))break;return i;case"link":if(S=i.getAttribute("rel"),S==="stylesheet"&&i.hasAttribute("data-precedence"))break;if(S!==b.rel||i.getAttribute("href")!==(b.href==null||b.href===""?null:b.href)||i.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin)||i.getAttribute("title")!==(b.title==null?null:b.title))break;return i;case"style":if(i.hasAttribute("data-precedence"))break;return i;case"script":if(S=i.getAttribute("src"),(S!==(b.src==null?null:b.src)||i.getAttribute("type")!==(b.type==null?null:b.type)||i.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin))&&S&&i.hasAttribute("async")&&!i.hasAttribute("itemprop"))break;return i;default:return i}}else if(o==="input"&&i.type==="hidden"){var S=b.name==null?null:""+b.name;if(b.type==="hidden"&&i.getAttribute("name")===S)return i}else return i;if(i=Ss(i.nextSibling),i===null)break}return null}function qE(i,o,f){if(o==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!f||(i=Ss(i.nextSibling),i===null))return null;return i}function Nb(i,o){for(;i.nodeType!==8;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!o||(i=Ss(i.nextSibling),i===null))return null;return i}function m0(i){return i.data==="$?"||i.data==="$~"}function g0(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState!=="loading"}function HE(i,o){var f=i.ownerDocument;if(i.data==="$~")i._reactRetry=o;else if(i.data!=="$?"||f.readyState!=="loading")o();else{var p=function(){o(),f.removeEventListener("DOMContentLoaded",p)};f.addEventListener("DOMContentLoaded",p),i._reactRetry=p}}function Ss(i){for(;i!=null;i=i.nextSibling){var o=i.nodeType;if(o===1||o===3)break;if(o===8){if(o=i.data,o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"||o==="F!"||o==="F")break;if(o==="/$"||o==="/&")return null}}return i}var v0=null;function Cb(i){i=i.nextSibling;for(var o=0;i;){if(i.nodeType===8){var f=i.data;if(f==="/$"||f==="/&"){if(o===0)return Ss(i.nextSibling);o--}else f!=="$"&&f!=="$!"&&f!=="$?"&&f!=="$~"&&f!=="&"||o++}i=i.nextSibling}return null}function Tb(i){i=i.previousSibling;for(var o=0;i;){if(i.nodeType===8){var f=i.data;if(f==="$"||f==="$!"||f==="$?"||f==="$~"||f==="&"){if(o===0)return i;o--}else f!=="/$"&&f!=="/&"||o++}i=i.previousSibling}return null}function Lb(i,o,f){switch(o=Qd(f),i){case"html":if(i=o.documentElement,!i)throw Error(r(452));return i;case"head":if(i=o.head,!i)throw Error(r(453));return i;case"body":if(i=o.body,!i)throw Error(r(454));return i;default:throw Error(r(451))}}function mh(i){for(var o=i.attributes;o.length;)i.removeAttributeNode(o[0]);Kn(i)}var _s=new Map,Ob=new Set;function ep(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var ll=ce.d;ce.d={f:VE,r:YE,D:GE,C:WE,L:KE,m:JE,X:ZE,S:XE,M:QE};function VE(){var i=ll.f(),o=Vd();return i||o}function YE(i){var o=hn(i);o!==null&&o.tag===5&&o.type==="form"?G2(o):ll.r(i)}var Gc=typeof document>"u"?null:document;function jb(i,o,f){var p=Gc;if(p&&typeof o=="string"&&o){var b=Pr(o);b='link[rel="'+i+'"][href="'+b+'"]',typeof f=="string"&&(b+='[crossorigin="'+f+'"]'),Ob.has(b)||(Ob.add(b),i={rel:i,crossOrigin:f,href:o},p.querySelector(b)===null&&(o=p.createElement("link"),Ha(o,"link",i),Xn(o),p.head.appendChild(o)))}}function GE(i){ll.D(i),jb("dns-prefetch",i,null)}function WE(i,o){ll.C(i,o),jb("preconnect",i,o)}function KE(i,o,f){ll.L(i,o,f);var p=Gc;if(p&&i&&o){var b='link[rel="preload"][as="'+Pr(o)+'"]';o==="image"&&f&&f.imageSrcSet?(b+='[imagesrcset="'+Pr(f.imageSrcSet)+'"]',typeof f.imageSizes=="string"&&(b+='[imagesizes="'+Pr(f.imageSizes)+'"]')):b+='[href="'+Pr(i)+'"]';var S=b;switch(o){case"style":S=Wc(i);break;case"script":S=Kc(i)}_s.has(S)||(i=g({rel:"preload",href:o==="image"&&f&&f.imageSrcSet?void 0:i,as:o},f),_s.set(S,i),p.querySelector(b)!==null||o==="style"&&p.querySelector(gh(S))||o==="script"&&p.querySelector(vh(S))||(o=p.createElement("link"),Ha(o,"link",i),Xn(o),p.head.appendChild(o)))}}function JE(i,o){ll.m(i,o);var f=Gc;if(f&&i){var p=o&&typeof o.as=="string"?o.as:"script",b='link[rel="modulepreload"][as="'+Pr(p)+'"][href="'+Pr(i)+'"]',S=b;switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":S=Kc(i)}if(!_s.has(S)&&(i=g({rel:"modulepreload",href:i},o),_s.set(S,i),f.querySelector(b)===null)){switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(f.querySelector(vh(S)))return}p=f.createElement("link"),Ha(p,"link",i),Xn(p),f.head.appendChild(p)}}}function XE(i,o,f){ll.S(i,o,f);var p=Gc;if(p&&i){var b=ra(p).hoistableStyles,S=Wc(i);o=o||"default";var M=b.get(S);if(!M){var X={loading:0,preload:null};if(M=p.querySelector(gh(S)))X.loading=5;else{i=g({rel:"stylesheet",href:i,"data-precedence":o},f),(f=_s.get(S))&&y0(i,f);var pe=M=p.createElement("link");Xn(pe),Ha(pe,"link",i),pe._p=new Promise(function(Re,Fe){pe.onload=Re,pe.onerror=Fe}),pe.addEventListener("load",function(){X.loading|=1}),pe.addEventListener("error",function(){X.loading|=2}),X.loading|=4,tp(M,o,p)}M={type:"stylesheet",instance:M,count:1,state:X},b.set(S,M)}}}function ZE(i,o){ll.X(i,o);var f=Gc;if(f&&i){var p=ra(f).hoistableScripts,b=Kc(i),S=p.get(b);S||(S=f.querySelector(vh(b)),S||(i=g({src:i,async:!0},o),(o=_s.get(b))&&b0(i,o),S=f.createElement("script"),Xn(S),Ha(S,"link",i),f.head.appendChild(S)),S={type:"script",instance:S,count:1,state:null},p.set(b,S))}}function QE(i,o){ll.M(i,o);var f=Gc;if(f&&i){var p=ra(f).hoistableScripts,b=Kc(i),S=p.get(b);S||(S=f.querySelector(vh(b)),S||(i=g({src:i,async:!0,type:"module"},o),(o=_s.get(b))&&b0(i,o),S=f.createElement("script"),Xn(S),Ha(S,"link",i),f.head.appendChild(S)),S={type:"script",instance:S,count:1,state:null},p.set(b,S))}}function Rb(i,o,f,p){var b=(b=V.current)?ep(b):null;if(!b)throw Error(r(446));switch(i){case"meta":case"title":return null;case"style":return typeof f.precedence=="string"&&typeof f.href=="string"?(o=Wc(f.href),f=ra(b).hoistableStyles,p=f.get(o),p||(p={type:"style",instance:null,count:0,state:null},f.set(o,p)),p):{type:"void",instance:null,count:0,state:null};case"link":if(f.rel==="stylesheet"&&typeof f.href=="string"&&typeof f.precedence=="string"){i=Wc(f.href);var S=ra(b).hoistableStyles,M=S.get(i);if(M||(b=b.ownerDocument||b,M={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},S.set(i,M),(S=b.querySelector(gh(i)))&&!S._p&&(M.instance=S,M.state.loading=5),_s.has(i)||(f={rel:"preload",as:"style",href:f.href,crossOrigin:f.crossOrigin,integrity:f.integrity,media:f.media,hrefLang:f.hrefLang,referrerPolicy:f.referrerPolicy},_s.set(i,f),S||eA(b,i,f,M.state))),o&&p===null)throw Error(r(528,""));return M}if(o&&p!==null)throw Error(r(529,""));return null;case"script":return o=f.async,f=f.src,typeof f=="string"&&o&&typeof o!="function"&&typeof o!="symbol"?(o=Kc(f),f=ra(b).hoistableScripts,p=f.get(o),p||(p={type:"script",instance:null,count:0,state:null},f.set(o,p)),p):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,i))}}function Wc(i){return'href="'+Pr(i)+'"'}function gh(i){return'link[rel="stylesheet"]['+i+"]"}function Db(i){return g({},i,{"data-precedence":i.precedence,precedence:null})}function eA(i,o,f,p){i.querySelector('link[rel="preload"][as="style"]['+o+"]")?p.loading=1:(o=i.createElement("link"),p.preload=o,o.addEventListener("load",function(){return p.loading|=1}),o.addEventListener("error",function(){return p.loading|=2}),Ha(o,"link",f),Xn(o),i.head.appendChild(o))}function Kc(i){return'[src="'+Pr(i)+'"]'}function vh(i){return"script[async]"+i}function kb(i,o,f){if(o.count++,o.instance===null)switch(o.type){case"style":var p=i.querySelector('style[data-href~="'+Pr(f.href)+'"]');if(p)return o.instance=p,Xn(p),p;var b=g({},f,{"data-href":f.href,"data-precedence":f.precedence,href:null,precedence:null});return p=(i.ownerDocument||i).createElement("style"),Xn(p),Ha(p,"style",b),tp(p,f.precedence,i),o.instance=p;case"stylesheet":b=Wc(f.href);var S=i.querySelector(gh(b));if(S)return o.state.loading|=4,o.instance=S,Xn(S),S;p=Db(f),(b=_s.get(b))&&y0(p,b),S=(i.ownerDocument||i).createElement("link"),Xn(S);var M=S;return M._p=new Promise(function(X,pe){M.onload=X,M.onerror=pe}),Ha(S,"link",p),o.state.loading|=4,tp(S,f.precedence,i),o.instance=S;case"script":return S=Kc(f.src),(b=i.querySelector(vh(S)))?(o.instance=b,Xn(b),b):(p=f,(b=_s.get(S))&&(p=g({},f),b0(p,b)),i=i.ownerDocument||i,b=i.createElement("script"),Xn(b),Ha(b,"link",p),i.head.appendChild(b),o.instance=b);case"void":return null;default:throw Error(r(443,o.type))}else o.type==="stylesheet"&&(o.state.loading&4)===0&&(p=o.instance,o.state.loading|=4,tp(p,f.precedence,i));return o.instance}function tp(i,o,f){for(var p=f.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),b=p.length?p[p.length-1]:null,S=b,M=0;M<p.length;M++){var X=p[M];if(X.dataset.precedence===o)S=X;else if(S!==b)break}S?S.parentNode.insertBefore(i,S.nextSibling):(o=f.nodeType===9?f.head:f,o.insertBefore(i,o.firstChild))}function y0(i,o){i.crossOrigin==null&&(i.crossOrigin=o.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=o.referrerPolicy),i.title==null&&(i.title=o.title)}function b0(i,o){i.crossOrigin==null&&(i.crossOrigin=o.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=o.referrerPolicy),i.integrity==null&&(i.integrity=o.integrity)}var np=null;function Mb(i,o,f){if(np===null){var p=new Map,b=np=new Map;b.set(f,p)}else b=np,p=b.get(f),p||(p=new Map,b.set(f,p));if(p.has(i))return p;for(p.set(i,null),f=f.getElementsByTagName(i),b=0;b<f.length;b++){var S=f[b];if(!(S[Bn]||S[Qe]||i==="link"&&S.getAttribute("rel")==="stylesheet")&&S.namespaceURI!=="http://www.w3.org/2000/svg"){var M=S.getAttribute(o)||"";M=i+M;var X=p.get(M);X?X.push(S):p.set(M,[S])}}return p}function Pb(i,o,f){i=i.ownerDocument||i,i.head.insertBefore(f,o==="title"?i.querySelector("head > title"):null)}function tA(i,o,f){if(f===1||o.itemProp!=null)return!1;switch(i){case"meta":case"title":return!0;case"style":if(typeof o.precedence!="string"||typeof o.href!="string"||o.href==="")break;return!0;case"link":if(typeof o.rel!="string"||typeof o.href!="string"||o.href===""||o.onLoad||o.onError)break;switch(o.rel){case"stylesheet":return i=o.disabled,typeof o.precedence=="string"&&i==null;default:return!0}case"script":if(o.async&&typeof o.async!="function"&&typeof o.async!="symbol"&&!o.onLoad&&!o.onError&&o.src&&typeof o.src=="string")return!0}return!1}function Ib(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function nA(i,o,f,p){if(f.type==="stylesheet"&&(typeof p.media!="string"||matchMedia(p.media).matches!==!1)&&(f.state.loading&4)===0){if(f.instance===null){var b=Wc(p.href),S=o.querySelector(gh(b));if(S){o=S._p,o!==null&&typeof o=="object"&&typeof o.then=="function"&&(i.count++,i=rp.bind(i),o.then(i,i)),f.state.loading|=4,f.instance=S,Xn(S);return}S=o.ownerDocument||o,p=Db(p),(b=_s.get(b))&&y0(p,b),S=S.createElement("link"),Xn(S);var M=S;M._p=new Promise(function(X,pe){M.onload=X,M.onerror=pe}),Ha(S,"link",p),f.instance=S}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(f,o),(o=f.state.preload)&&(f.state.loading&3)===0&&(i.count++,f=rp.bind(i),o.addEventListener("load",f),o.addEventListener("error",f))}}var w0=0;function rA(i,o){return i.stylesheets&&i.count===0&&ip(i,i.stylesheets),0<i.count||0<i.imgCount?function(f){var p=setTimeout(function(){if(i.stylesheets&&ip(i,i.stylesheets),i.unsuspend){var S=i.unsuspend;i.unsuspend=null,S()}},6e4+o);0<i.imgBytes&&w0===0&&(w0=62500*IE());var b=setTimeout(function(){if(i.waitingForImages=!1,i.count===0&&(i.stylesheets&&ip(i,i.stylesheets),i.unsuspend)){var S=i.unsuspend;i.unsuspend=null,S()}},(i.imgBytes>w0?50:800)+o);return i.unsuspend=f,function(){i.unsuspend=null,clearTimeout(p),clearTimeout(b)}}:null}function rp(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ip(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var ap=null;function ip(i,o){i.stylesheets=null,i.unsuspend!==null&&(i.count++,ap=new Map,o.forEach(aA,i),ap=null,rp.call(i))}function aA(i,o){if(!(o.state.loading&4)){var f=ap.get(i);if(f)var p=f.get(null);else{f=new Map,ap.set(i,f);for(var b=i.querySelectorAll("link[data-precedence],style[data-precedence]"),S=0;S<b.length;S++){var M=b[S];(M.nodeName==="LINK"||M.getAttribute("media")!=="not all")&&(f.set(M.dataset.precedence,M),p=M)}p&&f.set(null,p)}b=o.instance,M=b.getAttribute("data-precedence"),S=f.get(M)||p,S===p&&f.set(null,b),f.set(M,b),this.count++,p=rp.bind(this),b.addEventListener("load",p),b.addEventListener("error",p),S?S.parentNode.insertBefore(b,S.nextSibling):(i=i.nodeType===9?i.head:i,i.insertBefore(b,i.firstChild)),o.state.loading|=4}}var yh={$$typeof:T,Provider:null,Consumer:null,_currentValue:oe,_currentValue2:oe,_threadCount:0};function iA(i,o,f,p,b,S,M,X,pe){this.tag=1,this.containerInfo=i,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=ha(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ha(0),this.hiddenUpdates=ha(null),this.identifierPrefix=p,this.onUncaughtError=b,this.onCaughtError=S,this.onRecoverableError=M,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=pe,this.incompleteTransitions=new Map}function Fb(i,o,f,p,b,S,M,X,pe,Re,Fe,Ge){return i=new iA(i,o,f,M,pe,Re,Fe,Ge,X),o=1,S===!0&&(o|=24),S=La(3,null,null,o),i.current=S,S.stateNode=i,o=Bl(),o.refCount++,i.pooledCache=o,o.refCount++,S.memoizedState={element:p,isDehydrated:f,cache:o},nt(S),i}function Ub(i){return i?(i=ga,i):ga}function Bb(i,o,f,p,b,S){b=Ub(b),p.context===null?p.context=b:p.pendingContext=b,p=Bt(o),p.payload={element:f},S=S===void 0?null:S,S!==null&&(p.callback=S),f=un(i,p,o),f!==null&&(ki(f,i,o),$n(f,i,o))}function $b(i,o){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var f=i.retryLane;i.retryLane=f!==0&&f<o?f:o}}function x0(i,o){$b(i,o),(i=i.alternate)&&$b(i,o)}function zb(i){if(i.tag===13||i.tag===31){var o=Vs(i,67108864);o!==null&&ki(o,i,67108864),x0(i,67108864)}}function qb(i){if(i.tag===13||i.tag===31){var o=Ji();o=Ne(o);var f=Vs(i,o);f!==null&&ki(f,i,o),x0(i,o)}}var sp=!0;function sA(i,o,f,p){var b=Z.T;Z.T=null;var S=ce.p;try{ce.p=2,S0(i,o,f,p)}finally{ce.p=S,Z.T=b}}function oA(i,o,f,p){var b=Z.T;Z.T=null;var S=ce.p;try{ce.p=8,S0(i,o,f,p)}finally{ce.p=S,Z.T=b}}function S0(i,o,f,p){if(sp){var b=_0(p);if(b===null)l0(i,o,p,op,f),Vb(i,p);else if(uA(b,i,o,f,p))p.stopPropagation();else if(Vb(i,p),o&4&&-1<lA.indexOf(i)){for(;b!==null;){var S=hn(b);if(S!==null)switch(S.tag){case 3:if(S=S.stateNode,S.current.memoizedState.isDehydrated){var M=_t(S.pendingLanes);if(M!==0){var X=S;for(X.pendingLanes|=2,X.entangledLanes|=2;M;){var pe=1<<31-pn(M);X.entanglements[1]|=pe,M&=~pe}Ao(S),(qn&6)===0&&(qd=Ft()+500,hh(0))}}break;case 31:case 13:X=Vs(S,2),X!==null&&ki(X,S,2),Vd(),x0(S,2)}if(S=_0(p),S===null&&l0(i,o,p,op,f),S===b)break;b=S}b!==null&&p.stopPropagation()}else l0(i,o,p,null,f)}}function _0(i){return i=Fo(i),E0(i)}var op=null;function E0(i){if(op=null,i=Jn(i),i!==null){var o=s(i);if(o===null)i=null;else{var f=o.tag;if(f===13){if(i=l(o),i!==null)return i;i=null}else if(f===31){if(i=u(o),i!==null)return i;i=null}else if(f===3){if(o.stateNode.current.memoizedState.isDehydrated)return o.tag===3?o.stateNode.containerInfo:null;i=null}else o!==i&&(i=null)}}return op=i,null}function Hb(i){switch(i){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"resize":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"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"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(rn()){case Jt:return 2;case fn:return 8;case zt:case at:return 32;case Xt:return 268435456;default:return 32}default:return 32}}var A0=!1,Ql=null,eu=null,tu=null,bh=new Map,wh=new Map,nu=[],lA="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 Vb(i,o){switch(i){case"focusin":case"focusout":Ql=null;break;case"dragenter":case"dragleave":eu=null;break;case"mouseover":case"mouseout":tu=null;break;case"pointerover":case"pointerout":bh.delete(o.pointerId);break;case"gotpointercapture":case"lostpointercapture":wh.delete(o.pointerId)}}function xh(i,o,f,p,b,S){return i===null||i.nativeEvent!==S?(i={blockedOn:o,domEventName:f,eventSystemFlags:p,nativeEvent:S,targetContainers:[b]},o!==null&&(o=hn(o),o!==null&&zb(o)),i):(i.eventSystemFlags|=p,o=i.targetContainers,b!==null&&o.indexOf(b)===-1&&o.push(b),i)}function uA(i,o,f,p,b){switch(o){case"focusin":return Ql=xh(Ql,i,o,f,p,b),!0;case"dragenter":return eu=xh(eu,i,o,f,p,b),!0;case"mouseover":return tu=xh(tu,i,o,f,p,b),!0;case"pointerover":var S=b.pointerId;return bh.set(S,xh(bh.get(S)||null,i,o,f,p,b)),!0;case"gotpointercapture":return S=b.pointerId,wh.set(S,xh(wh.get(S)||null,i,o,f,p,b)),!0}return!1}function Yb(i){var o=Jn(i.target);if(o!==null){var f=s(o);if(f!==null){if(o=f.tag,o===13){if(o=l(f),o!==null){i.blockedOn=o,ht(i.priority,function(){qb(f)});return}}else if(o===31){if(o=u(f),o!==null){i.blockedOn=o,ht(i.priority,function(){qb(f)});return}}else if(o===3&&f.stateNode.current.memoizedState.isDehydrated){i.blockedOn=f.tag===3?f.stateNode.containerInfo:null;return}}}i.blockedOn=null}function lp(i){if(i.blockedOn!==null)return!1;for(var o=i.targetContainers;0<o.length;){var f=_0(i.nativeEvent);if(f===null){f=i.nativeEvent;var p=new f.constructor(f.type,f);Ts=p,f.target.dispatchEvent(p),Ts=null}else return o=hn(f),o!==null&&zb(o),i.blockedOn=f,!1;o.shift()}return!0}function Gb(i,o,f){lp(i)&&f.delete(o)}function cA(){A0=!1,Ql!==null&&lp(Ql)&&(Ql=null),eu!==null&&lp(eu)&&(eu=null),tu!==null&&lp(tu)&&(tu=null),bh.forEach(Gb),wh.forEach(Gb)}function up(i,o){i.blockedOn===o&&(i.blockedOn=null,A0||(A0=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,cA)))}var cp=null;function Wb(i){cp!==i&&(cp=i,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){cp===i&&(cp=null);for(var o=0;o<i.length;o+=3){var f=i[o],p=i[o+1],b=i[o+2];if(typeof p!="function"){if(E0(p||f)===null)continue;break}var S=hn(f);S!==null&&(i.splice(o,3),o-=3,_g(S,{pending:!0,data:b,method:f.method,action:p},p,b))}}))}function Jc(i){function o(pe){return up(pe,i)}Ql!==null&&up(Ql,i),eu!==null&&up(eu,i),tu!==null&&up(tu,i),bh.forEach(o),wh.forEach(o);for(var f=0;f<nu.length;f++){var p=nu[f];p.blockedOn===i&&(p.blockedOn=null)}for(;0<nu.length&&(f=nu[0],f.blockedOn===null);)Yb(f),f.blockedOn===null&&nu.shift();if(f=(i.ownerDocument||i).$$reactFormReplay,f!=null)for(p=0;p<f.length;p+=3){var b=f[p],S=f[p+1],M=b[et]||null;if(typeof S=="function")M||Wb(f);else if(M){var X=null;if(S&&S.hasAttribute("formAction")){if(b=S,M=S[et]||null)X=M.formAction;else if(E0(b)!==null)continue}else X=M.action;typeof X=="function"?f[p+1]=X:(f.splice(p,3),p-=3),Wb(f)}}}function Kb(){function i(S){S.canIntercept&&S.info==="react-transition"&&S.intercept({handler:function(){return new Promise(function(M){return b=M})},focusReset:"manual",scroll:"manual"})}function o(){b!==null&&(b(),b=null),p||setTimeout(f,20)}function f(){if(!p&&!navigation.transition){var S=navigation.currentEntry;S&&S.url!=null&&navigation.navigate(S.url,{state:S.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var p=!1,b=null;return navigation.addEventListener("navigate",i),navigation.addEventListener("navigatesuccess",o),navigation.addEventListener("navigateerror",o),setTimeout(f,100),function(){p=!0,navigation.removeEventListener("navigate",i),navigation.removeEventListener("navigatesuccess",o),navigation.removeEventListener("navigateerror",o),b!==null&&(b(),b=null)}}}function N0(i){this._internalRoot=i}fp.prototype.render=N0.prototype.render=function(i){var o=this._internalRoot;if(o===null)throw Error(r(409));var f=o.current,p=Ji();Bb(f,p,i,o,null,null)},fp.prototype.unmount=N0.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var o=i.containerInfo;Bb(i.current,2,null,i,null,null),Vd(),o[rt]=null}};function fp(i){this._internalRoot=i}fp.prototype.unstable_scheduleHydration=function(i){if(i){var o=Xe();i={blockedOn:null,target:i,priority:o};for(var f=0;f<nu.length&&o!==0&&o<nu[f].priority;f++);nu.splice(f,0,i),f===0&&Yb(i)}};var Jb=e.version;if(Jb!=="19.2.3")throw Error(r(527,Jb,"19.2.3"));ce.findDOMNode=function(i){var o=i._reactInternals;if(o===void 0)throw typeof i.render=="function"?Error(r(188)):(i=Object.keys(i).join(","),Error(r(268,i)));return i=h(o),i=i!==null?d(i):null,i=i===null?null:i.stateNode,i};var fA={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:Z,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var hp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!hp.isDisabled&&hp.supportsFiber)try{dn=hp.inject(fA),bt=hp}catch{}}return _h.createRoot=function(i,o){if(!a(i))throw Error(r(299));var f=!1,p="",b=ry,S=ay,M=iy;return o!=null&&(o.unstable_strictMode===!0&&(f=!0),o.identifierPrefix!==void 0&&(p=o.identifierPrefix),o.onUncaughtError!==void 0&&(b=o.onUncaughtError),o.onCaughtError!==void 0&&(S=o.onCaughtError),o.onRecoverableError!==void 0&&(M=o.onRecoverableError)),o=Fb(i,1,!1,null,null,f,p,null,b,S,M,Kb),i[rt]=o.current,o0(i),new N0(o)},_h.hydrateRoot=function(i,o,f){if(!a(i))throw Error(r(299));var p=!1,b="",S=ry,M=ay,X=iy,pe=null;return f!=null&&(f.unstable_strictMode===!0&&(p=!0),f.identifierPrefix!==void 0&&(b=f.identifierPrefix),f.onUncaughtError!==void 0&&(S=f.onUncaughtError),f.onCaughtError!==void 0&&(M=f.onCaughtError),f.onRecoverableError!==void 0&&(X=f.onRecoverableError),f.formState!==void 0&&(pe=f.formState)),o=Fb(i,1,!0,o,f??null,p,b,pe,S,M,X,Kb),o.context=Ub(null),f=o.current,p=Ji(),p=Ne(p),b=Bt(p),b.callback=null,un(f,b,p),f=p,o.current.lanes=f,Et(o,f),Ao(o),i[rt]=o.current,o0(i),new fp(o)},_h.version="19.2.3",_h}var s5;function _A(){if(s5)return L0.exports;s5=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),L0.exports=SA(),L0.exports}var EA=_A();/**
50
- * react-router v7.12.0
51
- *
52
- * Copyright (c) Remix Software Inc.
53
- *
54
- * This source code is licensed under the MIT license found in the
55
- * LICENSE.md file in the root directory of this source tree.
56
- *
57
- * @license MIT
58
- */var p_=t=>{throw TypeError(t)},AA=(t,e,n)=>e.has(t)||p_("Cannot "+n),D0=(t,e,n)=>(AA(t,e,"read from private field"),n?n.call(t):e.get(t)),NA=(t,e,n)=>e.has(t)?p_("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),o5="popstate";function CA(t={}){function e(r,a){let{pathname:s,search:l,hash:u}=r.location;return Vh("",{pathname:s,search:l,hash:u},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function n(r,a){return typeof a=="string"?a:ko(a)}return LA(e,n,null,t)}function cn(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function Dr(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function TA(){return Math.random().toString(36).substring(2,10)}function l5(t,e){return{usr:t.state,key:t.key,idx:e}}function Vh(t,e,n=null,r){return{pathname:typeof t=="string"?t:t.pathname,search:"",hash:"",...typeof e=="string"?wl(e):e,state:n,key:e&&e.key||r||TA()}}function ko({pathname:t="/",search:e="",hash:n=""}){return e&&e!=="?"&&(t+=e.charAt(0)==="?"?e:"?"+e),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function wl(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substring(n),t=t.substring(0,n));let r=t.indexOf("?");r>=0&&(e.search=t.substring(r),t=t.substring(0,r)),t&&(e.pathname=t)}return e}function LA(t,e,n,r={}){let{window:a=document.defaultView,v5Compat:s=!1}=r,l=a.history,u="POP",c=null,h=d();h==null&&(h=0,l.replaceState({...l.state,idx:h},""));function d(){return(l.state||{idx:null}).idx}function g(){u="POP";let A=d(),N=A==null?null:A-h;h=A,c&&c({action:u,location:E.location,delta:N})}function y(A,N){u="PUSH";let O=Vh(E.location,A,N);h=d()+1;let T=l5(O,h),D=E.createHref(O);try{l.pushState(T,"",D)}catch(F){if(F instanceof DOMException&&F.name==="DataCloneError")throw F;a.location.assign(D)}s&&c&&c({action:u,location:E.location,delta:1})}function m(A,N){u="REPLACE";let O=Vh(E.location,A,N);h=d();let T=l5(O,h),D=E.createHref(O);l.replaceState(T,"",D),s&&c&&c({action:u,location:E.location,delta:0})}function x(A){return m_(A)}let E={get action(){return u},get location(){return t(a,l)},listen(A){if(c)throw new Error("A history only accepts one active listener");return a.addEventListener(o5,g),c=A,()=>{a.removeEventListener(o5,g),c=null}},createHref(A){return e(a,A)},createURL:x,encodeLocation(A){let N=x(A);return{pathname:N.pathname,search:N.search,hash:N.hash}},push:y,replace:m,go(A){return l.go(A)}};return E}function m_(t,e=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),cn(n,"No window.location.(origin|href) available to create URL");let r=typeof t=="string"?t:ko(t);return r=r.replace(/ $/,"%20"),!e&&r.startsWith("//")&&(r=n+r),new URL(r,n)}var Dh,u5=class{constructor(t){if(NA(this,Dh,new Map),t)for(let[e,n]of t)this.set(e,n)}get(t){if(D0(this,Dh).has(t))return D0(this,Dh).get(t);if(t.defaultValue!==void 0)return t.defaultValue;throw new Error("No value found for context")}set(t,e){D0(this,Dh).set(t,e)}};Dh=new WeakMap;var OA=new Set(["lazy","caseSensitive","path","id","index","children"]);function jA(t){return OA.has(t)}var RA=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function DA(t){return RA.has(t)}function kA(t){return t.index===!0}function Yh(t,e,n=[],r={},a=!1){return t.map((s,l)=>{let u=[...n,String(l)],c=typeof s.id=="string"?s.id:u.join("-");if(cn(s.index!==!0||!s.children,"Cannot specify children on an index route"),cn(a||!r[c],`Found a route id collision on id "${c}". Route id's must be globally unique within Data Router usages`),kA(s)){let h={...s,id:c};return r[c]=c5(h,e(h)),h}else{let h={...s,id:c,children:void 0};return r[c]=c5(h,e(h)),s.children&&(h.children=Yh(s.children,e,u,r,a)),h}})}function c5(t,e){return Object.assign(t,{...e,...typeof e.lazy=="object"&&e.lazy!=null?{lazy:{...t.lazy,...e.lazy}}:{}})}function uu(t,e,n="/"){return kh(t,e,n,!1)}function kh(t,e,n,r){let a=typeof e=="string"?wl(e):e,s=As(a.pathname||"/",n);if(s==null)return null;let l=g_(t);PA(l);let u=null;for(let c=0;u==null&&c<l.length;++c){let h=GA(s);u=VA(l[c],h,r)}return u}function MA(t,e){let{route:n,pathname:r,params:a}=t;return{id:n.id,pathname:r,params:a,data:e[n.id],loaderData:e[n.id],handle:n.handle}}function g_(t,e=[],n=[],r="",a=!1){let s=(l,u,c=a,h)=>{let d={relativePath:h===void 0?l.path||"":h,caseSensitive:l.caseSensitive===!0,childrenIndex:u,route:l};if(d.relativePath.startsWith("/")){if(!d.relativePath.startsWith(r)&&c)return;cn(d.relativePath.startsWith(r),`Absolute route path "${d.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),d.relativePath=d.relativePath.slice(r.length)}let g=Ro([r,d.relativePath]),y=n.concat(d);l.children&&l.children.length>0&&(cn(l.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${g}".`),g_(l.children,e,y,g,c)),!(l.path==null&&!l.index)&&e.push({path:g,score:qA(g,l.index),routesMeta:y})};return t.forEach((l,u)=>{var c;if(l.path===""||!((c=l.path)!=null&&c.includes("?")))s(l,u);else for(let h of v_(l.path))s(l,u,!0,h)}),e}function v_(t){let e=t.split("/");if(e.length===0)return[];let[n,...r]=e,a=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return a?[s,""]:[s];let l=v_(r.join("/")),u=[];return u.push(...l.map(c=>c===""?s:[s,c].join("/"))),a&&u.push(...l),u.map(c=>t.startsWith("/")&&c===""?"/":c)}function PA(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:HA(e.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var IA=/^:[\w-]+$/,FA=3,UA=2,BA=1,$A=10,zA=-2,f5=t=>t==="*";function qA(t,e){let n=t.split("/"),r=n.length;return n.some(f5)&&(r+=zA),e&&(r+=UA),n.filter(a=>!f5(a)).reduce((a,s)=>a+(IA.test(s)?FA:s===""?BA:$A),r)}function HA(t,e){return t.length===e.length&&t.slice(0,-1).every((r,a)=>r===e[a])?t[t.length-1]-e[e.length-1]:0}function VA(t,e,n=!1){let{routesMeta:r}=t,a={},s="/",l=[];for(let u=0;u<r.length;++u){let c=r[u],h=u===r.length-1,d=s==="/"?e:e.slice(s.length)||"/",g=um({path:c.relativePath,caseSensitive:c.caseSensitive,end:h},d),y=c.route;if(!g&&h&&n&&!r[r.length-1].route.index&&(g=um({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},d)),!g)return null;Object.assign(a,g.params),l.push({params:a,pathname:Ro([s,g.pathname]),pathnameBase:JA(Ro([s,g.pathnameBase])),route:y}),g.pathnameBase!=="/"&&(s=Ro([s,g.pathnameBase]))}return l}function um(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[n,r]=YA(t.path,t.caseSensitive,t.end),a=e.match(n);if(!a)return null;let s=a[0],l=s.replace(/(.)\/+$/,"$1"),u=a.slice(1);return{params:r.reduce((h,{paramName:d,isOptional:g},y)=>{if(d==="*"){let x=u[y]||"";l=s.slice(0,s.length-x.length).replace(/(.)\/+$/,"$1")}const m=u[y];return g&&!m?h[d]=void 0:h[d]=(m||"").replace(/%2F/g,"/"),h},{}),pathname:s,pathnameBase:l,pattern:t}}function YA(t,e=!1,n=!0){Dr(t==="*"||!t.endsWith("*")||t.endsWith("/*"),`Route path "${t}" will be treated as if it were "${t.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${t.replace(/\*$/,"/*")}".`);let r=[],a="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,u,c)=>(r.push({paramName:u,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return t.endsWith("*")?(r.push({paramName:"*"}),a+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?a+="\\/*$":t!==""&&t!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,e?void 0:"i"),r]}function GA(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return Dr(!1,`The URL path "${t}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${e}).`),t}}function As(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,r=t.charAt(n);return r&&r!=="/"?null:t.slice(n)||"/"}function WA({basename:t,pathname:e}){return e==="/"?t:Ro([t,e])}var y_=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,$m=t=>y_.test(t);function KA(t,e="/"){let{pathname:n,search:r="",hash:a=""}=typeof t=="string"?wl(t):t,s;if(n)if($m(n))s=n;else{if(n.includes("//")){let l=n;n=n.replace(/\/\/+/g,"/"),Dr(!1,`Pathnames cannot have embedded double slashes - normalizing ${l} -> ${n}`)}n.startsWith("/")?s=h5(n.substring(1),"/"):s=h5(n,e)}else s=e;return{pathname:s,search:XA(r),hash:ZA(a)}}function h5(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(a=>{a===".."?n.length>1&&n.pop():a!=="."&&n.push(a)}),n.length>1?n.join("/"):"/"}function k0(t,e,n,r){return`Cannot include a '${t}' character in a manually specified \`to.${e}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function b_(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function zm(t){let e=b_(t);return e.map((n,r)=>r===e.length-1?n.pathname:n.pathnameBase)}function qm(t,e,n,r=!1){let a;typeof t=="string"?a=wl(t):(a={...t},cn(!a.pathname||!a.pathname.includes("?"),k0("?","pathname","search",a)),cn(!a.pathname||!a.pathname.includes("#"),k0("#","pathname","hash",a)),cn(!a.search||!a.search.includes("#"),k0("#","search","hash",a)));let s=t===""||a.pathname==="",l=s?"/":a.pathname,u;if(l==null)u=n;else{let g=e.length-1;if(!r&&l.startsWith("..")){let y=l.split("/");for(;y[0]==="..";)y.shift(),g-=1;a.pathname=y.join("/")}u=g>=0?e[g]:"/"}let c=KA(a,u),h=l&&l!=="/"&&l.endsWith("/"),d=(s||l===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(h||d)&&(c.pathname+="/"),c}var Ro=t=>t.join("/").replace(/\/\/+/g,"/"),JA=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),XA=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,ZA=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t,od=class{constructor(t,e,n,r=!1){this.status=t,this.statusText=e||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Gh(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}function ld(t){return t.map(e=>e.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var w_=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function x_(t,e){let n=t;if(typeof n!="string"||!y_.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,a=!1;if(w_)try{let s=new URL(window.location.href),l=n.startsWith("//")?new URL(s.protocol+n):new URL(n),u=As(l.pathname,e);l.origin===s.origin&&u!=null?n=u+l.search+l.hash:a=!0}catch{Dr(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:a,to:n}}var hu=Symbol("Uninstrumented");function QA(t,e){let n={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};t.forEach(a=>a({id:e.id,index:e.index,path:e.path,instrument(s){let l=Object.keys(n);for(let u of l)s[u]&&n[u].push(s[u])}}));let r={};if(typeof e.lazy=="function"&&n.lazy.length>0){let a=bf(n.lazy,e.lazy,()=>{});a&&(r.lazy=a)}if(typeof e.lazy=="object"){let a=e.lazy;["middleware","loader","action"].forEach(s=>{let l=a[s],u=n[`lazy.${s}`];if(typeof l=="function"&&u.length>0){let c=bf(u,l,()=>{});c&&(r.lazy=Object.assign(r.lazy||{},{[s]:c}))}})}return["loader","action"].forEach(a=>{let s=e[a];if(typeof s=="function"&&n[a].length>0){let l=s[hu]??s,u=bf(n[a],l,(...c)=>d5(c[0]));u&&(a==="loader"&&l.hydrate===!0&&(u.hydrate=!0),u[hu]=l,r[a]=u)}}),e.middleware&&e.middleware.length>0&&n.middleware.length>0&&(r.middleware=e.middleware.map(a=>{let s=a[hu]??a,l=bf(n.middleware,s,(...u)=>d5(u[0]));return l?(l[hu]=s,l):a})),r}function eN(t,e){let n={navigate:[],fetch:[]};if(e.forEach(r=>r({instrument(a){let s=Object.keys(a);for(let l of s)a[l]&&n[l].push(a[l])}})),n.navigate.length>0){let r=t.navigate[hu]??t.navigate,a=bf(n.navigate,r,(...s)=>{let[l,u]=s;return{to:typeof l=="number"||typeof l=="string"?l:l?ko(l):".",...p5(t,u??{})}});a&&(a[hu]=r,t.navigate=a)}if(n.fetch.length>0){let r=t.fetch[hu]??t.fetch,a=bf(n.fetch,r,(...s)=>{let[l,,u,c]=s;return{href:u??".",fetcherKey:l,...p5(t,c??{})}});a&&(a[hu]=r,t.fetch=a)}return t}function bf(t,e,n){return t.length===0?null:async(...r)=>{let a=await S_(t,n(...r),()=>e(...r),t.length-1);if(a.type==="error")throw a.value;return a.value}}async function S_(t,e,n,r){let a=t[r],s;if(a){let l,u=async()=>(l?console.error("You cannot call instrumented handlers more than once"):l=S_(t,e,n,r-1),s=await l,cn(s,"Expected a result"),s.type==="error"&&s.value instanceof Error?{status:"error",error:s.value}:{status:"success",error:void 0});try{await a(u,e)}catch(c){console.error("An instrumentation function threw an error:",c)}l||await u(),await l}else try{s={type:"success",value:await n()}}catch(l){s={type:"error",value:l}}return s||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function d5(t){let{request:e,context:n,params:r,unstable_pattern:a}=t;return{request:tN(e),params:{...r},unstable_pattern:a,context:nN(n)}}function p5(t,e){return{currentUrl:ko(t.state.location),..."formMethod"in e?{formMethod:e.formMethod}:{},..."formEncType"in e?{formEncType:e.formEncType}:{},..."formData"in e?{formData:e.formData}:{},..."body"in e?{body:e.body}:{}}}function tN(t){return{method:t.method,url:t.url,headers:{get:(...e)=>t.headers.get(...e)}}}function nN(t){if(aN(t)){let e={...t};return Object.freeze(e),e}else return{get:e=>t.get(e)}}var rN=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function aN(t){if(t===null||typeof t!="object")return!1;const e=Object.getPrototypeOf(t);return e===Object.prototype||e===null||Object.getOwnPropertyNames(e).sort().join("\0")===rN}var __=["POST","PUT","PATCH","DELETE"],iN=new Set(__),sN=["GET",...__],oN=new Set(sN),E_=new Set([301,302,303,307,308]),lN=new Set([307,308]),M0={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},uN={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Eh={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},cN=t=>({hasErrorBoundary:!!t.hasErrorBoundary}),A_="remix-router-transitions",N_=Symbol("ResetLoaderData");function fN(t){const e=t.window?t.window:typeof window<"u"?window:void 0,n=typeof e<"u"&&typeof e.document<"u"&&typeof e.document.createElement<"u";cn(t.routes.length>0,"You must provide a non-empty routes array to createRouter");let r=t.hydrationRouteProperties||[],a=t.mapRouteProperties||cN,s=a;if(t.unstable_instrumentations){let de=t.unstable_instrumentations;s=Se=>({...a(Se),...QA(de.map(Ne=>Ne.route).filter(Boolean),Se)})}let l={},u=Yh(t.routes,s,void 0,l),c,h=t.basename||"/";h.startsWith("/")||(h=`/${h}`);let d=t.dataStrategy||gN,g={...t.future},y=null,m=new Set,x=null,E=null,A=null,N=t.hydrationData!=null,O=uu(u,t.history.location,h),T=!1,D=null,F;if(O==null&&!t.patchRoutesOnNavigation){let de=Es(404,{pathname:t.history.location.pathname}),{matches:Se,route:Ne}=dp(u);F=!0,O=Se,D={[Ne.id]:de}}else if(O&&!t.hydrationData&&ka(O,u,t.history.location.pathname).active&&(O=null),O)if(O.some(de=>de.route.lazy))F=!1;else if(!O.some(de=>t2(de.route)))F=!0;else{let de=t.hydrationData?t.hydrationData.loaderData:null,Se=t.hydrationData?t.hydrationData.errors:null;if(Se){let Ne=O.findIndex(He=>Se[He.route.id]!==void 0);F=O.slice(0,Ne+1).every(He=>!W1(He.route,de,Se))}else F=O.every(Ne=>!W1(Ne.route,de,Se))}else{F=!1,O=[];let de=ka(null,u,t.history.location.pathname);de.active&&de.matches&&(T=!0,O=de.matches)}let Q,P={historyAction:t.history.action,location:t.history.location,matches:O,initialized:F,navigation:M0,restoreScrollPosition:t.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:t.hydrationData&&t.hydrationData.loaderData||{},actionData:t.hydrationData&&t.hydrationData.actionData||null,errors:t.hydrationData&&t.hydrationData.errors||D,fetchers:new Map,blockers:new Map},$="POP",B=null,ne=!1,I,z=!1,J=new Map,ae=null,me=!1,Z=!1,ce=new Set,oe=new Map,ge=0,he=-1,U=new Map,j=new Set,Y=new Map,K=new Map,ie=new Set,V=new Map,se,be=null;function xe(){if(y=t.history.listen(({action:de,location:Se,delta:Ne})=>{if(se){se(),se=void 0;return}Dr(V.size===0||Ne!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let He=Mn({currentLocation:P.location,nextLocation:Se,historyAction:de});if(He&&Ne!=null){let Xe=new Promise(ht=>{se=ht});t.history.go(Ne*-1),It(He,{state:"blocked",location:Se,proceed(){It(He,{state:"proceeding",proceed:void 0,reset:void 0,location:Se}),Xe.then(()=>t.history.go(Ne))},reset(){let ht=new Map(P.blockers);ht.set(He,Eh),Ue({blockers:ht})}}),B==null||B.resolve(),B=null;return}return qe(de,Se)}),n){kN(e,J);let de=()=>MN(e,J);e.addEventListener("pagehide",de),ae=()=>e.removeEventListener("pagehide",de)}return P.initialized||qe("POP",P.location,{initialHydration:!0}),Q}function Oe(){y&&y(),ae&&ae(),m.clear(),I&&I.abort(),P.fetchers.forEach((de,Se)=>lr(Se)),P.blockers.forEach((de,Se)=>Pt(Se))}function Me(de){return m.add(de),()=>m.delete(de)}function Ue(de,Se={}){de.matches&&(de.matches=de.matches.map(Xe=>{let ht=l[Xe.route.id],it=Xe.route;return it.element!==ht.element||it.errorElement!==ht.errorElement||it.hydrateFallbackElement!==ht.hydrateFallbackElement?{...Xe,route:ht}:Xe})),P={...P,...de};let Ne=[],He=[];P.fetchers.forEach((Xe,ht)=>{Xe.state==="idle"&&(ie.has(ht)?Ne.push(ht):He.push(ht))}),ie.forEach(Xe=>{!P.fetchers.has(Xe)&&!oe.has(Xe)&&Ne.push(Xe)}),[...m].forEach(Xe=>Xe(P,{deletedFetchers:Ne,newErrors:de.errors??null,viewTransitionOpts:Se.viewTransitionOpts,flushSync:Se.flushSync===!0})),Ne.forEach(Xe=>lr(Xe)),He.forEach(Xe=>P.fetchers.delete(Xe))}function Be(de,Se,{flushSync:Ne}={}){var Ct,st;let He=P.actionData!=null&&P.navigation.formMethod!=null&&ii(P.navigation.formMethod)&&P.navigation.state==="loading"&&((Ct=de.state)==null?void 0:Ct._isRedirect)!==!0,Xe;Se.actionData?Object.keys(Se.actionData).length>0?Xe=Se.actionData:Xe=null:He?Xe=P.actionData:Xe=null;let ht=Se.loaderData?E5(P.loaderData,Se.loaderData,Se.matches||[],Se.errors):P.loaderData,it=P.blockers;it.size>0&&(it=new Map(it),it.forEach((Ht,Zt)=>it.set(Zt,Eh)));let Qe=me?!1:Wr(de,Se.matches||P.matches),et=ne===!0||P.navigation.formMethod!=null&&ii(P.navigation.formMethod)&&((st=de.state)==null?void 0:st._isRedirect)!==!0;c&&(u=c,c=void 0),me||$==="POP"||($==="PUSH"?t.history.push(de,de.state):$==="REPLACE"&&t.history.replace(de,de.state));let rt;if($==="POP"){let Ht=J.get(P.location.pathname);Ht&&Ht.has(de.pathname)?rt={currentLocation:P.location,nextLocation:de}:J.has(de.pathname)&&(rt={currentLocation:de,nextLocation:P.location})}else if(z){let Ht=J.get(P.location.pathname);Ht?Ht.add(de.pathname):(Ht=new Set([de.pathname]),J.set(P.location.pathname,Ht)),rt={currentLocation:P.location,nextLocation:de}}Ue({...Se,actionData:Xe,loaderData:ht,historyAction:$,location:de,initialized:!0,navigation:M0,revalidation:"idle",restoreScrollPosition:Qe,preventScrollReset:et,blockers:it},{viewTransitionOpts:rt,flushSync:Ne===!0}),$="POP",ne=!1,z=!1,me=!1,Z=!1,B==null||B.resolve(),B=null,be==null||be.resolve(),be=null}async function Ke(de,Se){if(B==null||B.resolve(),B=null,typeof de=="number"){B||(B=T5());let Zt=B.promise;return t.history.go(de),Zt}let Ne=G1(P.location,P.matches,h,de,Se==null?void 0:Se.fromRouteId,Se==null?void 0:Se.relative),{path:He,submission:Xe,error:ht}=m5(!1,Ne,Se),it=P.location,Qe=Vh(P.location,He,Se&&Se.state);Qe={...Qe,...t.history.encodeLocation(Qe)};let et=Se&&Se.replace!=null?Se.replace:void 0,rt="PUSH";et===!0?rt="REPLACE":et===!1||Xe!=null&&ii(Xe.formMethod)&&Xe.formAction===P.location.pathname+P.location.search&&(rt="REPLACE");let Ct=Se&&"preventScrollReset"in Se?Se.preventScrollReset===!0:void 0,st=(Se&&Se.flushSync)===!0,Ht=Mn({currentLocation:it,nextLocation:Qe,historyAction:rt});if(Ht){It(Ht,{state:"blocked",location:Qe,proceed(){It(Ht,{state:"proceeding",proceed:void 0,reset:void 0,location:Qe}),Ke(de,Se)},reset(){let Zt=new Map(P.blockers);Zt.set(Ht,Eh),Ue({blockers:Zt})}});return}await qe(rt,Qe,{submission:Xe,pendingError:ht,preventScrollReset:Ct,replace:Se&&Se.replace,enableViewTransition:Se&&Se.viewTransition,flushSync:st,callSiteDefaultShouldRevalidate:Se&&Se.unstable_defaultShouldRevalidate})}function ee(){be||(be=T5()),fn(),Ue({revalidation:"loading"});let de=be.promise;return P.navigation.state==="submitting"?de:P.navigation.state==="idle"?(qe(P.historyAction,P.location,{startUninterruptedRevalidation:!0}),de):(qe($||P.historyAction,P.navigation.location,{overrideNavigation:P.navigation,enableViewTransition:z===!0}),de)}async function qe(de,Se,Ne){I&&I.abort(),I=null,$=de,me=(Ne&&Ne.startUninterruptedRevalidation)===!0,si(P.location,P.matches),ne=(Ne&&Ne.preventScrollReset)===!0,z=(Ne&&Ne.enableViewTransition)===!0;let He=c||u,Xe=Ne&&Ne.overrideNavigation,ht=Ne!=null&&Ne.initialHydration&&P.matches&&P.matches.length>0&&!T?P.matches:uu(He,Se,h),it=(Ne&&Ne.flushSync)===!0;if(ht&&P.initialized&&!Z&&EN(P.location,Se)&&!(Ne&&Ne.submission&&ii(Ne.submission.formMethod))){Be(Se,{matches:ht},{flushSync:it});return}let Qe=ka(ht,He,Se.pathname);if(Qe.active&&Qe.matches&&(ht=Qe.matches),!ht){let{error:Kn,notFoundMatches:Jn,route:hn}=Qt(Se.pathname);Be(Se,{matches:Jn,loaderData:{},errors:{[hn.id]:Kn}},{flushSync:it});return}I=new AbortController;let et=df(t.history,Se,I.signal,Ne&&Ne.submission),rt=t.getContext?await t.getContext():new u5,Ct;if(Ne&&Ne.pendingError)Ct=[cu(ht).route.id,{type:"error",error:Ne.pendingError}];else if(Ne&&Ne.submission&&ii(Ne.submission.formMethod)){let Kn=await ct(et,Se,Ne.submission,ht,rt,Qe.active,Ne&&Ne.initialHydration===!0,{replace:Ne.replace,flushSync:it});if(Kn.shortCircuited)return;if(Kn.pendingActionResult){let[Jn,hn]=Kn.pendingActionResult;if(Qi(hn)&&Gh(hn.error)&&hn.error.status===404){I=null,Be(Se,{matches:Kn.matches,loaderData:{},errors:{[Jn]:hn.error}});return}}ht=Kn.matches||ht,Ct=Kn.pendingActionResult,Xe=P0(Se,Ne.submission),it=!1,Qe.active=!1,et=df(t.history,et.url,et.signal)}let{shortCircuited:st,matches:Ht,loaderData:Zt,errors:Bn}=await tt(et,Se,ht,rt,Qe.active,Xe,Ne&&Ne.submission,Ne&&Ne.fetcherSubmission,Ne&&Ne.replace,Ne&&Ne.initialHydration===!0,it,Ct,Ne&&Ne.callSiteDefaultShouldRevalidate);st||(I=null,Be(Se,{matches:Ht||ht,...A5(Ct),loaderData:Zt,errors:Bn}))}async function ct(de,Se,Ne,He,Xe,ht,it,Qe={}){fn();let et=RN(Se,Ne);if(Ue({navigation:et},{flushSync:Qe.flushSync===!0}),ht){let st=await ha(He,Se.pathname,de.signal);if(st.type==="aborted")return{shortCircuited:!0};if(st.type==="error"){if(st.partialMatches.length===0){let{matches:Zt,route:Bn}=dp(u);return{matches:Zt,pendingActionResult:[Bn.id,{type:"error",error:st.error}]}}let Ht=cu(st.partialMatches).route.id;return{matches:st.partialMatches,pendingActionResult:[Ht,{type:"error",error:st.error}]}}else if(st.matches)He=st.matches;else{let{notFoundMatches:Ht,error:Zt,route:Bn}=Qt(Se.pathname);return{matches:Ht,pendingActionResult:[Bn.id,{type:"error",error:Zt}]}}}let rt,Ct=Wp(He,Se);if(!Ct.route.action&&!Ct.route.lazy)rt={type:"error",error:Es(405,{method:de.method,pathname:Se.pathname,routeId:Ct.route.id})};else{let st=Sf(s,l,de,He,Ct,it?[]:r,Xe),Ht=await rn(de,st,Xe,null);if(rt=Ht[Ct.route.id],!rt){for(let Zt of He)if(Ht[Zt.route.id]){rt=Ht[Zt.route.id];break}}if(de.signal.aborted)return{shortCircuited:!0}}if(Ku(rt)){let st;return Qe&&Qe.replace!=null?st=Qe.replace:st=x5(rt.response.headers.get("Location"),new URL(de.url),h,t.history)===P.location.pathname+P.location.search,await Ft(de,rt,!0,{submission:Ne,replace:st}),{shortCircuited:!0}}if(Qi(rt)){let st=cu(He,Ct.route.id);return(Qe&&Qe.replace)!==!0&&($="PUSH"),{matches:He,pendingActionResult:[st.route.id,rt,Ct.route.id]}}return{matches:He,pendingActionResult:[Ct.route.id,rt]}}async function tt(de,Se,Ne,He,Xe,ht,it,Qe,et,rt,Ct,st,Ht){let Zt=ht||P0(Se,it),Bn=it||Qe||C5(Zt),Kn=!me&&!rt;if(Xe){if(Kn){let Pn=Ye(st);Ue({navigation:Zt,...Pn!==void 0?{actionData:Pn}:{}},{flushSync:Ct})}let gn=await ha(Ne,Se.pathname,de.signal);if(gn.type==="aborted")return{shortCircuited:!0};if(gn.type==="error"){if(gn.partialMatches.length===0){let{matches:Na,route:Kr}=dp(u);return{matches:Na,loaderData:{},errors:{[Kr.id]:gn.error}}}let Pn=cu(gn.partialMatches).route.id;return{matches:gn.partialMatches,loaderData:{},errors:{[Pn]:gn.error}}}else if(gn.matches)Ne=gn.matches;else{let{error:Pn,notFoundMatches:Na,route:Kr}=Qt(Se.pathname);return{matches:Na,loaderData:{},errors:{[Kr.id]:Pn}}}}let Jn=c||u,{dsMatches:hn,revalidatingFetchers:Mr}=g5(de,He,s,l,t.history,P,Ne,Bn,Se,rt?[]:r,rt===!0,Z,ce,ie,Y,j,Jn,h,t.patchRoutesOnNavigation!=null,st,Ht);if(he=++ge,!t.dataStrategy&&!hn.some(gn=>gn.shouldLoad)&&!hn.some(gn=>gn.route.middleware&&gn.route.middleware.length>0)&&Mr.length===0){let gn=pn();return Be(Se,{matches:Ne,loaderData:{},errors:st&&Qi(st[1])?{[st[0]]:st[1].error}:null,...A5(st),...gn?{fetchers:new Map(P.fetchers)}:{}},{flushSync:Ct}),{shortCircuited:!0}}if(Kn){let gn={};if(!Xe){gn.navigation=Zt;let Pn=Ye(st);Pn!==void 0&&(gn.actionData=Pn)}Mr.length>0&&(gn.fetchers=gt(Mr)),Ue(gn,{flushSync:Ct})}Mr.forEach(gn=>{bt(gn.key),gn.controller&&oe.set(gn.key,gn.controller)});let ra=()=>Mr.forEach(gn=>bt(gn.key));I&&I.signal.addEventListener("abort",ra);let{loaderResults:Xn,fetcherResults:Ka}=await Jt(hn,Mr,de,He);if(de.signal.aborted)return{shortCircuited:!0};I&&I.signal.removeEventListener("abort",ra),Mr.forEach(gn=>oe.delete(gn.key));let dr=pp(Xn);if(dr)return await Ft(de,dr.result,!0,{replace:et}),{shortCircuited:!0};if(dr=pp(Ka),dr)return j.add(dr.key),await Ft(de,dr.result,!0,{replace:et}),{shortCircuited:!0};let{loaderData:Ma,errors:Pa}=_5(P,Ne,Xn,st,Mr,Ka);rt&&P.errors&&(Pa={...P.errors,...Pa});let oi=pn(),is=Nt(he),ss=oi||is||Mr.length>0;return{matches:Ne,loaderData:Ma,errors:Pa,...ss?{fetchers:new Map(P.fetchers)}:{}}}function Ye(de){if(de&&!Qi(de[1]))return{[de[0]]:de[1].data};if(P.actionData)return Object.keys(P.actionData).length===0?null:P.actionData}function gt(de){return de.forEach(Se=>{let Ne=P.fetchers.get(Se.key),He=Ah(void 0,Ne?Ne.data:void 0);P.fetchers.set(Se.key,He)}),new Map(P.fetchers)}async function ot(de,Se,Ne,He){bt(de);let Xe=(He&&He.flushSync)===!0,ht=c||u,it=G1(P.location,P.matches,h,Ne,Se,He==null?void 0:He.relative),Qe=uu(ht,it,h),et=ka(Qe,ht,it);if(et.active&&et.matches&&(Qe=et.matches),!Qe){at(de,Se,Es(404,{pathname:it}),{flushSync:Xe});return}let{path:rt,submission:Ct,error:st}=m5(!0,it,He);if(st){at(de,Se,st,{flushSync:Xe});return}let Ht=t.getContext?await t.getContext():new u5,Zt=(He&&He.preventScrollReset)===!0;if(Ct&&ii(Ct.formMethod)){await Ot(de,Se,rt,Qe,Ht,et.active,Xe,Zt,Ct,He&&He.unstable_defaultShouldRevalidate);return}Y.set(de,{routeId:Se,path:rt}),await At(de,Se,rt,Qe,Ht,et.active,Xe,Zt,Ct)}async function Ot(de,Se,Ne,He,Xe,ht,it,Qe,et,rt){fn(),Y.delete(de);let Ct=P.fetchers.get(de);zt(de,DN(et,Ct),{flushSync:it});let st=new AbortController,Ht=df(t.history,Ne,st.signal,et);if(ht){let jt=await ha(He,new URL(Ht.url).pathname,Ht.signal,de);if(jt.type==="aborted")return;if(jt.type==="error"){at(de,Se,jt.error,{flushSync:it});return}else if(jt.matches)He=jt.matches;else{at(de,Se,Es(404,{pathname:Ne}),{flushSync:it});return}}let Zt=Wp(He,Ne);if(!Zt.route.action&&!Zt.route.lazy){let jt=Es(405,{method:et.formMethod,pathname:Ne,routeId:Se});at(de,Se,jt,{flushSync:it});return}oe.set(de,st);let Bn=ge,Kn=Sf(s,l,Ht,He,Zt,r,Xe),Jn=await rn(Ht,Kn,Xe,de),hn=Jn[Zt.route.id];if(!hn){for(let jt of Kn)if(Jn[jt.route.id]){hn=Jn[jt.route.id];break}}if(Ht.signal.aborted){oe.get(de)===st&&oe.delete(de);return}if(ie.has(de)){if(Ku(hn)||Qi(hn)){zt(de,hl(void 0));return}}else{if(Ku(hn))if(oe.delete(de),he>Bn){zt(de,hl(void 0));return}else return j.add(de),zt(de,Ah(et)),Ft(Ht,hn,!1,{fetcherSubmission:et,preventScrollReset:Qe});if(Qi(hn)){at(de,Se,hn.error);return}}let Mr=P.navigation.location||P.location,ra=df(t.history,Mr,st.signal),Xn=c||u,Ka=P.navigation.state!=="idle"?uu(Xn,P.navigation.location,h):P.matches;cn(Ka,"Didn't find any matches after fetcher action");let dr=++ge;U.set(de,dr);let Ma=Ah(et,hn.data);P.fetchers.set(de,Ma);let{dsMatches:Pa,revalidatingFetchers:oi}=g5(ra,Xe,s,l,t.history,P,Ka,et,Mr,r,!1,Z,ce,ie,Y,j,Xn,h,t.patchRoutesOnNavigation!=null,[Zt.route.id,hn],rt);oi.filter(jt=>jt.key!==de).forEach(jt=>{let os=jt.key,li=P.fetchers.get(os),ls=Ah(void 0,li?li.data:void 0);P.fetchers.set(os,ls),bt(os),jt.controller&&oe.set(os,jt.controller)}),Ue({fetchers:new Map(P.fetchers)});let is=()=>oi.forEach(jt=>bt(jt.key));st.signal.addEventListener("abort",is);let{loaderResults:ss,fetcherResults:gn}=await Jt(Pa,oi,ra,Xe);if(st.signal.aborted)return;if(st.signal.removeEventListener("abort",is),U.delete(de),oe.delete(de),oi.forEach(jt=>oe.delete(jt.key)),P.fetchers.has(de)){let jt=hl(hn.data);P.fetchers.set(de,jt)}let Pn=pp(ss);if(Pn)return Ft(ra,Pn.result,!1,{preventScrollReset:Qe});if(Pn=pp(gn),Pn)return j.add(Pn.key),Ft(ra,Pn.result,!1,{preventScrollReset:Qe});let{loaderData:Na,errors:Kr}=_5(P,Ka,ss,void 0,oi,gn);Nt(dr),P.navigation.state==="loading"&&dr>he?(cn($,"Expected pending action"),I&&I.abort(),Be(P.navigation.location,{matches:Ka,loaderData:Na,errors:Kr,fetchers:new Map(P.fetchers)})):(Ue({errors:Kr,loaderData:E5(P.loaderData,Na,Ka,Kr),fetchers:new Map(P.fetchers)}),Z=!1)}async function At(de,Se,Ne,He,Xe,ht,it,Qe,et){let rt=P.fetchers.get(de);zt(de,Ah(et,rt?rt.data:void 0),{flushSync:it});let Ct=new AbortController,st=df(t.history,Ne,Ct.signal);if(ht){let hn=await ha(He,new URL(st.url).pathname,st.signal,de);if(hn.type==="aborted")return;if(hn.type==="error"){at(de,Se,hn.error,{flushSync:it});return}else if(hn.matches)He=hn.matches;else{at(de,Se,Es(404,{pathname:Ne}),{flushSync:it});return}}let Ht=Wp(He,Ne);oe.set(de,Ct);let Zt=ge,Bn=Sf(s,l,st,He,Ht,r,Xe),Jn=(await rn(st,Bn,Xe,de))[Ht.route.id];if(oe.get(de)===Ct&&oe.delete(de),!st.signal.aborted){if(ie.has(de)){zt(de,hl(void 0));return}if(Ku(Jn))if(he>Zt){zt(de,hl(void 0));return}else{j.add(de),await Ft(st,Jn,!1,{preventScrollReset:Qe});return}if(Qi(Jn)){at(de,Se,Jn.error);return}zt(de,hl(Jn.data))}}async function Ft(de,Se,Ne,{submission:He,fetcherSubmission:Xe,preventScrollReset:ht,replace:it}={}){Ne||(B==null||B.resolve(),B=null),Se.response.headers.has("X-Remix-Revalidate")&&(Z=!0);let Qe=Se.response.headers.get("Location");cn(Qe,"Expected a Location header on the redirect Response"),Qe=x5(Qe,new URL(de.url),h,t.history);let et=Vh(P.location,Qe,{_isRedirect:!0});if(n){let Bn=!1;if(Se.response.headers.has("X-Remix-Reload-Document"))Bn=!0;else if($m(Qe)){const Kn=m_(Qe,!0);Bn=Kn.origin!==e.location.origin||As(Kn.pathname,h)==null}if(Bn){it?e.location.replace(Qe):e.location.assign(Qe);return}}I=null;let rt=it===!0||Se.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:Ct,formAction:st,formEncType:Ht}=P.navigation;!He&&!Xe&&Ct&&st&&Ht&&(He=C5(P.navigation));let Zt=He||Xe;if(lN.has(Se.response.status)&&Zt&&ii(Zt.formMethod))await qe(rt,et,{submission:{...Zt,formAction:Qe},preventScrollReset:ht||ne,enableViewTransition:Ne?z:void 0});else{let Bn=P0(et,He);await qe(rt,et,{overrideNavigation:Bn,fetcherSubmission:Xe,preventScrollReset:ht||ne,enableViewTransition:Ne?z:void 0})}}async function rn(de,Se,Ne,He){var it;let Xe,ht={};try{Xe=await yN(d,de,Se,He,Ne,!1)}catch(Qe){return Se.filter(et=>et.shouldLoad).forEach(et=>{ht[et.route.id]={type:"error",error:Qe}}),ht}if(de.signal.aborted)return ht;if(!ii(de.method))for(let Qe of Se){if(((it=Xe[Qe.route.id])==null?void 0:it.type)==="error")break;!Xe.hasOwnProperty(Qe.route.id)&&!P.loaderData.hasOwnProperty(Qe.route.id)&&(!P.errors||!P.errors.hasOwnProperty(Qe.route.id))&&Qe.shouldCallHandler()&&(Xe[Qe.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${Qe.route.id}`)})}for(let[Qe,et]of Object.entries(Xe))if(TN(et)){let rt=et.result;ht[Qe]={type:"redirect",response:SN(rt,de,Qe,Se,h)}}else ht[Qe]=await xN(et);return ht}async function Jt(de,Se,Ne,He){let Xe=rn(Ne,de,He,null),ht=Promise.all(Se.map(async et=>{if(et.matches&&et.match&&et.request&&et.controller){let Ct=(await rn(et.request,et.matches,He,et.key))[et.match.route.id];return{[et.key]:Ct}}else return Promise.resolve({[et.key]:{type:"error",error:Es(404,{pathname:et.path})}})})),it=await Xe,Qe=(await ht).reduce((et,rt)=>Object.assign(et,rt),{});return{loaderResults:it,fetcherResults:Qe}}function fn(){Z=!0,Y.forEach((de,Se)=>{oe.has(Se)&&ce.add(Se),bt(Se)})}function zt(de,Se,Ne={}){P.fetchers.set(de,Se),Ue({fetchers:new Map(P.fetchers)},{flushSync:(Ne&&Ne.flushSync)===!0})}function at(de,Se,Ne,He={}){let Xe=cu(P.matches,Se);lr(de),Ue({errors:{[Xe.route.id]:Ne},fetchers:new Map(P.fetchers)},{flushSync:(He&&He.flushSync)===!0})}function Xt(de){return K.set(de,(K.get(de)||0)+1),ie.has(de)&&ie.delete(de),P.fetchers.get(de)||uN}function wt(de,Se){bt(de,Se==null?void 0:Se.reason),zt(de,hl(null))}function lr(de){let Se=P.fetchers.get(de);oe.has(de)&&!(Se&&Se.state==="loading"&&U.has(de))&&bt(de),Y.delete(de),U.delete(de),j.delete(de),ie.delete(de),ce.delete(de),P.fetchers.delete(de)}function dn(de){let Se=(K.get(de)||0)-1;Se<=0?(K.delete(de),ie.add(de)):K.set(de,Se),Ue({fetchers:new Map(P.fetchers)})}function bt(de,Se){let Ne=oe.get(de);Ne&&(Ne.abort(Se),oe.delete(de))}function qt(de){for(let Se of de){let Ne=Xt(Se),He=hl(Ne.data);P.fetchers.set(Se,He)}}function pn(){let de=[],Se=!1;for(let Ne of j){let He=P.fetchers.get(Ne);cn(He,`Expected fetcher: ${Ne}`),He.state==="loading"&&(j.delete(Ne),de.push(Ne),Se=!0)}return qt(de),Se}function Nt(de){let Se=[];for(let[Ne,He]of U)if(He<de){let Xe=P.fetchers.get(Ne);cn(Xe,`Expected fetcher: ${Ne}`),Xe.state==="loading"&&(bt(Ne),U.delete(Ne),Se.push(Ne))}return qt(Se),Se.length>0}function Gn(de,Se){let Ne=P.blockers.get(de)||Eh;return V.get(de)!==Se&&V.set(de,Se),Ne}function Pt(de){P.blockers.delete(de),V.delete(de)}function It(de,Se){let Ne=P.blockers.get(de)||Eh;cn(Ne.state==="unblocked"&&Se.state==="blocked"||Ne.state==="blocked"&&Se.state==="blocked"||Ne.state==="blocked"&&Se.state==="proceeding"||Ne.state==="blocked"&&Se.state==="unblocked"||Ne.state==="proceeding"&&Se.state==="unblocked",`Invalid blocker state transition: ${Ne.state} -> ${Se.state}`);let He=new Map(P.blockers);He.set(de,Se),Ue({blockers:He})}function Mn({currentLocation:de,nextLocation:Se,historyAction:Ne}){if(V.size===0)return;V.size>1&&Dr(!1,"A router only supports one blocker at a time");let He=Array.from(V.entries()),[Xe,ht]=He[He.length-1],it=P.blockers.get(Xe);if(!(it&&it.state==="proceeding")&&ht({currentLocation:de,nextLocation:Se,historyAction:Ne}))return Xe}function Qt(de){let Se=Es(404,{pathname:de}),Ne=c||u,{matches:He,route:Xe}=dp(Ne);return{notFoundMatches:He,route:Xe,error:Se}}function _t(de,Se,Ne){if(x=de,A=Se,E=Ne||null,!N&&P.navigation===M0){N=!0;let He=Wr(P.location,P.matches);He!=null&&Ue({restoreScrollPosition:He})}return()=>{x=null,A=null,E=null}}function bn(de,Se){return E&&E(de,Se.map(He=>MA(He,P.loaderData)))||de.key}function si(de,Se){if(x&&A){let Ne=bn(de,Se);x[Ne]=A()}}function Wr(de,Se){if(x){let Ne=bn(de,Se),He=x[Ne];if(typeof He=="number")return He}return null}function ka(de,Se,Ne){if(t.patchRoutesOnNavigation)if(de){if(Object.keys(de[0].params).length>0)return{active:!0,matches:kh(Se,Ne,h,!0)}}else return{active:!0,matches:kh(Se,Ne,h,!0)||[]};return{active:!1,matches:null}}async function ha(de,Se,Ne,He){if(!t.patchRoutesOnNavigation)return{type:"success",matches:de};let Xe=de;for(;;){let ht=c==null,it=c||u,Qe=l;try{await t.patchRoutesOnNavigation({signal:Ne,path:Se,matches:Xe,fetcherKey:He,patch:(Ct,st)=>{Ne.aborted||v5(Ct,st,it,Qe,s,!1)}})}catch(Ct){return{type:"error",error:Ct,partialMatches:Xe}}finally{ht&&!Ne.aborted&&(u=[...u])}if(Ne.aborted)return{type:"aborted"};let et=uu(it,Se,h),rt=null;if(et){if(Object.keys(et[0].params).length===0)return{type:"success",matches:et};if(rt=kh(it,Se,h,!0),!(rt&&Xe.length<rt.length&&Et(Xe,rt.slice(0,Xe.length))))return{type:"success",matches:et}}if(rt||(rt=kh(it,Se,h,!0)),!rt||Et(Xe,rt))return{type:"success",matches:null};Xe=rt}}function Et(de,Se){return de.length===Se.length&&de.every((Ne,He)=>Ne.route.id===Se[He].route.id)}function Ui(de){l={},c=Yh(de,s,void 0,l)}function vi(de,Se,Ne=!1){let He=c==null;v5(de,Se,c||u,l,s,Ne),He&&(u=[...u],Ue({}))}return Q={get basename(){return h},get future(){return g},get state(){return P},get routes(){return u},get window(){return e},initialize:xe,subscribe:Me,enableScrollRestoration:_t,navigate:Ke,fetch:ot,revalidate:ee,createHref:de=>t.history.createHref(de),encodeLocation:de=>t.history.encodeLocation(de),getFetcher:Xt,resetFetcher:wt,deleteFetcher:dn,dispose:Oe,getBlocker:Gn,deleteBlocker:Pt,patchRoutes:vi,_internalFetchControllers:oe,_internalSetRoutes:Ui,_internalSetStateDoNotUseOrYouWillBreakYourApp(de){Ue(de)}},t.unstable_instrumentations&&(Q=eN(Q,t.unstable_instrumentations.map(de=>de.router).filter(Boolean))),Q}function hN(t){return t!=null&&("formData"in t&&t.formData!=null||"body"in t&&t.body!==void 0)}function G1(t,e,n,r,a,s){let l,u;if(a){l=[];for(let h of e)if(l.push(h),h.route.id===a){u=h;break}}else l=e,u=e[e.length-1];let c=qm(r||".",zm(l),As(t.pathname,n)||t.pathname,s==="path");if(r==null&&(c.search=t.search,c.hash=t.hash),(r==null||r===""||r===".")&&u){let h=r2(c.search);if(u.route.index&&!h)c.search=c.search?c.search.replace(/^\?/,"?index&"):"?index";else if(!u.route.index&&h){let d=new URLSearchParams(c.search),g=d.getAll("index");d.delete("index"),g.filter(m=>m).forEach(m=>d.append("index",m));let y=d.toString();c.search=y?`?${y}`:""}}return n!=="/"&&(c.pathname=WA({basename:n,pathname:c.pathname})),ko(c)}function m5(t,e,n){if(!n||!hN(n))return{path:e};if(n.formMethod&&!jN(n.formMethod))return{path:e,error:Es(405,{method:n.formMethod})};let r=()=>({path:e,error:Es(400,{type:"invalid-body"})}),s=(n.formMethod||"get").toUpperCase(),l=R_(e);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!ii(s))return r();let g=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((y,[m,x])=>`${y}${m}=${x}
59
- `,""):String(n.body);return{path:e,submission:{formMethod:s,formAction:l,formEncType:n.formEncType,formData:void 0,json:void 0,text:g}}}else if(n.formEncType==="application/json"){if(!ii(s))return r();try{let g=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:e,submission:{formMethod:s,formAction:l,formEncType:n.formEncType,formData:void 0,json:g,text:void 0}}}catch{return r()}}}cn(typeof FormData=="function","FormData is not available in this environment");let u,c;if(n.formData)u=J1(n.formData),c=n.formData;else if(n.body instanceof FormData)u=J1(n.body),c=n.body;else if(n.body instanceof URLSearchParams)u=n.body,c=S5(u);else if(n.body==null)u=new URLSearchParams,c=new FormData;else try{u=new URLSearchParams(n.body),c=S5(u)}catch{return r()}let h={formMethod:s,formAction:l,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:c,json:void 0,text:void 0};if(ii(h.formMethod))return{path:e,submission:h};let d=wl(e);return t&&d.search&&r2(d.search)&&u.append("index",""),d.search=`?${u}`,{path:ko(d),submission:h}}function g5(t,e,n,r,a,s,l,u,c,h,d,g,y,m,x,E,A,N,O,T,D){var me;let F=T?Qi(T[1])?T[1].error:T[1].data:void 0,Q=a.createURL(s.location),P=a.createURL(c),$;if(d&&s.errors){let Z=Object.keys(s.errors)[0];$=l.findIndex(ce=>ce.route.id===Z)}else if(T&&Qi(T[1])){let Z=T[0];$=l.findIndex(ce=>ce.route.id===Z)-1}let B=T?T[1].statusCode:void 0,ne=B&&B>=400,I={currentUrl:Q,currentParams:((me=s.matches[0])==null?void 0:me.params)||{},nextUrl:P,nextParams:l[0].params,...u,actionResult:F,actionStatus:B},z=ld(l),J=l.map((Z,ce)=>{let{route:oe}=Z,ge=null;if($!=null&&ce>$?ge=!1:oe.lazy?ge=!0:t2(oe)?d?ge=W1(oe,s.loaderData,s.errors):dN(s.loaderData,s.matches[ce],Z)&&(ge=!0):ge=!1,ge!==null)return K1(n,r,t,z,Z,h,e,ge);let he=!1;typeof D=="boolean"?he=D:ne?he=!1:(g||Q.pathname+Q.search===P.pathname+P.search||Q.search!==P.search||pN(s.matches[ce],Z))&&(he=!0);let U={...I,defaultShouldRevalidate:he},j=Ih(Z,U);return K1(n,r,t,z,Z,h,e,j,U,D)}),ae=[];return x.forEach((Z,ce)=>{if(d||!l.some(ie=>ie.route.id===Z.routeId)||m.has(ce))return;let oe=s.fetchers.get(ce),ge=oe&&oe.state!=="idle"&&oe.data===void 0,he=uu(A,Z.path,N);if(!he){if(O&&ge)return;ae.push({key:ce,routeId:Z.routeId,path:Z.path,matches:null,match:null,request:null,controller:null});return}if(E.has(ce))return;let U=Wp(he,Z.path),j=new AbortController,Y=df(a,Z.path,j.signal),K=null;if(y.has(ce))y.delete(ce),K=Sf(n,r,Y,he,U,h,e);else if(ge)g&&(K=Sf(n,r,Y,he,U,h,e));else{let ie;typeof D=="boolean"?ie=D:ne?ie=!1:ie=g;let V={...I,defaultShouldRevalidate:ie};Ih(U,V)&&(K=Sf(n,r,Y,he,U,h,e,V))}K&&ae.push({key:ce,routeId:Z.routeId,path:Z.path,matches:K,match:U,request:Y,controller:j})}),{dsMatches:J,revalidatingFetchers:ae}}function t2(t){return t.loader!=null||t.middleware!=null&&t.middleware.length>0}function W1(t,e,n){if(t.lazy)return!0;if(!t2(t))return!1;let r=e!=null&&t.id in e,a=n!=null&&n[t.id]!==void 0;return!r&&a?!1:typeof t.loader=="function"&&t.loader.hydrate===!0?!0:!r&&!a}function dN(t,e,n){let r=!e||n.route.id!==e.route.id,a=!t.hasOwnProperty(n.route.id);return r||a}function pN(t,e){let n=t.route.path;return t.pathname!==e.pathname||n!=null&&n.endsWith("*")&&t.params["*"]!==e.params["*"]}function Ih(t,e){if(t.route.shouldRevalidate){let n=t.route.shouldRevalidate(e);if(typeof n=="boolean")return n}return e.defaultShouldRevalidate}function v5(t,e,n,r,a,s){let l;if(t){let h=r[t];cn(h,`No route found to patch children into: routeId = ${t}`),h.children||(h.children=[]),l=h.children}else l=n;let u=[],c=[];if(e.forEach(h=>{let d=l.find(g=>C_(h,g));d?c.push({existingRoute:d,newRoute:h}):u.push(h)}),u.length>0){let h=Yh(u,a,[t||"_","patch",String((l==null?void 0:l.length)||"0")],r);l.push(...h)}if(s&&c.length>0)for(let h=0;h<c.length;h++){let{existingRoute:d,newRoute:g}=c[h],y=d,[m]=Yh([g],a,[],{},!0);Object.assign(y,{element:m.element?m.element:y.element,errorElement:m.errorElement?m.errorElement:y.errorElement,hydrateFallbackElement:m.hydrateFallbackElement?m.hydrateFallbackElement:y.hydrateFallbackElement})}}function C_(t,e){return"id"in t&&"id"in e&&t.id===e.id?!0:t.index===e.index&&t.path===e.path&&t.caseSensitive===e.caseSensitive?(!t.children||t.children.length===0)&&(!e.children||e.children.length===0)?!0:t.children.every((n,r)=>{var a;return(a=e.children)==null?void 0:a.some(s=>C_(n,s))}):!1}var y5=new WeakMap,T_=({key:t,route:e,manifest:n,mapRouteProperties:r})=>{let a=n[e.id];if(cn(a,"No route found in manifest"),!a.lazy||typeof a.lazy!="object")return;let s=a.lazy[t];if(!s)return;let l=y5.get(a);l||(l={},y5.set(a,l));let u=l[t];if(u)return u;let c=(async()=>{let h=jA(t),g=a[t]!==void 0&&t!=="hasErrorBoundary";if(h)Dr(!h,"Route property "+t+" is not a supported lazy route property. This property will be ignored."),l[t]=Promise.resolve();else if(g)Dr(!1,`Route "${a.id}" has a static property "${t}" defined. The lazy property will be ignored.`);else{let y=await s();y!=null&&(Object.assign(a,{[t]:y}),Object.assign(a,r(a)))}typeof a.lazy=="object"&&(a.lazy[t]=void 0,Object.values(a.lazy).every(y=>y===void 0)&&(a.lazy=void 0))})();return l[t]=c,c},b5=new WeakMap;function mN(t,e,n,r,a){let s=n[t.id];if(cn(s,"No route found in manifest"),!t.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof t.lazy=="function"){let d=b5.get(s);if(d)return{lazyRoutePromise:d,lazyHandlerPromise:d};let g=(async()=>{cn(typeof t.lazy=="function","No lazy route function found");let y=await t.lazy(),m={};for(let x in y){let E=y[x];if(E===void 0)continue;let A=DA(x),O=s[x]!==void 0&&x!=="hasErrorBoundary";A?Dr(!A,"Route property "+x+" is not a supported property to be returned from a lazy route function. This property will be ignored."):O?Dr(!O,`Route "${s.id}" has a static property "${x}" defined but its lazy function is also returning a value for this property. The lazy route property "${x}" will be ignored.`):m[x]=E}Object.assign(s,m),Object.assign(s,{...r(s),lazy:void 0})})();return b5.set(s,g),g.catch(()=>{}),{lazyRoutePromise:g,lazyHandlerPromise:g}}let l=Object.keys(t.lazy),u=[],c;for(let d of l){if(a&&a.includes(d))continue;let g=T_({key:d,route:t,manifest:n,mapRouteProperties:r});g&&(u.push(g),d===e&&(c=g))}let h=u.length>0?Promise.all(u).then(()=>{}):void 0;return h==null||h.catch(()=>{}),c==null||c.catch(()=>{}),{lazyRoutePromise:h,lazyHandlerPromise:c}}async function w5(t){let e=t.matches.filter(a=>a.shouldLoad),n={};return(await Promise.all(e.map(a=>a.resolve()))).forEach((a,s)=>{n[e[s].route.id]=a}),n}async function gN(t){return t.matches.some(e=>e.route.middleware)?L_(t,()=>w5(t)):w5(t)}function L_(t,e){return vN(t,e,r=>{if(ON(r))throw r;return r},NN,n);function n(r,a,s){if(s)return Promise.resolve(Object.assign(s.value,{[a]:{type:"error",result:r}}));{let{matches:l}=t,u=Math.min(Math.max(l.findIndex(h=>h.route.id===a),0),Math.max(l.findIndex(h=>h.shouldCallHandler()),0)),c=cu(l,l[u].route.id).route.id;return Promise.resolve({[c]:{type:"error",result:r}})}}}async function vN(t,e,n,r,a){let{matches:s,request:l,params:u,context:c,unstable_pattern:h}=t,d=s.flatMap(y=>y.route.middleware?y.route.middleware.map(m=>[y.route.id,m]):[]);return await O_({request:l,params:u,context:c,unstable_pattern:h},d,e,n,r,a)}async function O_(t,e,n,r,a,s,l=0){let{request:u}=t;if(u.signal.aborted)throw u.signal.reason??new Error(`Request aborted: ${u.method} ${u.url}`);let c=e[l];if(!c)return await n();let[h,d]=c,g,y=async()=>{if(g)throw new Error("You may only call `next()` once per middleware");try{return g={value:await O_(t,e,n,r,a,s,l+1)},g.value}catch(m){return g={value:await s(m,h,g)},g.value}};try{let m=await d(t,y),x=m!=null?r(m):void 0;return a(x)?x:g?x??g.value:(g={value:await y()},g.value)}catch(m){return await s(m,h,g)}}function j_(t,e,n,r,a){let s=T_({key:"middleware",route:r.route,manifest:e,mapRouteProperties:t}),l=mN(r.route,ii(n.method)?"action":"loader",e,t,a);return{middleware:s,route:l.lazyRoutePromise,handler:l.lazyHandlerPromise}}function K1(t,e,n,r,a,s,l,u,c=null,h){let d=!1,g=j_(t,e,n,a,s);return{...a,_lazyPromises:g,shouldLoad:u,shouldRevalidateArgs:c,shouldCallHandler(y){return d=!0,c?typeof h=="boolean"?Ih(a,{...c,defaultShouldRevalidate:h}):typeof y=="boolean"?Ih(a,{...c,defaultShouldRevalidate:y}):Ih(a,c):u},resolve(y){let{lazy:m,loader:x,middleware:E}=a.route,A=d||u||y&&!ii(n.method)&&(m||x),N=E&&E.length>0&&!x&&!m;return A&&(ii(n.method)||!N)?bN({request:n,unstable_pattern:r,match:a,lazyHandlerPromise:g==null?void 0:g.handler,lazyRoutePromise:g==null?void 0:g.route,handlerOverride:y,scopedContext:l}):Promise.resolve({type:"data",result:void 0})}}}function Sf(t,e,n,r,a,s,l,u=null){return r.map(c=>c.route.id!==a.route.id?{...c,shouldLoad:!1,shouldRevalidateArgs:u,shouldCallHandler:()=>!1,_lazyPromises:j_(t,e,n,c,s),resolve:()=>Promise.resolve({type:"data",result:void 0})}:K1(t,e,n,ld(r),c,s,l,!0,u))}async function yN(t,e,n,r,a,s){n.some(h=>{var d;return(d=h._lazyPromises)==null?void 0:d.middleware})&&await Promise.all(n.map(h=>{var d;return(d=h._lazyPromises)==null?void 0:d.middleware}));let l={request:e,unstable_pattern:ld(n),params:n[0].params,context:a,matches:n},c=await t({...l,fetcherKey:r,runClientMiddleware:h=>{let d=l;return L_(d,()=>h({...d,fetcherKey:r,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(n.flatMap(h=>{var d,g;return[(d=h._lazyPromises)==null?void 0:d.handler,(g=h._lazyPromises)==null?void 0:g.route]}))}catch{}return c}async function bN({request:t,unstable_pattern:e,match:n,lazyHandlerPromise:r,lazyRoutePromise:a,handlerOverride:s,scopedContext:l}){let u,c,h=ii(t.method),d=h?"action":"loader",g=y=>{let m,x=new Promise((N,O)=>m=O);c=()=>m(),t.signal.addEventListener("abort",c);let E=N=>typeof y!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${d}" [routeId: ${n.route.id}]`)):y({request:t,unstable_pattern:e,params:n.params,context:l},...N!==void 0?[N]:[]),A=(async()=>{try{return{type:"data",result:await(s?s(O=>E(O)):E())}}catch(N){return{type:"error",result:N}}})();return Promise.race([A,x])};try{let y=h?n.route.action:n.route.loader;if(r||a)if(y){let m,[x]=await Promise.all([g(y).catch(E=>{m=E}),r,a]);if(m!==void 0)throw m;u=x}else{await r;let m=h?n.route.action:n.route.loader;if(m)[u]=await Promise.all([g(m),a]);else if(d==="action"){let x=new URL(t.url),E=x.pathname+x.search;throw Es(405,{method:t.method,pathname:E,routeId:n.route.id})}else return{type:"data",result:void 0}}else if(y)u=await g(y);else{let m=new URL(t.url),x=m.pathname+m.search;throw Es(404,{pathname:x})}}catch(y){return{type:"error",result:y}}finally{c&&t.signal.removeEventListener("abort",c)}return u}async function wN(t){let e=t.headers.get("Content-Type");return e&&/\bapplication\/json\b/.test(e)?t.body==null?null:t.json():t.text()}async function xN(t){var r,a,s,l,u;let{result:e,type:n}=t;if(n2(e)){let c;try{c=await wN(e)}catch(h){return{type:"error",error:h}}return n==="error"?{type:"error",error:new od(e.status,e.statusText,c),statusCode:e.status,headers:e.headers}:{type:"data",data:c,statusCode:e.status,headers:e.headers}}return n==="error"?N5(e)?e.data instanceof Error?{type:"error",error:e.data,statusCode:(r=e.init)==null?void 0:r.status,headers:(a=e.init)!=null&&a.headers?new Headers(e.init.headers):void 0}:{type:"error",error:AN(e),statusCode:Gh(e)?e.status:void 0,headers:(s=e.init)!=null&&s.headers?new Headers(e.init.headers):void 0}:{type:"error",error:e,statusCode:Gh(e)?e.status:void 0}:N5(e)?{type:"data",data:e.data,statusCode:(l=e.init)==null?void 0:l.status,headers:(u=e.init)!=null&&u.headers?new Headers(e.init.headers):void 0}:{type:"data",data:e}}function SN(t,e,n,r,a){let s=t.headers.get("Location");if(cn(s,"Redirects returned/thrown from loaders/actions must have a Location header"),!$m(s)){let l=r.slice(0,r.findIndex(u=>u.route.id===n)+1);s=G1(new URL(e.url),l,a,s),t.headers.set("Location",s)}return t}function x5(t,e,n,r){let a=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if($m(t)){let s=t,l=s.startsWith("//")?new URL(e.protocol+s):new URL(s);if(a.includes(l.protocol))throw new Error("Invalid redirect location");let u=As(l.pathname,n)!=null;if(l.origin===e.origin&&u)return l.pathname+l.search+l.hash}try{let s=r.createURL(t);if(a.includes(s.protocol))throw new Error("Invalid redirect location")}catch{}return t}function df(t,e,n,r){let a=t.createURL(R_(e)).toString(),s={signal:n};if(r&&ii(r.formMethod)){let{formMethod:l,formEncType:u}=r;s.method=l.toUpperCase(),u==="application/json"?(s.headers=new Headers({"Content-Type":u}),s.body=JSON.stringify(r.json)):u==="text/plain"?s.body=r.text:u==="application/x-www-form-urlencoded"&&r.formData?s.body=J1(r.formData):s.body=r.formData}return new Request(a,s)}function J1(t){let e=new URLSearchParams;for(let[n,r]of t.entries())e.append(n,typeof r=="string"?r:r.name);return e}function S5(t){let e=new FormData;for(let[n,r]of t.entries())e.append(n,r);return e}function _N(t,e,n,r=!1,a=!1){let s={},l=null,u,c=!1,h={},d=n&&Qi(n[1])?n[1].error:void 0;return t.forEach(g=>{if(!(g.route.id in e))return;let y=g.route.id,m=e[y];if(cn(!Ku(m),"Cannot handle redirect results in processLoaderData"),Qi(m)){let x=m.error;if(d!==void 0&&(x=d,d=void 0),l=l||{},a)l[y]=x;else{let E=cu(t,y);l[E.route.id]==null&&(l[E.route.id]=x)}r||(s[y]=N_),c||(c=!0,u=Gh(m.error)?m.error.status:500),m.headers&&(h[y]=m.headers)}else s[y]=m.data,m.statusCode&&m.statusCode!==200&&!c&&(u=m.statusCode),m.headers&&(h[y]=m.headers)}),d!==void 0&&n&&(l={[n[0]]:d},n[2]&&(s[n[2]]=void 0)),{loaderData:s,errors:l,statusCode:u||200,loaderHeaders:h}}function _5(t,e,n,r,a,s){let{loaderData:l,errors:u}=_N(e,n,r);return a.filter(c=>!c.matches||c.matches.some(h=>h.shouldLoad)).forEach(c=>{let{key:h,match:d,controller:g}=c;if(g&&g.signal.aborted)return;let y=s[h];if(cn(y,"Did not find corresponding fetcher result"),Qi(y)){let m=cu(t.matches,d==null?void 0:d.route.id);u&&u[m.route.id]||(u={...u,[m.route.id]:y.error}),t.fetchers.delete(h)}else if(Ku(y))cn(!1,"Unhandled fetcher revalidation redirect");else{let m=hl(y.data);t.fetchers.set(h,m)}}),{loaderData:l,errors:u}}function E5(t,e,n,r){let a=Object.entries(e).filter(([,s])=>s!==N_).reduce((s,[l,u])=>(s[l]=u,s),{});for(let s of n){let l=s.route.id;if(!e.hasOwnProperty(l)&&t.hasOwnProperty(l)&&s.route.loader&&(a[l]=t[l]),r&&r.hasOwnProperty(l))break}return a}function A5(t){return t?Qi(t[1])?{actionData:{}}:{actionData:{[t[0]]:t[1].data}}:{}}function cu(t,e){return(e?t.slice(0,t.findIndex(r=>r.route.id===e)+1):[...t]).reverse().find(r=>r.route.hasErrorBoundary===!0)||t[0]}function dp(t){let e=t.length===1?t[0]:t.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:e}],route:e}}function Es(t,{pathname:e,routeId:n,method:r,type:a,message:s}={}){let l="Unknown Server Error",u="Unknown @remix-run/router error";return t===400?(l="Bad Request",r&&e&&n?u=`You made a ${r} request to "${e}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:a==="invalid-body"&&(u="Unable to encode submission body")):t===403?(l="Forbidden",u=`Route "${n}" does not match URL "${e}"`):t===404?(l="Not Found",u=`No route matches URL "${e}"`):t===405&&(l="Method Not Allowed",r&&e&&n?u=`You made a ${r.toUpperCase()} request to "${e}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:r&&(u=`Invalid request method "${r.toUpperCase()}"`)),new od(t||500,l,new Error(u),!0)}function pp(t){let e=Object.entries(t);for(let n=e.length-1;n>=0;n--){let[r,a]=e[n];if(Ku(a))return{key:r,result:a}}}function R_(t){let e=typeof t=="string"?wl(t):t;return ko({...e,hash:""})}function EN(t,e){return t.pathname!==e.pathname||t.search!==e.search?!1:t.hash===""?e.hash!=="":t.hash===e.hash?!0:e.hash!==""}function AN(t){var e,n;return new od(((e=t.init)==null?void 0:e.status)??500,((n=t.init)==null?void 0:n.statusText)??"Internal Server Error",t.data)}function NN(t){return t!=null&&typeof t=="object"&&Object.entries(t).every(([e,n])=>typeof e=="string"&&CN(n))}function CN(t){return t!=null&&typeof t=="object"&&"type"in t&&"result"in t&&(t.type==="data"||t.type==="error")}function TN(t){return n2(t.result)&&E_.has(t.result.status)}function Qi(t){return t.type==="error"}function Ku(t){return(t&&t.type)==="redirect"}function N5(t){return typeof t=="object"&&t!=null&&"type"in t&&"data"in t&&"init"in t&&t.type==="DataWithResponseInit"}function n2(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.headers=="object"&&typeof t.body<"u"}function LN(t){return E_.has(t)}function ON(t){return n2(t)&&LN(t.status)&&t.headers.has("Location")}function jN(t){return oN.has(t.toUpperCase())}function ii(t){return iN.has(t.toUpperCase())}function r2(t){return new URLSearchParams(t).getAll("index").some(e=>e==="")}function Wp(t,e){let n=typeof e=="string"?wl(e).search:e.search;if(t[t.length-1].route.index&&r2(n||""))return t[t.length-1];let r=b_(t);return r[r.length-1]}function C5(t){let{formMethod:e,formAction:n,formEncType:r,text:a,formData:s,json:l}=t;if(!(!e||!n||!r)){if(a!=null)return{formMethod:e,formAction:n,formEncType:r,formData:void 0,json:void 0,text:a};if(s!=null)return{formMethod:e,formAction:n,formEncType:r,formData:s,json:void 0,text:void 0};if(l!==void 0)return{formMethod:e,formAction:n,formEncType:r,formData:void 0,json:l,text:void 0}}}function P0(t,e){return e?{state:"loading",location:t,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text}:{state:"loading",location:t,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function RN(t,e){return{state:"submitting",location:t,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text}}function Ah(t,e){return t?{state:"loading",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:e}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function DN(t,e){return{state:"submitting",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:e?e.data:void 0}}function hl(t){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function kN(t,e){try{let n=t.sessionStorage.getItem(A_);if(n){let r=JSON.parse(n);for(let[a,s]of Object.entries(r||{}))s&&Array.isArray(s)&&e.set(a,new Set(s||[]))}}catch{}}function MN(t,e){if(e.size>0){let n={};for(let[r,a]of e)n[r]=[...a];try{t.sessionStorage.setItem(A_,JSON.stringify(n))}catch(r){Dr(!1,`Failed to save applied view transitions in sessionStorage (${r}).`)}}}function T5(){let t,e,n=new Promise((r,a)=>{t=async s=>{r(s);try{await n}catch{}},e=async s=>{a(s);try{await n}catch{}}});return{promise:n,resolve:t,reject:e}}var ic=k.createContext(null);ic.displayName="DataRouter";var ud=k.createContext(null);ud.displayName="DataRouterState";var D_=k.createContext(!1);function PN(){return k.useContext(D_)}var a2=k.createContext({isTransitioning:!1});a2.displayName="ViewTransition";var k_=k.createContext(new Map);k_.displayName="Fetchers";var IN=k.createContext(null);IN.displayName="Await";var as=k.createContext(null);as.displayName="Navigation";var cd=k.createContext(null);cd.displayName="Location";var Cs=k.createContext({outlet:null,matches:[],isDataRoute:!1});Cs.displayName="Route";var i2=k.createContext(null);i2.displayName="RouteError";var M_="REACT_ROUTER_ERROR",FN="REDIRECT",UN="ROUTE_ERROR_RESPONSE";function BN(t){if(t.startsWith(`${M_}:${FN}:{`))try{let e=JSON.parse(t.slice(28));if(typeof e=="object"&&e&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.location=="string"&&typeof e.reloadDocument=="boolean"&&typeof e.replace=="boolean")return e}catch{}}function $N(t){if(t.startsWith(`${M_}:${UN}:{`))try{let e=JSON.parse(t.slice(40));if(typeof e=="object"&&e&&typeof e.status=="number"&&typeof e.statusText=="string")return new od(e.status,e.statusText,e.data)}catch{}}function zN(t,{relative:e}={}){cn(Ff(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=k.useContext(as),{hash:a,pathname:s,search:l}=fd(t,{relative:e}),u=s;return n!=="/"&&(u=s==="/"?n:Ro([n,s])),r.createHref({pathname:u,search:l,hash:a})}function Ff(){return k.useContext(cd)!=null}function io(){return cn(Ff(),"useLocation() may be used only in the context of a <Router> component."),k.useContext(cd).location}var P_="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function I_(t){k.useContext(as).static||k.useLayoutEffect(t)}function Pi(){let{isDataRoute:t}=k.useContext(Cs);return t?rC():qN()}function qN(){cn(Ff(),"useNavigate() may be used only in the context of a <Router> component.");let t=k.useContext(ic),{basename:e,navigator:n}=k.useContext(as),{matches:r}=k.useContext(Cs),{pathname:a}=io(),s=JSON.stringify(zm(r)),l=k.useRef(!1);return I_(()=>{l.current=!0}),k.useCallback((c,h={})=>{if(Dr(l.current,P_),!l.current)return;if(typeof c=="number"){n.go(c);return}let d=qm(c,JSON.parse(s),a,h.relative==="path");t==null&&e!=="/"&&(d.pathname=d.pathname==="/"?e:Ro([e,d.pathname])),(h.replace?n.replace:n.push)(d,h.state,h)},[e,n,s,a,t])}var HN=k.createContext(null);function VN(t){let e=k.useContext(Cs).outlet;return k.useMemo(()=>e&&k.createElement(HN.Provider,{value:t},e),[e,t])}function xr(){let{matches:t}=k.useContext(Cs),e=t[t.length-1];return e?e.params:{}}function fd(t,{relative:e}={}){let{matches:n}=k.useContext(Cs),{pathname:r}=io(),a=JSON.stringify(zm(n));return k.useMemo(()=>qm(t,JSON.parse(a),r,e==="path"),[t,a,r,e])}function YN(t,e){return F_(t,e)}function F_(t,e,n,r,a){var O;cn(Ff(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:s}=k.useContext(as),{matches:l}=k.useContext(Cs),u=l[l.length-1],c=u?u.params:{},h=u?u.pathname:"/",d=u?u.pathnameBase:"/",g=u&&u.route;{let T=g&&g.path||"";B_(h,!g||T.endsWith("*")||T.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${h}" (under <Route path="${T}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
60
-
61
- Please change the parent <Route path="${T}"> to <Route path="${T==="/"?"*":`${T}/*`}">.`)}let y=io(),m;if(e){let T=typeof e=="string"?wl(e):e;cn(d==="/"||((O=T.pathname)==null?void 0:O.startsWith(d)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${d}" but pathname "${T.pathname}" was given in the \`location\` prop.`),m=T}else m=y;let x=m.pathname||"/",E=x;if(d!=="/"){let T=d.replace(/^\//,"").split("/");E="/"+x.replace(/^\//,"").split("/").slice(T.length).join("/")}let A=uu(t,{pathname:E});Dr(g||A!=null,`No routes matched location "${m.pathname}${m.search}${m.hash}" `),Dr(A==null||A[A.length-1].route.element!==void 0||A[A.length-1].route.Component!==void 0||A[A.length-1].route.lazy!==void 0,`Matched leaf route at location "${m.pathname}${m.search}${m.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let N=XN(A&&A.map(T=>Object.assign({},T,{params:Object.assign({},c,T.params),pathname:Ro([d,s.encodeLocation?s.encodeLocation(T.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:T.pathname]),pathnameBase:T.pathnameBase==="/"?d:Ro([d,s.encodeLocation?s.encodeLocation(T.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:T.pathnameBase])})),l,n,r,a);return e&&N?k.createElement(cd.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...m},navigationType:"POP"}},N):N}function GN(){let t=nC(),e=Gh(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,r="rgba(200,200,200, 0.5)",a={padding:"0.5rem",backgroundColor:r},s={padding:"2px 4px",backgroundColor:r},l=null;return console.error("Error handled by React Router default ErrorBoundary:",t),l=k.createElement(k.Fragment,null,k.createElement("p",null,"💿 Hey developer 👋"),k.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",k.createElement("code",{style:s},"ErrorBoundary")," or"," ",k.createElement("code",{style:s},"errorElement")," prop on your route.")),k.createElement(k.Fragment,null,k.createElement("h2",null,"Unexpected Application Error!"),k.createElement("h3",{style:{fontStyle:"italic"}},e),n?k.createElement("pre",{style:a},n):null,l)}var WN=k.createElement(GN,null),U_=class extends k.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,e){return e.location!==t.location||e.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:e.error,location:e.location,revalidation:t.revalidation||e.revalidation}}componentDidCatch(t,e){this.props.onError?this.props.onError(t,e):console.error("React Router caught the following error during render",t)}render(){let t=this.state.error;if(this.context&&typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){const n=$N(t.digest);n&&(t=n)}let e=t!==void 0?k.createElement(Cs.Provider,{value:this.props.routeContext},k.createElement(i2.Provider,{value:t,children:this.props.component})):this.props.children;return this.context?k.createElement(KN,{error:t},e):e}};U_.contextType=D_;var I0=new WeakMap;function KN({children:t,error:e}){let{basename:n}=k.useContext(as);if(typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){let r=BN(e.digest);if(r){let a=I0.get(e);if(a)throw a;let s=x_(r.location,n);if(w_&&!I0.get(e))if(s.isExternal||r.reloadDocument)window.location.href=s.absoluteURL||s.to;else{const l=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(s.to,{replace:r.replace}));throw I0.set(e,l),l}return k.createElement("meta",{httpEquiv:"refresh",content:`0;url=${s.absoluteURL||s.to}`})}}return t}function JN({routeContext:t,match:e,children:n}){let r=k.useContext(ic);return r&&r.static&&r.staticContext&&(e.route.errorElement||e.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=e.route.id),k.createElement(Cs.Provider,{value:t},n)}function XN(t,e=[],n=null,r=null,a=null){if(t==null){if(!n)return null;if(n.errors)t=n.matches;else if(e.length===0&&!n.initialized&&n.matches.length>0)t=n.matches;else return null}let s=t,l=n==null?void 0:n.errors;if(l!=null){let d=s.findIndex(g=>g.route.id&&(l==null?void 0:l[g.route.id])!==void 0);cn(d>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(l).join(",")}`),s=s.slice(0,Math.min(s.length,d+1))}let u=!1,c=-1;if(n)for(let d=0;d<s.length;d++){let g=s[d];if((g.route.HydrateFallback||g.route.hydrateFallbackElement)&&(c=d),g.route.id){let{loaderData:y,errors:m}=n,x=g.route.loader&&!y.hasOwnProperty(g.route.id)&&(!m||m[g.route.id]===void 0);if(g.route.lazy||x){u=!0,c>=0?s=s.slice(0,c+1):s=[s[0]];break}}}let h=n&&r?(d,g)=>{var y,m;r(d,{location:n.location,params:((m=(y=n.matches)==null?void 0:y[0])==null?void 0:m.params)??{},unstable_pattern:ld(n.matches),errorInfo:g})}:void 0;return s.reduceRight((d,g,y)=>{let m,x=!1,E=null,A=null;n&&(m=l&&g.route.id?l[g.route.id]:void 0,E=g.route.errorElement||WN,u&&(c<0&&y===0?(B_("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),x=!0,A=null):c===y&&(x=!0,A=g.route.hydrateFallbackElement||null)));let N=e.concat(s.slice(0,y+1)),O=()=>{let T;return m?T=E:x?T=A:g.route.Component?T=k.createElement(g.route.Component,null):g.route.element?T=g.route.element:T=d,k.createElement(JN,{match:g,routeContext:{outlet:d,matches:N,isDataRoute:n!=null},children:T})};return n&&(g.route.ErrorBoundary||g.route.errorElement||y===0)?k.createElement(U_,{location:n.location,revalidation:n.revalidation,component:E,error:m,children:O(),routeContext:{outlet:null,matches:N,isDataRoute:!0},onError:h}):O()},null)}function s2(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function ZN(t){let e=k.useContext(ic);return cn(e,s2(t)),e}function QN(t){let e=k.useContext(ud);return cn(e,s2(t)),e}function eC(t){let e=k.useContext(Cs);return cn(e,s2(t)),e}function o2(t){let e=eC(t),n=e.matches[e.matches.length-1];return cn(n.route.id,`${t} can only be used on routes that contain a unique "id"`),n.route.id}function tC(){return o2("useRouteId")}function nC(){var r;let t=k.useContext(i2),e=QN("useRouteError"),n=o2("useRouteError");return t!==void 0?t:(r=e.errors)==null?void 0:r[n]}function rC(){let{router:t}=ZN("useNavigate"),e=o2("useNavigate"),n=k.useRef(!1);return I_(()=>{n.current=!0}),k.useCallback(async(a,s={})=>{Dr(n.current,P_),n.current&&(typeof a=="number"?await t.navigate(a):await t.navigate(a,{fromRouteId:e,...s}))},[t,e])}var L5={};function B_(t,e,n){!e&&!L5[t]&&(L5[t]=!0,Dr(!1,n))}var O5={};function j5(t,e){!t&&!O5[e]&&(O5[e]=!0,console.warn(e))}var aC="useOptimistic",R5=Y1[aC],iC=()=>{};function sC(t){return R5?R5(t):[t,iC]}function oC(t){let e={hasErrorBoundary:t.hasErrorBoundary||t.ErrorBoundary!=null||t.errorElement!=null};return t.Component&&(t.element&&Dr(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(e,{element:k.createElement(t.Component),Component:void 0})),t.HydrateFallback&&(t.hydrateFallbackElement&&Dr(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(e,{hydrateFallbackElement:k.createElement(t.HydrateFallback),HydrateFallback:void 0})),t.ErrorBoundary&&(t.errorElement&&Dr(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(e,{errorElement:k.createElement(t.ErrorBoundary),ErrorBoundary:void 0})),e}var lC=["HydrateFallback","hydrateFallbackElement"],uC=class{constructor(){this.status="pending",this.promise=new Promise((e,n)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",e(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",n(r))}})}};function cC({router:t,flushSync:e,onError:n,unstable_useTransitions:r}){r=PN()||r;let[s,l]=k.useState(t.state),[u,c]=sC(s),[h,d]=k.useState(),[g,y]=k.useState({isTransitioning:!1}),[m,x]=k.useState(),[E,A]=k.useState(),[N,O]=k.useState(),T=k.useRef(new Map),D=k.useCallback(($,{deletedFetchers:B,newErrors:ne,flushSync:I,viewTransitionOpts:z})=>{ne&&n&&Object.values(ne).forEach(ae=>{var me;return n(ae,{location:$.location,params:((me=$.matches[0])==null?void 0:me.params)??{},unstable_pattern:ld($.matches)})}),$.fetchers.forEach((ae,me)=>{ae.data!==void 0&&T.current.set(me,ae.data)}),B.forEach(ae=>T.current.delete(ae)),j5(I===!1||e!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let J=t.window!=null&&t.window.document!=null&&typeof t.window.document.startViewTransition=="function";if(j5(z==null||J,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!z||!J){e&&I?e(()=>l($)):r===!1?l($):k.startTransition(()=>{r===!0&&c(ae=>D5(ae,$)),l($)});return}if(e&&I){e(()=>{E&&(m==null||m.resolve(),E.skipTransition()),y({isTransitioning:!0,flushSync:!0,currentLocation:z.currentLocation,nextLocation:z.nextLocation})});let ae=t.window.document.startViewTransition(()=>{e(()=>l($))});ae.finished.finally(()=>{e(()=>{x(void 0),A(void 0),d(void 0),y({isTransitioning:!1})})}),e(()=>A(ae));return}E?(m==null||m.resolve(),E.skipTransition(),O({state:$,currentLocation:z.currentLocation,nextLocation:z.nextLocation})):(d($),y({isTransitioning:!0,flushSync:!1,currentLocation:z.currentLocation,nextLocation:z.nextLocation}))},[t.window,e,E,m,r,c,n]);k.useLayoutEffect(()=>t.subscribe(D),[t,D]),k.useEffect(()=>{g.isTransitioning&&!g.flushSync&&x(new uC)},[g]),k.useEffect(()=>{if(m&&h&&t.window){let $=h,B=m.promise,ne=t.window.document.startViewTransition(async()=>{r===!1?l($):k.startTransition(()=>{r===!0&&c(I=>D5(I,$)),l($)}),await B});ne.finished.finally(()=>{x(void 0),A(void 0),d(void 0),y({isTransitioning:!1})}),A(ne)}},[h,m,t.window,r,c]),k.useEffect(()=>{m&&h&&u.location.key===h.location.key&&m.resolve()},[m,E,u.location,h]),k.useEffect(()=>{!g.isTransitioning&&N&&(d(N.state),y({isTransitioning:!0,flushSync:!1,currentLocation:N.currentLocation,nextLocation:N.nextLocation}),O(void 0))},[g.isTransitioning,N]);let F=k.useMemo(()=>({createHref:t.createHref,encodeLocation:t.encodeLocation,go:$=>t.navigate($),push:($,B,ne)=>t.navigate($,{state:B,preventScrollReset:ne==null?void 0:ne.preventScrollReset}),replace:($,B,ne)=>t.navigate($,{replace:!0,state:B,preventScrollReset:ne==null?void 0:ne.preventScrollReset})}),[t]),Q=t.basename||"/",P=k.useMemo(()=>({router:t,navigator:F,static:!1,basename:Q,onError:n}),[t,F,Q,n]);return k.createElement(k.Fragment,null,k.createElement(ic.Provider,{value:P},k.createElement(ud.Provider,{value:u},k.createElement(k_.Provider,{value:T.current},k.createElement(a2.Provider,{value:g},k.createElement(pC,{basename:Q,location:u.location,navigationType:u.historyAction,navigator:F,unstable_useTransitions:r},k.createElement(fC,{routes:t.routes,future:t.future,state:u,onError:n})))))),null)}function D5(t,e){return{...t,navigation:e.navigation.state!=="idle"?e.navigation:t.navigation,revalidation:e.revalidation!=="idle"?e.revalidation:t.revalidation,actionData:e.navigation.state!=="submitting"?e.actionData:t.actionData,fetchers:e.fetchers}}var fC=k.memo(hC);function hC({routes:t,future:e,state:n,onError:r}){return F_(t,void 0,n,r,e)}function mp({to:t,replace:e,state:n,relative:r}){cn(Ff(),"<Navigate> may be used only in the context of a <Router> component.");let{static:a}=k.useContext(as);Dr(!a,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:s}=k.useContext(Cs),{pathname:l}=io(),u=Pi(),c=qm(t,zm(s),l,r==="path"),h=JSON.stringify(c);return k.useEffect(()=>{u(JSON.parse(h),{replace:e,state:n,relative:r})},[u,h,r,e,n]),null}function dC(t){return VN(t.context)}function mi(t){cn(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function pC({basename:t="/",children:e=null,location:n,navigationType:r="POP",navigator:a,static:s=!1,unstable_useTransitions:l}){cn(!Ff(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let u=t.replace(/^\/*/,"/"),c=k.useMemo(()=>({basename:u,navigator:a,static:s,unstable_useTransitions:l,future:{}}),[u,a,s,l]);typeof n=="string"&&(n=wl(n));let{pathname:h="/",search:d="",hash:g="",state:y=null,key:m="default"}=n,x=k.useMemo(()=>{let E=As(h,u);return E==null?null:{location:{pathname:E,search:d,hash:g,state:y,key:m},navigationType:r}},[u,h,d,g,y,m,r]);return Dr(x!=null,`<Router basename="${u}"> is not able to match the URL "${h}${d}${g}" because it does not start with the basename, so the <Router> won't render anything.`),x==null?null:k.createElement(as.Provider,{value:c},k.createElement(cd.Provider,{children:e,value:x}))}function mC({children:t,location:e}){return YN(X1(t),e)}function X1(t,e=[]){let n=[];return k.Children.forEach(t,(r,a)=>{if(!k.isValidElement(r))return;let s=[...e,a];if(r.type===k.Fragment){n.push.apply(n,X1(r.props.children,s));return}cn(r.type===mi,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),cn(!r.props.index||!r.props.children,"An index route cannot have child routes.");let l={id:r.props.id||s.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(l.children=X1(r.props.children,s)),n.push(l)}),n}var Kp="get",Jp="application/x-www-form-urlencoded";function Hm(t){return typeof HTMLElement<"u"&&t instanceof HTMLElement}function gC(t){return Hm(t)&&t.tagName.toLowerCase()==="button"}function vC(t){return Hm(t)&&t.tagName.toLowerCase()==="form"}function yC(t){return Hm(t)&&t.tagName.toLowerCase()==="input"}function bC(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function wC(t,e){return t.button===0&&(!e||e==="_self")&&!bC(t)}function Z1(t=""){return new URLSearchParams(typeof t=="string"||Array.isArray(t)||t instanceof URLSearchParams?t:Object.keys(t).reduce((e,n)=>{let r=t[n];return e.concat(Array.isArray(r)?r.map(a=>[n,a]):[[n,r]])},[]))}function xC(t,e){let n=Z1(t);return e&&e.forEach((r,a)=>{n.has(a)||e.getAll(a).forEach(s=>{n.append(a,s)})}),n}var gp=null;function SC(){if(gp===null)try{new FormData(document.createElement("form"),0),gp=!1}catch{gp=!0}return gp}var _C=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function F0(t){return t!=null&&!_C.has(t)?(Dr(!1,`"${t}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Jp}"`),null):t}function EC(t,e){let n,r,a,s,l;if(vC(t)){let u=t.getAttribute("action");r=u?As(u,e):null,n=t.getAttribute("method")||Kp,a=F0(t.getAttribute("enctype"))||Jp,s=new FormData(t)}else if(gC(t)||yC(t)&&(t.type==="submit"||t.type==="image")){let u=t.form;if(u==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let c=t.getAttribute("formaction")||u.getAttribute("action");if(r=c?As(c,e):null,n=t.getAttribute("formmethod")||u.getAttribute("method")||Kp,a=F0(t.getAttribute("formenctype"))||F0(u.getAttribute("enctype"))||Jp,s=new FormData(u,t),!SC()){let{name:h,type:d,value:g}=t;if(d==="image"){let y=h?`${h}.`:"";s.append(`${y}x`,"0"),s.append(`${y}y`,"0")}else h&&s.append(h,g)}}else{if(Hm(t))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Kp,r=null,a=Jp,l=t}return s&&a==="text/plain"&&(l=s,s=void 0),{action:r,method:n.toLowerCase(),encType:a,formData:s,body:l}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function l2(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function AC(t,e,n,r){let a=typeof t=="string"?new URL(t,typeof window>"u"?"server://singlefetch/":window.location.origin):t;return n?a.pathname.endsWith("/")?a.pathname=`${a.pathname}_.${r}`:a.pathname=`${a.pathname}.${r}`:a.pathname==="/"?a.pathname=`_root.${r}`:e&&As(a.pathname,e)==="/"?a.pathname=`${e.replace(/\/$/,"")}/_root.${r}`:a.pathname=`${a.pathname.replace(/\/$/,"")}.${r}`,a}async function NC(t,e){if(t.id in e)return e[t.id];try{let n=await import(t.module);return e[t.id]=n,n}catch(n){return console.error(`Error loading route module \`${t.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function CC(t){return t==null?!1:t.href==null?t.rel==="preload"&&typeof t.imageSrcSet=="string"&&typeof t.imageSizes=="string":typeof t.rel=="string"&&typeof t.href=="string"}async function TC(t,e,n){let r=await Promise.all(t.map(async a=>{let s=e.routes[a.route.id];if(s){let l=await NC(s,n);return l.links?l.links():[]}return[]}));return RC(r.flat(1).filter(CC).filter(a=>a.rel==="stylesheet"||a.rel==="preload").map(a=>a.rel==="stylesheet"?{...a,rel:"prefetch",as:"style"}:{...a,rel:"prefetch"}))}function k5(t,e,n,r,a,s){let l=(c,h)=>n[h]?c.route.id!==n[h].route.id:!0,u=(c,h)=>{var d;return n[h].pathname!==c.pathname||((d=n[h].route.path)==null?void 0:d.endsWith("*"))&&n[h].params["*"]!==c.params["*"]};return s==="assets"?e.filter((c,h)=>l(c,h)||u(c,h)):s==="data"?e.filter((c,h)=>{var g;let d=r.routes[c.route.id];if(!d||!d.hasLoader)return!1;if(l(c,h)||u(c,h))return!0;if(c.route.shouldRevalidate){let y=c.route.shouldRevalidate({currentUrl:new URL(a.pathname+a.search+a.hash,window.origin),currentParams:((g=n[0])==null?void 0:g.params)||{},nextUrl:new URL(t,window.origin),nextParams:c.params,defaultShouldRevalidate:!0});if(typeof y=="boolean")return y}return!0}):[]}function LC(t,e,{includeHydrateFallback:n}={}){return OC(t.map(r=>{let a=e.routes[r.route.id];if(!a)return[];let s=[a.module];return a.clientActionModule&&(s=s.concat(a.clientActionModule)),a.clientLoaderModule&&(s=s.concat(a.clientLoaderModule)),n&&a.hydrateFallbackModule&&(s=s.concat(a.hydrateFallbackModule)),a.imports&&(s=s.concat(a.imports)),s}).flat(1))}function OC(t){return[...new Set(t)]}function jC(t){let e={},n=Object.keys(t).sort();for(let r of n)e[r]=t[r];return e}function RC(t,e){let n=new Set;return new Set(e),t.reduce((r,a)=>{let s=JSON.stringify(jC(a));return n.has(s)||(n.add(s),r.push({key:s,link:a})),r},[])}function $_(){let t=k.useContext(ic);return l2(t,"You must render this element inside a <DataRouterContext.Provider> element"),t}function DC(){let t=k.useContext(ud);return l2(t,"You must render this element inside a <DataRouterStateContext.Provider> element"),t}var u2=k.createContext(void 0);u2.displayName="FrameworkContext";function z_(){let t=k.useContext(u2);return l2(t,"You must render this element inside a <HydratedRouter> element"),t}function kC(t,e){let n=k.useContext(u2),[r,a]=k.useState(!1),[s,l]=k.useState(!1),{onFocus:u,onBlur:c,onMouseEnter:h,onMouseLeave:d,onTouchStart:g}=e,y=k.useRef(null);k.useEffect(()=>{if(t==="render"&&l(!0),t==="viewport"){let E=N=>{N.forEach(O=>{l(O.isIntersecting)})},A=new IntersectionObserver(E,{threshold:.5});return y.current&&A.observe(y.current),()=>{A.disconnect()}}},[t]),k.useEffect(()=>{if(r){let E=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(E)}}},[r]);let m=()=>{a(!0)},x=()=>{a(!1),l(!1)};return n?t!=="intent"?[s,y,{}]:[s,y,{onFocus:Nh(u,m),onBlur:Nh(c,x),onMouseEnter:Nh(h,m),onMouseLeave:Nh(d,x),onTouchStart:Nh(g,m)}]:[!1,y,{}]}function Nh(t,e){return n=>{t&&t(n),n.defaultPrevented||e(n)}}function MC({page:t,...e}){let{router:n}=$_(),r=k.useMemo(()=>uu(n.routes,t,n.basename),[n.routes,t,n.basename]);return r?k.createElement(IC,{page:t,matches:r,...e}):null}function PC(t){let{manifest:e,routeModules:n}=z_(),[r,a]=k.useState([]);return k.useEffect(()=>{let s=!1;return TC(t,e,n).then(l=>{s||a(l)}),()=>{s=!0}},[t,e,n]),r}function IC({page:t,matches:e,...n}){let r=io(),{future:a,manifest:s,routeModules:l}=z_(),{basename:u}=$_(),{loaderData:c,matches:h}=DC(),d=k.useMemo(()=>k5(t,e,h,s,r,"data"),[t,e,h,s,r]),g=k.useMemo(()=>k5(t,e,h,s,r,"assets"),[t,e,h,s,r]),y=k.useMemo(()=>{if(t===r.pathname+r.search+r.hash)return[];let E=new Set,A=!1;if(e.forEach(O=>{var D;let T=s.routes[O.route.id];!T||!T.hasLoader||(!d.some(F=>F.route.id===O.route.id)&&O.route.id in c&&((D=l[O.route.id])!=null&&D.shouldRevalidate)||T.hasClientLoader?A=!0:E.add(O.route.id))}),E.size===0)return[];let N=AC(t,u,a.unstable_trailingSlashAwareDataRequests,"data");return A&&E.size>0&&N.searchParams.set("_routes",e.filter(O=>E.has(O.route.id)).map(O=>O.route.id).join(",")),[N.pathname+N.search]},[u,a.unstable_trailingSlashAwareDataRequests,c,r,s,d,e,t,l]),m=k.useMemo(()=>LC(g,s),[g,s]),x=PC(g);return k.createElement(k.Fragment,null,y.map(E=>k.createElement("link",{key:E,rel:"prefetch",as:"fetch",href:E,...n})),m.map(E=>k.createElement("link",{key:E,rel:"modulepreload",href:E,...n})),x.map(({key:E,link:A})=>k.createElement("link",{key:E,nonce:n.nonce,...A})))}function FC(...t){return e=>{t.forEach(n=>{typeof n=="function"?n(e):n!=null&&(n.current=e)})}}var UC=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{UC&&(window.__reactRouterVersion="7.12.0")}catch{}function BC(t,e){return fN({basename:e==null?void 0:e.basename,getContext:e==null?void 0:e.getContext,future:e==null?void 0:e.future,history:CA({window:e==null?void 0:e.window}),hydrationData:$C(),routes:t,mapRouteProperties:oC,hydrationRouteProperties:lC,dataStrategy:e==null?void 0:e.dataStrategy,patchRoutesOnNavigation:e==null?void 0:e.patchRoutesOnNavigation,window:e==null?void 0:e.window,unstable_instrumentations:e==null?void 0:e.unstable_instrumentations}).initialize()}function $C(){let t=window==null?void 0:window.__staticRouterHydrationData;return t&&t.errors&&(t={...t,errors:zC(t.errors)}),t}function zC(t){if(!t)return null;let e=Object.entries(t),n={};for(let[r,a]of e)if(a&&a.__type==="RouteErrorResponse")n[r]=new od(a.status,a.statusText,a.data,a.internal===!0);else if(a&&a.__type==="Error"){if(a.__subType){let s=window[a.__subType];if(typeof s=="function")try{let l=new s(a.message);l.stack="",n[r]=l}catch{}}if(n[r]==null){let s=new Error(a.message);s.stack="",n[r]=s}}else n[r]=a;return n}var q_=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Vm=k.forwardRef(function({onClick:e,discover:n="render",prefetch:r="none",relative:a,reloadDocument:s,replace:l,state:u,target:c,to:h,preventScrollReset:d,viewTransition:g,unstable_defaultShouldRevalidate:y,...m},x){let{basename:E,unstable_useTransitions:A}=k.useContext(as),N=typeof h=="string"&&q_.test(h),O=x_(h,E);h=O.to;let T=zN(h,{relative:a}),[D,F,Q]=kC(r,m),P=YC(h,{replace:l,state:u,target:c,preventScrollReset:d,relative:a,viewTransition:g,unstable_defaultShouldRevalidate:y,unstable_useTransitions:A});function $(ne){e&&e(ne),ne.defaultPrevented||P(ne)}let B=k.createElement("a",{...m,...Q,href:O.absoluteURL||T,onClick:O.isExternal||s?e:$,ref:FC(x,F),target:c,"data-discover":!N&&n==="render"?"true":void 0});return D&&!N?k.createElement(k.Fragment,null,B,k.createElement(MC,{page:T})):B});Vm.displayName="Link";var qC=k.forwardRef(function({"aria-current":e="page",caseSensitive:n=!1,className:r="",end:a=!1,style:s,to:l,viewTransition:u,children:c,...h},d){let g=fd(l,{relative:h.relative}),y=io(),m=k.useContext(ud),{navigator:x,basename:E}=k.useContext(as),A=m!=null&&ZC(g)&&u===!0,N=x.encodeLocation?x.encodeLocation(g).pathname:g.pathname,O=y.pathname,T=m&&m.navigation&&m.navigation.location?m.navigation.location.pathname:null;n||(O=O.toLowerCase(),T=T?T.toLowerCase():null,N=N.toLowerCase()),T&&E&&(T=As(T,E)||T);const D=N!=="/"&&N.endsWith("/")?N.length-1:N.length;let F=O===N||!a&&O.startsWith(N)&&O.charAt(D)==="/",Q=T!=null&&(T===N||!a&&T.startsWith(N)&&T.charAt(N.length)==="/"),P={isActive:F,isPending:Q,isTransitioning:A},$=F?e:void 0,B;typeof r=="function"?B=r(P):B=[r,F?"active":null,Q?"pending":null,A?"transitioning":null].filter(Boolean).join(" ");let ne=typeof s=="function"?s(P):s;return k.createElement(Vm,{...h,"aria-current":$,className:B,ref:d,style:ne,to:l,viewTransition:u},typeof c=="function"?c(P):c)});qC.displayName="NavLink";var HC=k.forwardRef(({discover:t="render",fetcherKey:e,navigate:n,reloadDocument:r,replace:a,state:s,method:l=Kp,action:u,onSubmit:c,relative:h,preventScrollReset:d,viewTransition:g,unstable_defaultShouldRevalidate:y,...m},x)=>{let{unstable_useTransitions:E}=k.useContext(as),A=JC(),N=XC(u,{relative:h}),O=l.toLowerCase()==="get"?"get":"post",T=typeof u=="string"&&q_.test(u),D=F=>{if(c&&c(F),F.defaultPrevented)return;F.preventDefault();let Q=F.nativeEvent.submitter,P=(Q==null?void 0:Q.getAttribute("formmethod"))||l,$=()=>A(Q||F.currentTarget,{fetcherKey:e,method:P,navigate:n,replace:a,state:s,relative:h,preventScrollReset:d,viewTransition:g,unstable_defaultShouldRevalidate:y});E&&n!==!1?k.startTransition(()=>$()):$()};return k.createElement("form",{ref:x,method:O,action:N,onSubmit:r?c:D,...m,"data-discover":!T&&t==="render"?"true":void 0})});HC.displayName="Form";function VC(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function H_(t){let e=k.useContext(ic);return cn(e,VC(t)),e}function YC(t,{target:e,replace:n,state:r,preventScrollReset:a,relative:s,viewTransition:l,unstable_defaultShouldRevalidate:u,unstable_useTransitions:c}={}){let h=Pi(),d=io(),g=fd(t,{relative:s});return k.useCallback(y=>{if(wC(y,e)){y.preventDefault();let m=n!==void 0?n:ko(d)===ko(g),x=()=>h(t,{replace:m,state:r,preventScrollReset:a,relative:s,viewTransition:l,unstable_defaultShouldRevalidate:u});c?k.startTransition(()=>x()):x()}},[d,h,g,n,r,e,t,a,s,l,u,c])}function GC(t){Dr(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let e=k.useRef(Z1(t)),n=k.useRef(!1),r=io(),a=k.useMemo(()=>xC(r.search,n.current?null:e.current),[r.search]),s=Pi(),l=k.useCallback((u,c)=>{const h=Z1(typeof u=="function"?u(new URLSearchParams(a)):u);n.current=!0,s("?"+h,c)},[s,a]);return[a,l]}var WC=0,KC=()=>`__${String(++WC)}__`;function JC(){let{router:t}=H_("useSubmit"),{basename:e}=k.useContext(as),n=tC(),r=t.fetch,a=t.navigate;return k.useCallback(async(s,l={})=>{let{action:u,method:c,encType:h,formData:d,body:g}=EC(s,e);if(l.navigate===!1){let y=l.fetcherKey||KC();await r(y,n,l.action||u,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:d,body:g,formMethod:l.method||c,formEncType:l.encType||h,flushSync:l.flushSync})}else await a(l.action||u,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:d,body:g,formMethod:l.method||c,formEncType:l.encType||h,replace:l.replace,state:l.state,fromRouteId:n,flushSync:l.flushSync,viewTransition:l.viewTransition})},[r,a,e,n])}function XC(t,{relative:e}={}){let{basename:n}=k.useContext(as),r=k.useContext(Cs);cn(r,"useFormAction must be used inside a RouteContext");let[a]=r.matches.slice(-1),s={...fd(t||".",{relative:e})},l=io();if(t==null){s.search=l.search;let u=new URLSearchParams(s.search),c=u.getAll("index");if(c.some(d=>d==="")){u.delete("index"),c.filter(g=>g).forEach(g=>u.append("index",g));let d=u.toString();s.search=d?`?${d}`:""}}return(!t||t===".")&&a.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(s.pathname=s.pathname==="/"?n:Ro([n,s.pathname])),ko(s)}function ZC(t,{relative:e}={}){let n=k.useContext(a2);cn(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=H_("useViewTransitionState"),a=fd(t,{relative:e});if(!n.isTransitioning)return!1;let s=As(n.currentLocation.pathname,r)||n.currentLocation.pathname,l=As(n.nextLocation.pathname,r)||n.nextLocation.pathname;return um(a.pathname,l)!=null||um(a.pathname,s)!=null}var V_=d_();function QC(t){return k.createElement(cC,{flushSync:V_.flushSync,...t})}const e8=(t,e,n,r)=>{var s,l,u,c;const a=[n,{code:e,...r||{}}];if((l=(s=t==null?void 0:t.services)==null?void 0:s.logger)!=null&&l.forward)return t.services.logger.forward(a,"warn","react-i18next::",!0);Xu(a[0])&&(a[0]=`react-i18next:: ${a[0]}`),(c=(u=t==null?void 0:t.services)==null?void 0:u.logger)!=null&&c.warn?t.services.logger.warn(...a):console!=null&&console.warn&&console.warn(...a)},M5={},Q1=(t,e,n,r)=>{Xu(n)&&M5[n]||(Xu(n)&&(M5[n]=new Date),e8(t,e,n,r))},Y_=(t,e)=>()=>{if(t.isInitialized)e();else{const n=()=>{setTimeout(()=>{t.off("initialized",n)},0),e()};t.on("initialized",n)}},ev=(t,e,n)=>{t.loadNamespaces(e,Y_(t,n))},P5=(t,e,n,r)=>{if(Xu(n)&&(n=[n]),t.options.preload&&t.options.preload.indexOf(e)>-1)return ev(t,n,r);n.forEach(a=>{t.options.ns.indexOf(a)<0&&t.options.ns.push(a)}),t.loadLanguages(e,Y_(t,r))},t8=(t,e,n={})=>!e.languages||!e.languages.length?(Q1(e,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:e.languages}),!0):e.hasLoadedNamespace(t,{lng:n.lng,precheck:(r,a)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&r.services.backendConnector.backend&&r.isLanguageChangingTo&&!a(r.isLanguageChangingTo,t))return!1}}),Xu=t=>typeof t=="string",n8=t=>typeof t=="object"&&t!==null,r8=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,a8={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},i8=t=>a8[t],s8=t=>t.replace(r8,i8);let tv={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:s8};const o8=(t={})=>{tv={...tv,...t}},l8=()=>tv;let G_;const u8=t=>{G_=t},c8=()=>G_,f8={type:"3rdParty",init(t){o8(t.options.react),u8(t)}},h8=k.createContext();class d8{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const p8=(t,e)=>{const n=k.useRef();return k.useEffect(()=>{n.current=t},[t,e]),n.current},W_=(t,e,n,r)=>t.getFixedT(e,n,r),m8=(t,e,n,r)=>k.useCallback(W_(t,e,n,r),[t,e,n,r]),kr=(t,e={})=>{var D,F,Q,P;const{i18n:n}=e,{i18n:r,defaultNS:a}=k.useContext(h8)||{},s=n||r||c8();if(s&&!s.reportNamespaces&&(s.reportNamespaces=new d8),!s){Q1(s,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const $=(ne,I)=>Xu(I)?I:n8(I)&&Xu(I.defaultValue)?I.defaultValue:Array.isArray(ne)?ne[ne.length-1]:ne,B=[$,{},!1];return B.t=$,B.i18n={},B.ready=!1,B}(D=s.options.react)!=null&&D.wait&&Q1(s,"DEPRECATED_OPTION","useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const l={...l8(),...s.options.react,...e},{useSuspense:u,keyPrefix:c}=l;let h=a||((F=s.options)==null?void 0:F.defaultNS);h=Xu(h)?[h]:h||["translation"],(P=(Q=s.reportNamespaces).addUsedNamespaces)==null||P.call(Q,h);const d=(s.isInitialized||s.initializedStoreOnce)&&h.every($=>t8($,s,l)),g=m8(s,e.lng||null,l.nsMode==="fallback"?h:h[0],c),y=()=>g,m=()=>W_(s,e.lng||null,l.nsMode==="fallback"?h:h[0],c),[x,E]=k.useState(y);let A=h.join();e.lng&&(A=`${e.lng}${A}`);const N=p8(A),O=k.useRef(!0);k.useEffect(()=>{const{bindI18n:$,bindI18nStore:B}=l;O.current=!0,!d&&!u&&(e.lng?P5(s,e.lng,h,()=>{O.current&&E(m)}):ev(s,h,()=>{O.current&&E(m)})),d&&N&&N!==A&&O.current&&E(m);const ne=()=>{O.current&&E(m)};return $&&(s==null||s.on($,ne)),B&&(s==null||s.store.on(B,ne)),()=>{O.current=!1,s&&$&&($==null||$.split(" ").forEach(I=>s.off(I,ne))),B&&s&&B.split(" ").forEach(I=>s.store.off(I,ne))}},[s,A]),k.useEffect(()=>{O.current&&d&&E(y)},[s,c,d]);const T=[x,s,d];if(T.t=x,T.i18n=s,T.ready=d,d||!d&&!u)return T;throw new Promise($=>{e.lng?P5(s,e.lng,h,()=>$()):ev(s,h,()=>$())})};function K_(t,e){if(!t)return`rgba(255,255,255,${e})`;let n=t.replace("#","");if(n.length===3&&(n=n.split("").map(l=>l+l).join("")),n.length!==6)return`rgba(255,255,255,${e})`;const r=parseInt(n.substring(0,2),16),a=parseInt(n.substring(2,4),16),s=parseInt(n.substring(4,6),16);return`rgba(${r},${a},${s},${e})`}const J_=k.createContext({darkMode:!1,setDarkMode:()=>{}}),g8=({children:t})=>{const[e,n]=k.useState(!1);return k.useEffect(()=>{e?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")},[e]),_.jsx(J_.Provider,{value:{darkMode:e,setDarkMode:n},children:t})},Ea=()=>k.useContext(J_);function Ym(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(t);a<r.length;a++)e.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(t,r[a])&&(n[r[a]]=t[r[a]]);return n}function v8(t,e,n,r){function a(s){return s instanceof n?s:new n(function(l){l(s)})}return new(n||(n=Promise))(function(s,l){function u(d){try{h(r.next(d))}catch(g){l(g)}}function c(d){try{h(r.throw(d))}catch(g){l(g)}}function h(d){d.done?s(d.value):a(d.value).then(u,c)}h((r=r.apply(t,e||[])).next())})}const y8=t=>t?(...e)=>t(...e):(...e)=>fetch(...e);class c2 extends Error{constructor(e,n="FunctionsError",r){super(e),this.name=n,this.context=r}}class b8 extends c2{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}}class I5 extends c2{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}}class F5 extends c2{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}}var nv;(function(t){t.Any="any",t.ApNortheast1="ap-northeast-1",t.ApNortheast2="ap-northeast-2",t.ApSouth1="ap-south-1",t.ApSoutheast1="ap-southeast-1",t.ApSoutheast2="ap-southeast-2",t.CaCentral1="ca-central-1",t.EuCentral1="eu-central-1",t.EuWest1="eu-west-1",t.EuWest2="eu-west-2",t.EuWest3="eu-west-3",t.SaEast1="sa-east-1",t.UsEast1="us-east-1",t.UsWest1="us-west-1",t.UsWest2="us-west-2"})(nv||(nv={}));class w8{constructor(e,{headers:n={},customFetch:r,region:a=nv.Any}={}){this.url=e,this.headers=n,this.region=a,this.fetch=y8(r)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e){return v8(this,arguments,void 0,function*(n,r={}){var a;let s,l;try{const{headers:u,method:c,body:h,signal:d,timeout:g}=r;let y={},{region:m}=r;m||(m=this.region);const x=new URL(`${this.url}/${n}`);m&&m!=="any"&&(y["x-region"]=m,x.searchParams.set("forceFunctionRegion",m));let E;h&&(u&&!Object.prototype.hasOwnProperty.call(u,"Content-Type")||!u)?typeof Blob<"u"&&h instanceof Blob||h instanceof ArrayBuffer?(y["Content-Type"]="application/octet-stream",E=h):typeof h=="string"?(y["Content-Type"]="text/plain",E=h):typeof FormData<"u"&&h instanceof FormData?E=h:(y["Content-Type"]="application/json",E=JSON.stringify(h)):h&&typeof h!="string"&&!(typeof Blob<"u"&&h instanceof Blob)&&!(h instanceof ArrayBuffer)&&!(typeof FormData<"u"&&h instanceof FormData)?E=JSON.stringify(h):E=h;let A=d;g&&(l=new AbortController,s=setTimeout(()=>l.abort(),g),d?(A=l.signal,d.addEventListener("abort",()=>l.abort())):A=l.signal);const N=yield this.fetch(x.toString(),{method:c||"POST",headers:Object.assign(Object.assign(Object.assign({},y),this.headers),u),body:E,signal:A}).catch(F=>{throw new b8(F)}),O=N.headers.get("x-relay-error");if(O&&O==="true")throw new I5(N);if(!N.ok)throw new F5(N);let T=((a=N.headers.get("Content-Type"))!==null&&a!==void 0?a:"text/plain").split(";")[0].trim(),D;return T==="application/json"?D=yield N.json():T==="application/octet-stream"||T==="application/pdf"?D=yield N.blob():T==="text/event-stream"?D=N:T==="multipart/form-data"?D=yield N.formData():D=yield N.text(),{data:D,error:null,response:N}}catch(u){return{data:null,error:u,response:u instanceof F5||u instanceof I5?u.context:void 0}}finally{s&&clearTimeout(s)}})}}var x8=class extends Error{constructor(t){super(t.message),this.name="PostgrestError",this.details=t.details,this.hint=t.hint,this.code=t.code}},S8=class{constructor(t){var e,n;this.shouldThrowOnError=!1,this.method=t.method,this.url=t.url,this.headers=new Headers(t.headers),this.schema=t.schema,this.body=t.body,this.shouldThrowOnError=(e=t.shouldThrowOnError)!==null&&e!==void 0?e:!1,this.signal=t.signal,this.isMaybeSingle=(n=t.isMaybeSingle)!==null&&n!==void 0?n:!1,t.fetch?this.fetch=t.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(t,e){return this.headers=new Headers(this.headers),this.headers.set(t,e),this}then(t,e){var n=this;this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),this.method!=="GET"&&this.method!=="HEAD"&&this.headers.set("Content-Type","application/json");const r=this.fetch;let a=r(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async s=>{let l=null,u=null,c=null,h=s.status,d=s.statusText;if(s.ok){var g,y;if(n.method!=="HEAD"){var m;const N=await s.text();N===""||(n.headers.get("Accept")==="text/csv"||n.headers.get("Accept")&&(!((m=n.headers.get("Accept"))===null||m===void 0)&&m.includes("application/vnd.pgrst.plan+text"))?u=N:u=JSON.parse(N))}const E=(g=n.headers.get("Prefer"))===null||g===void 0?void 0:g.match(/count=(exact|planned|estimated)/),A=(y=s.headers.get("content-range"))===null||y===void 0?void 0:y.split("/");E&&A&&A.length>1&&(c=parseInt(A[1])),n.isMaybeSingle&&n.method==="GET"&&Array.isArray(u)&&(u.length>1?(l={code:"PGRST116",details:`Results contain ${u.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},u=null,c=null,h=406,d="Not Acceptable"):u.length===1?u=u[0]:u=null)}else{var x;const E=await s.text();try{l=JSON.parse(E),Array.isArray(l)&&s.status===404&&(u=[],l=null,h=200,d="OK")}catch{s.status===404&&E===""?(h=204,d="No Content"):l={message:E}}if(l&&n.isMaybeSingle&&(!(l==null||(x=l.details)===null||x===void 0)&&x.includes("0 rows"))&&(l=null,h=200,d="OK"),l&&n.shouldThrowOnError)throw new x8(l)}return{error:l,data:u,count:c,status:h,statusText:d}});return this.shouldThrowOnError||(a=a.catch(s=>{var l;let u="";const c=s==null?void 0:s.cause;if(c){var h,d,g,y;const x=(h=c==null?void 0:c.message)!==null&&h!==void 0?h:"",E=(d=c==null?void 0:c.code)!==null&&d!==void 0?d:"";u=`${(g=s==null?void 0:s.name)!==null&&g!==void 0?g:"FetchError"}: ${s==null?void 0:s.message}`,u+=`
62
-
63
- Caused by: ${(y=c==null?void 0:c.name)!==null&&y!==void 0?y:"Error"}: ${x}`,E&&(u+=` (${E})`),c!=null&&c.stack&&(u+=`
64
- ${c.stack}`)}else{var m;u=(m=s==null?void 0:s.stack)!==null&&m!==void 0?m:""}return{error:{message:`${(l=s==null?void 0:s.name)!==null&&l!==void 0?l:"FetchError"}: ${s==null?void 0:s.message}`,details:u,hint:"",code:""},data:null,count:null,status:0,statusText:""}})),a.then(t,e)}returns(){return this}overrideTypes(){return this}},_8=class extends S8{select(t){let e=!1;const n=(t??"*").split("").map(r=>/\s/.test(r)&&!e?"":(r==='"'&&(e=!e),r)).join("");return this.url.searchParams.set("select",n),this.headers.append("Prefer","return=representation"),this}order(t,{ascending:e=!0,nullsFirst:n,foreignTable:r,referencedTable:a=r}={}){const s=a?`${a}.order`:"order",l=this.url.searchParams.get(s);return this.url.searchParams.set(s,`${l?`${l},`:""}${t}.${e?"asc":"desc"}${n===void 0?"":n?".nullsfirst":".nullslast"}`),this}limit(t,{foreignTable:e,referencedTable:n=e}={}){const r=typeof n>"u"?"limit":`${n}.limit`;return this.url.searchParams.set(r,`${t}`),this}range(t,e,{foreignTable:n,referencedTable:r=n}={}){const a=typeof r>"u"?"offset":`${r}.offset`,s=typeof r>"u"?"limit":`${r}.limit`;return this.url.searchParams.set(a,`${t}`),this.url.searchParams.set(s,`${e-t+1}`),this}abortSignal(t){return this.signal=t,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.method==="GET"?this.headers.set("Accept","application/json"):this.headers.set("Accept","application/vnd.pgrst.object+json"),this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}explain({analyze:t=!1,verbose:e=!1,settings:n=!1,buffers:r=!1,wal:a=!1,format:s="text"}={}){var l;const u=[t?"analyze":null,e?"verbose":null,n?"settings":null,r?"buffers":null,a?"wal":null].filter(Boolean).join("|"),c=(l=this.headers.get("Accept"))!==null&&l!==void 0?l:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${s}; for="${c}"; options=${u};`),s==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(t){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${t}`),this}};const U5=new RegExp("[,()]");var pf=class extends _8{eq(t,e){return this.url.searchParams.append(t,`eq.${e}`),this}neq(t,e){return this.url.searchParams.append(t,`neq.${e}`),this}gt(t,e){return this.url.searchParams.append(t,`gt.${e}`),this}gte(t,e){return this.url.searchParams.append(t,`gte.${e}`),this}lt(t,e){return this.url.searchParams.append(t,`lt.${e}`),this}lte(t,e){return this.url.searchParams.append(t,`lte.${e}`),this}like(t,e){return this.url.searchParams.append(t,`like.${e}`),this}likeAllOf(t,e){return this.url.searchParams.append(t,`like(all).{${e.join(",")}}`),this}likeAnyOf(t,e){return this.url.searchParams.append(t,`like(any).{${e.join(",")}}`),this}ilike(t,e){return this.url.searchParams.append(t,`ilike.${e}`),this}ilikeAllOf(t,e){return this.url.searchParams.append(t,`ilike(all).{${e.join(",")}}`),this}ilikeAnyOf(t,e){return this.url.searchParams.append(t,`ilike(any).{${e.join(",")}}`),this}regexMatch(t,e){return this.url.searchParams.append(t,`match.${e}`),this}regexIMatch(t,e){return this.url.searchParams.append(t,`imatch.${e}`),this}is(t,e){return this.url.searchParams.append(t,`is.${e}`),this}isDistinct(t,e){return this.url.searchParams.append(t,`isdistinct.${e}`),this}in(t,e){const n=Array.from(new Set(e)).map(r=>typeof r=="string"&&U5.test(r)?`"${r}"`:`${r}`).join(",");return this.url.searchParams.append(t,`in.(${n})`),this}notIn(t,e){const n=Array.from(new Set(e)).map(r=>typeof r=="string"&&U5.test(r)?`"${r}"`:`${r}`).join(",");return this.url.searchParams.append(t,`not.in.(${n})`),this}contains(t,e){return typeof e=="string"?this.url.searchParams.append(t,`cs.${e}`):Array.isArray(e)?this.url.searchParams.append(t,`cs.{${e.join(",")}}`):this.url.searchParams.append(t,`cs.${JSON.stringify(e)}`),this}containedBy(t,e){return typeof e=="string"?this.url.searchParams.append(t,`cd.${e}`):Array.isArray(e)?this.url.searchParams.append(t,`cd.{${e.join(",")}}`):this.url.searchParams.append(t,`cd.${JSON.stringify(e)}`),this}rangeGt(t,e){return this.url.searchParams.append(t,`sr.${e}`),this}rangeGte(t,e){return this.url.searchParams.append(t,`nxl.${e}`),this}rangeLt(t,e){return this.url.searchParams.append(t,`sl.${e}`),this}rangeLte(t,e){return this.url.searchParams.append(t,`nxr.${e}`),this}rangeAdjacent(t,e){return this.url.searchParams.append(t,`adj.${e}`),this}overlaps(t,e){return typeof e=="string"?this.url.searchParams.append(t,`ov.${e}`):this.url.searchParams.append(t,`ov.{${e.join(",")}}`),this}textSearch(t,e,{config:n,type:r}={}){let a="";r==="plain"?a="pl":r==="phrase"?a="ph":r==="websearch"&&(a="w");const s=n===void 0?"":`(${n})`;return this.url.searchParams.append(t,`${a}fts${s}.${e}`),this}match(t){return Object.entries(t).forEach(([e,n])=>{this.url.searchParams.append(e,`eq.${n}`)}),this}not(t,e,n){return this.url.searchParams.append(t,`not.${e}.${n}`),this}or(t,{foreignTable:e,referencedTable:n=e}={}){const r=n?`${n}.or`:"or";return this.url.searchParams.append(r,`(${t})`),this}filter(t,e,n){return this.url.searchParams.append(t,`${e}.${n}`),this}},E8=class{constructor(t,{headers:e={},schema:n,fetch:r}){this.url=t,this.headers=new Headers(e),this.schema=n,this.fetch=r}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(t,e){const{head:n=!1,count:r}=e??{},a=n?"HEAD":"GET";let s=!1;const l=(t??"*").split("").map(h=>/\s/.test(h)&&!s?"":(h==='"'&&(s=!s),h)).join(""),{url:u,headers:c}=this.cloneRequestState();return u.searchParams.set("select",l),r&&c.append("Prefer",`count=${r}`),new pf({method:a,url:u,headers:c,schema:this.schema,fetch:this.fetch})}insert(t,{count:e,defaultToNull:n=!0}={}){var r;const a="POST",{url:s,headers:l}=this.cloneRequestState();if(e&&l.append("Prefer",`count=${e}`),n||l.append("Prefer","missing=default"),Array.isArray(t)){const u=t.reduce((c,h)=>c.concat(Object.keys(h)),[]);if(u.length>0){const c=[...new Set(u)].map(h=>`"${h}"`);s.searchParams.set("columns",c.join(","))}}return new pf({method:a,url:s,headers:l,schema:this.schema,body:t,fetch:(r=this.fetch)!==null&&r!==void 0?r:fetch})}upsert(t,{onConflict:e,ignoreDuplicates:n=!1,count:r,defaultToNull:a=!0}={}){var s;const l="POST",{url:u,headers:c}=this.cloneRequestState();if(c.append("Prefer",`resolution=${n?"ignore":"merge"}-duplicates`),e!==void 0&&u.searchParams.set("on_conflict",e),r&&c.append("Prefer",`count=${r}`),a||c.append("Prefer","missing=default"),Array.isArray(t)){const h=t.reduce((d,g)=>d.concat(Object.keys(g)),[]);if(h.length>0){const d=[...new Set(h)].map(g=>`"${g}"`);u.searchParams.set("columns",d.join(","))}}return new pf({method:l,url:u,headers:c,schema:this.schema,body:t,fetch:(s=this.fetch)!==null&&s!==void 0?s:fetch})}update(t,{count:e}={}){var n;const r="PATCH",{url:a,headers:s}=this.cloneRequestState();return e&&s.append("Prefer",`count=${e}`),new pf({method:r,url:a,headers:s,schema:this.schema,body:t,fetch:(n=this.fetch)!==null&&n!==void 0?n:fetch})}delete({count:t}={}){var e;const n="DELETE",{url:r,headers:a}=this.cloneRequestState();return t&&a.append("Prefer",`count=${t}`),new pf({method:n,url:r,headers:a,schema:this.schema,fetch:(e=this.fetch)!==null&&e!==void 0?e:fetch})}},A8=class X_{constructor(e,{headers:n={},schema:r,fetch:a}={}){this.url=e,this.headers=new Headers(n),this.schemaName=r,this.fetch=a}from(e){if(!e||typeof e!="string"||e.trim()==="")throw new Error("Invalid relation name: relation must be a non-empty string.");return new E8(new URL(`${this.url}/${e}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch})}schema(e){return new X_(this.url,{headers:this.headers,schema:e,fetch:this.fetch})}rpc(e,n={},{head:r=!1,get:a=!1,count:s}={}){var l;let u;const c=new URL(`${this.url}/rpc/${e}`);let h;const d=m=>m!==null&&typeof m=="object"&&(!Array.isArray(m)||m.some(d)),g=r&&Object.values(n).some(d);g?(u="POST",h=n):r||a?(u=r?"HEAD":"GET",Object.entries(n).filter(([m,x])=>x!==void 0).map(([m,x])=>[m,Array.isArray(x)?`{${x.join(",")}}`:`${x}`]).forEach(([m,x])=>{c.searchParams.append(m,x)})):(u="POST",h=n);const y=new Headers(this.headers);return g?y.set("Prefer",s?`count=${s},return=minimal`:"return=minimal"):s&&y.set("Prefer",`count=${s}`),new pf({method:u,url:c,headers:y,schema:this.schemaName,body:h,fetch:(l=this.fetch)!==null&&l!==void 0?l:fetch})}};class N8{constructor(){}static detectEnvironment(){var e;if(typeof WebSocket<"u")return{type:"native",constructor:WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocket<"u")return{type:"native",constructor:globalThis.WebSocket};if(typeof global<"u"&&typeof global.WebSocket<"u")return{type:"native",constructor:global.WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocketPair<"u"&&typeof globalThis.WebSocket>"u")return{type:"cloudflare",error:"Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.",workaround:"Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime."};if(typeof globalThis<"u"&&globalThis.EdgeRuntime||typeof navigator<"u"&&(!((e=navigator.userAgent)===null||e===void 0)&&e.includes("Vercel-Edge")))return{type:"unsupported",error:"Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.",workaround:"Use serverless functions or a different deployment target for WebSocket functionality."};const n=globalThis.process;if(n){const r=n.versions;if(r&&r.node){const a=r.node,s=parseInt(a.replace(/^v/,"").split(".")[0]);return s>=22?typeof globalThis.WebSocket<"u"?{type:"native",constructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${s} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${s} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option:
65
- import ws from "ws"
66
- new RealtimeClient(url, { transport: ws })`}}}return{type:"unsupported",error:"Unknown JavaScript runtime without WebSocket support.",workaround:"Ensure you're running in a supported environment (browser, Node.js, Deno) or provide a custom WebSocket implementation."}}static getWebSocketConstructor(){const e=this.detectEnvironment();if(e.constructor)return e.constructor;let n=e.error||"WebSocket not supported in this environment.";throw e.workaround&&(n+=`
67
-
68
- Suggested solution: ${e.workaround}`),new Error(n)}static createWebSocket(e,n){const r=this.getWebSocketConstructor();return new r(e,n)}static isWebSocketSupported(){try{const e=this.detectEnvironment();return e.type==="native"||e.type==="ws"}catch{return!1}}}const C8="2.90.1",T8=`realtime-js/${C8}`,Z_="1.0.0",L8="2.0.0",B5=Z_,rv=1e4,O8=1e3,j8=100;var ou;(function(t){t[t.connecting=0]="connecting",t[t.open=1]="open",t[t.closing=2]="closing",t[t.closed=3]="closed"})(ou||(ou={}));var Sa;(function(t){t.closed="closed",t.errored="errored",t.joined="joined",t.joining="joining",t.leaving="leaving"})(Sa||(Sa={}));var no;(function(t){t.close="phx_close",t.error="phx_error",t.join="phx_join",t.reply="phx_reply",t.leave="phx_leave",t.access_token="access_token"})(no||(no={}));var av;(function(t){t.websocket="websocket"})(av||(av={}));var Yu;(function(t){t.Connecting="connecting",t.Open="open",t.Closing="closing",t.Closed="closed"})(Yu||(Yu={}));class R8{constructor(e){this.HEADER_LENGTH=1,this.USER_BROADCAST_PUSH_META_LENGTH=6,this.KINDS={userBroadcastPush:3,userBroadcast:4},this.BINARY_ENCODING=0,this.JSON_ENCODING=1,this.BROADCAST_EVENT="broadcast",this.allowedMetadataKeys=[],this.allowedMetadataKeys=e??[]}encode(e,n){if(e.event===this.BROADCAST_EVENT&&!(e.payload instanceof ArrayBuffer)&&typeof e.payload.event=="string")return n(this._binaryEncodeUserBroadcastPush(e));let r=[e.join_ref,e.ref,e.topic,e.event,e.payload];return n(JSON.stringify(r))}_binaryEncodeUserBroadcastPush(e){var n;return this._isArrayBuffer((n=e.payload)===null||n===void 0?void 0:n.payload)?this._encodeBinaryUserBroadcastPush(e):this._encodeJsonUserBroadcastPush(e)}_encodeBinaryUserBroadcastPush(e){var n,r;const a=(r=(n=e.payload)===null||n===void 0?void 0:n.payload)!==null&&r!==void 0?r:new ArrayBuffer(0);return this._encodeUserBroadcastPush(e,this.BINARY_ENCODING,a)}_encodeJsonUserBroadcastPush(e){var n,r;const a=(r=(n=e.payload)===null||n===void 0?void 0:n.payload)!==null&&r!==void 0?r:{},l=new TextEncoder().encode(JSON.stringify(a)).buffer;return this._encodeUserBroadcastPush(e,this.JSON_ENCODING,l)}_encodeUserBroadcastPush(e,n,r){var a,s;const l=e.topic,u=(a=e.ref)!==null&&a!==void 0?a:"",c=(s=e.join_ref)!==null&&s!==void 0?s:"",h=e.payload.event,d=this.allowedMetadataKeys?this._pick(e.payload,this.allowedMetadataKeys):{},g=Object.keys(d).length===0?"":JSON.stringify(d);if(c.length>255)throw new Error(`joinRef length ${c.length} exceeds maximum of 255`);if(u.length>255)throw new Error(`ref length ${u.length} exceeds maximum of 255`);if(l.length>255)throw new Error(`topic length ${l.length} exceeds maximum of 255`);if(h.length>255)throw new Error(`userEvent length ${h.length} exceeds maximum of 255`);if(g.length>255)throw new Error(`metadata length ${g.length} exceeds maximum of 255`);const y=this.USER_BROADCAST_PUSH_META_LENGTH+c.length+u.length+l.length+h.length+g.length,m=new ArrayBuffer(this.HEADER_LENGTH+y);let x=new DataView(m),E=0;x.setUint8(E++,this.KINDS.userBroadcastPush),x.setUint8(E++,c.length),x.setUint8(E++,u.length),x.setUint8(E++,l.length),x.setUint8(E++,h.length),x.setUint8(E++,g.length),x.setUint8(E++,n),Array.from(c,N=>x.setUint8(E++,N.charCodeAt(0))),Array.from(u,N=>x.setUint8(E++,N.charCodeAt(0))),Array.from(l,N=>x.setUint8(E++,N.charCodeAt(0))),Array.from(h,N=>x.setUint8(E++,N.charCodeAt(0))),Array.from(g,N=>x.setUint8(E++,N.charCodeAt(0)));var A=new Uint8Array(m.byteLength+r.byteLength);return A.set(new Uint8Array(m),0),A.set(new Uint8Array(r),m.byteLength),A.buffer}decode(e,n){if(this._isArrayBuffer(e)){let r=this._binaryDecode(e);return n(r)}if(typeof e=="string"){const r=JSON.parse(e),[a,s,l,u,c]=r;return n({join_ref:a,ref:s,topic:l,event:u,payload:c})}return n({})}_binaryDecode(e){const n=new DataView(e),r=n.getUint8(0),a=new TextDecoder;switch(r){case this.KINDS.userBroadcast:return this._decodeUserBroadcast(e,n,a)}}_decodeUserBroadcast(e,n,r){const a=n.getUint8(1),s=n.getUint8(2),l=n.getUint8(3),u=n.getUint8(4);let c=this.HEADER_LENGTH+4;const h=r.decode(e.slice(c,c+a));c=c+a;const d=r.decode(e.slice(c,c+s));c=c+s;const g=r.decode(e.slice(c,c+l));c=c+l;const y=e.slice(c,e.byteLength),m=u===this.JSON_ENCODING?JSON.parse(r.decode(y)):y,x={type:this.BROADCAST_EVENT,event:d,payload:m};return l>0&&(x.meta=JSON.parse(g)),{join_ref:null,ref:null,topic:h,event:this.BROADCAST_EVENT,payload:x}}_isArrayBuffer(e){var n;return e instanceof ArrayBuffer||((n=e==null?void 0:e.constructor)===null||n===void 0?void 0:n.name)==="ArrayBuffer"}_pick(e,n){return!e||typeof e!="object"?{}:Object.fromEntries(Object.entries(e).filter(([r])=>n.includes(r)))}}class Q_{constructor(e,n){this.callback=e,this.timerCalc=n,this.timer=void 0,this.tries=0,this.callback=e,this.timerCalc=n}reset(){this.tries=0,clearTimeout(this.timer),this.timer=void 0}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}}var pr;(function(t){t.abstime="abstime",t.bool="bool",t.date="date",t.daterange="daterange",t.float4="float4",t.float8="float8",t.int2="int2",t.int4="int4",t.int4range="int4range",t.int8="int8",t.int8range="int8range",t.json="json",t.jsonb="jsonb",t.money="money",t.numeric="numeric",t.oid="oid",t.reltime="reltime",t.text="text",t.time="time",t.timestamp="timestamp",t.timestamptz="timestamptz",t.timetz="timetz",t.tsrange="tsrange",t.tstzrange="tstzrange"})(pr||(pr={}));const $5=(t,e,n={})=>{var r;const a=(r=n.skipTypes)!==null&&r!==void 0?r:[];return e?Object.keys(e).reduce((s,l)=>(s[l]=D8(l,t,e,a),s),{}):{}},D8=(t,e,n,r)=>{const a=e.find(u=>u.name===t),s=a==null?void 0:a.type,l=n[t];return s&&!r.includes(s)?e4(s,l):iv(l)},e4=(t,e)=>{if(t.charAt(0)==="_"){const n=t.slice(1,t.length);return I8(e,n)}switch(t){case pr.bool:return k8(e);case pr.float4:case pr.float8:case pr.int2:case pr.int4:case pr.int8:case pr.numeric:case pr.oid:return M8(e);case pr.json:case pr.jsonb:return P8(e);case pr.timestamp:return F8(e);case pr.abstime:case pr.date:case pr.daterange:case pr.int4range:case pr.int8range:case pr.money:case pr.reltime:case pr.text:case pr.time:case pr.timestamptz:case pr.timetz:case pr.tsrange:case pr.tstzrange:return iv(e);default:return iv(e)}},iv=t=>t,k8=t=>{switch(t){case"t":return!0;case"f":return!1;default:return t}},M8=t=>{if(typeof t=="string"){const e=parseFloat(t);if(!Number.isNaN(e))return e}return t},P8=t=>{if(typeof t=="string")try{return JSON.parse(t)}catch{return t}return t},I8=(t,e)=>{if(typeof t!="string")return t;const n=t.length-1,r=t[n];if(t[0]==="{"&&r==="}"){let s;const l=t.slice(1,n);try{s=JSON.parse("["+l+"]")}catch{s=l?l.split(","):[]}return s.map(u=>e4(e,u))}return t},F8=t=>typeof t=="string"?t.replace(" ","T"):t,t4=t=>{const e=new URL(t);return e.protocol=e.protocol.replace(/^ws/i,"http"),e.pathname=e.pathname.replace(/\/+$/,"").replace(/\/socket\/websocket$/i,"").replace(/\/socket$/i,"").replace(/\/websocket$/i,""),e.pathname===""||e.pathname==="/"?e.pathname="/api/broadcast":e.pathname=e.pathname+"/api/broadcast",e.href};class U0{constructor(e,n,r={},a=rv){this.channel=e,this.event=n,this.payload=r,this.timeout=a,this.sent=!1,this.timeoutTimer=void 0,this.ref="",this.receivedResp=null,this.recHooks=[],this.refEvent=null}resend(e){this.timeout=e,this._cancelRefEvent(),this.ref="",this.refEvent=null,this.receivedResp=null,this.sent=!1,this.send()}send(){this._hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload,ref:this.ref,join_ref:this.channel._joinRef()}))}updatePayload(e){this.payload=Object.assign(Object.assign({},this.payload),e)}receive(e,n){var r;return this._hasReceived(e)&&n((r=this.receivedResp)===null||r===void 0?void 0:r.response),this.recHooks.push({status:e,callback:n}),this}startTimeout(){if(this.timeoutTimer)return;this.ref=this.channel.socket._makeRef(),this.refEvent=this.channel._replyEventName(this.ref);const e=n=>{this._cancelRefEvent(),this._cancelTimeout(),this.receivedResp=n,this._matchReceive(n)};this.channel._on(this.refEvent,{},e),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}trigger(e,n){this.refEvent&&this.channel._trigger(this.refEvent,{status:e,response:n})}destroy(){this._cancelRefEvent(),this._cancelTimeout()}_cancelRefEvent(){this.refEvent&&this.channel._off(this.refEvent,{})}_cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=void 0}_matchReceive({status:e,response:n}){this.recHooks.filter(r=>r.status===e).forEach(r=>r.callback(n))}_hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}}var z5;(function(t){t.SYNC="sync",t.JOIN="join",t.LEAVE="leave"})(z5||(z5={}));class Fh{constructor(e,n){this.channel=e,this.state={},this.pendingDiffs=[],this.joinRef=null,this.enabled=!1,this.caller={onJoin:()=>{},onLeave:()=>{},onSync:()=>{}};const r=(n==null?void 0:n.events)||{state:"presence_state",diff:"presence_diff"};this.channel._on(r.state,{},a=>{const{onJoin:s,onLeave:l,onSync:u}=this.caller;this.joinRef=this.channel._joinRef(),this.state=Fh.syncState(this.state,a,s,l),this.pendingDiffs.forEach(c=>{this.state=Fh.syncDiff(this.state,c,s,l)}),this.pendingDiffs=[],u()}),this.channel._on(r.diff,{},a=>{const{onJoin:s,onLeave:l,onSync:u}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(a):(this.state=Fh.syncDiff(this.state,a,s,l),u())}),this.onJoin((a,s,l)=>{this.channel._trigger("presence",{event:"join",key:a,currentPresences:s,newPresences:l})}),this.onLeave((a,s,l)=>{this.channel._trigger("presence",{event:"leave",key:a,currentPresences:s,leftPresences:l})}),this.onSync(()=>{this.channel._trigger("presence",{event:"sync"})})}static syncState(e,n,r,a){const s=this.cloneDeep(e),l=this.transformState(n),u={},c={};return this.map(s,(h,d)=>{l[h]||(c[h]=d)}),this.map(l,(h,d)=>{const g=s[h];if(g){const y=d.map(A=>A.presence_ref),m=g.map(A=>A.presence_ref),x=d.filter(A=>m.indexOf(A.presence_ref)<0),E=g.filter(A=>y.indexOf(A.presence_ref)<0);x.length>0&&(u[h]=x),E.length>0&&(c[h]=E)}else u[h]=d}),this.syncDiff(s,{joins:u,leaves:c},r,a)}static syncDiff(e,n,r,a){const{joins:s,leaves:l}={joins:this.transformState(n.joins),leaves:this.transformState(n.leaves)};return r||(r=()=>{}),a||(a=()=>{}),this.map(s,(u,c)=>{var h;const d=(h=e[u])!==null&&h!==void 0?h:[];if(e[u]=this.cloneDeep(c),d.length>0){const g=e[u].map(m=>m.presence_ref),y=d.filter(m=>g.indexOf(m.presence_ref)<0);e[u].unshift(...y)}r(u,d,c)}),this.map(l,(u,c)=>{let h=e[u];if(!h)return;const d=c.map(g=>g.presence_ref);h=h.filter(g=>d.indexOf(g.presence_ref)<0),e[u]=h,a(u,h,c),h.length===0&&delete e[u]}),e}static map(e,n){return Object.getOwnPropertyNames(e).map(r=>n(r,e[r]))}static transformState(e){return e=this.cloneDeep(e),Object.getOwnPropertyNames(e).reduce((n,r)=>{const a=e[r];return"metas"in a?n[r]=a.metas.map(s=>(s.presence_ref=s.phx_ref,delete s.phx_ref,delete s.phx_ref_prev,s)):n[r]=a,n},{})}static cloneDeep(e){return JSON.parse(JSON.stringify(e))}onJoin(e){this.caller.onJoin=e}onLeave(e){this.caller.onLeave=e}onSync(e){this.caller.onSync=e}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel._joinRef()}}var q5;(function(t){t.ALL="*",t.INSERT="INSERT",t.UPDATE="UPDATE",t.DELETE="DELETE"})(q5||(q5={}));var Uh;(function(t){t.BROADCAST="broadcast",t.PRESENCE="presence",t.POSTGRES_CHANGES="postgres_changes",t.SYSTEM="system"})(Uh||(Uh={}));var dl;(function(t){t.SUBSCRIBED="SUBSCRIBED",t.TIMED_OUT="TIMED_OUT",t.CLOSED="CLOSED",t.CHANNEL_ERROR="CHANNEL_ERROR"})(dl||(dl={}));class wf{constructor(e,n={config:{}},r){var a,s;if(this.topic=e,this.params=n,this.socket=r,this.bindings={},this.state=Sa.closed,this.joinedOnce=!1,this.pushBuffer=[],this.subTopic=e.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},n.config),this.timeout=this.socket.timeout,this.joinPush=new U0(this,no.join,this.params,this.timeout),this.rejoinTimer=new Q_(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=Sa.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(l=>l.send()),this.pushBuffer=[]}),this._onClose(()=>{this.rejoinTimer.reset(),this.socket.log("channel",`close ${this.topic} ${this._joinRef()}`),this.state=Sa.closed,this.socket._remove(this)}),this._onError(l=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,l),this.state=Sa.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=Sa.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("error",l=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,l),this.state=Sa.errored,this.rejoinTimer.scheduleTimeout())}),this._on(no.reply,{},(l,u)=>{this._trigger(this._replyEventName(u),l)}),this.presence=new Fh(this),this.broadcastEndpointURL=t4(this.socket.endPoint),this.private=this.params.config.private||!1,!this.private&&(!((s=(a=this.params.config)===null||a===void 0?void 0:a.broadcast)===null||s===void 0)&&s.replay))throw`tried to use replay on public channel '${this.topic}'. It must be a private channel.`}subscribe(e,n=this.timeout){var r,a,s;if(this.socket.isConnected()||this.socket.connect(),this.state==Sa.closed){const{config:{broadcast:l,presence:u,private:c}}=this.params,h=(a=(r=this.bindings.postgres_changes)===null||r===void 0?void 0:r.map(m=>m.filter))!==null&&a!==void 0?a:[],d=!!this.bindings[Uh.PRESENCE]&&this.bindings[Uh.PRESENCE].length>0||((s=this.params.config.presence)===null||s===void 0?void 0:s.enabled)===!0,g={},y={broadcast:l,presence:Object.assign(Object.assign({},u),{enabled:d}),postgres_changes:h,private:c};this.socket.accessTokenValue&&(g.access_token=this.socket.accessTokenValue),this._onError(m=>e==null?void 0:e(dl.CHANNEL_ERROR,m)),this._onClose(()=>e==null?void 0:e(dl.CLOSED)),this.updateJoinPayload(Object.assign({config:y},g)),this.joinedOnce=!0,this._rejoin(n),this.joinPush.receive("ok",async({postgres_changes:m})=>{var x;if(this.socket._isManualToken()||this.socket.setAuth(),m===void 0){e==null||e(dl.SUBSCRIBED);return}else{const E=this.bindings.postgres_changes,A=(x=E==null?void 0:E.length)!==null&&x!==void 0?x:0,N=[];for(let O=0;O<A;O++){const T=E[O],{filter:{event:D,schema:F,table:Q,filter:P}}=T,$=m&&m[O];if($&&$.event===D&&wf.isFilterValueEqual($.schema,F)&&wf.isFilterValueEqual($.table,Q)&&wf.isFilterValueEqual($.filter,P))N.push(Object.assign(Object.assign({},T),{id:$.id}));else{this.unsubscribe(),this.state=Sa.errored,e==null||e(dl.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=N,e&&e(dl.SUBSCRIBED);return}}).receive("error",m=>{this.state=Sa.errored,e==null||e(dl.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(m).join(", ")||"error")))}).receive("timeout",()=>{e==null||e(dl.TIMED_OUT)})}return this}presenceState(){return this.presence.state}async track(e,n={}){return await this.send({type:"presence",event:"track",payload:e},n.timeout||this.timeout)}async untrack(e={}){return await this.send({type:"presence",event:"untrack"},e)}on(e,n,r){return this.state===Sa.joined&&e===Uh.PRESENCE&&(this.socket.log("channel",`resubscribe to ${this.topic} due to change in presence callbacks on joined channel`),this.unsubscribe().then(async()=>await this.subscribe())),this._on(e,n,r)}async httpSend(e,n,r={}){var a;if(n==null)return Promise.reject("Payload is required for httpSend()");const s={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(s.Authorization=`Bearer ${this.socket.accessTokenValue}`);const l={method:"POST",headers:s,body:JSON.stringify({messages:[{topic:this.subTopic,event:e,payload:n,private:this.private}]})},u=await this._fetchWithTimeout(this.broadcastEndpointURL,l,(a=r.timeout)!==null&&a!==void 0?a:this.timeout);if(u.status===202)return{success:!0};let c=u.statusText;try{const h=await u.json();c=h.error||h.message||c}catch{}return Promise.reject(new Error(c))}async send(e,n={}){var r,a;if(!this._canPush()&&e.type==="broadcast"){console.warn("Realtime send() is automatically falling back to REST API. This behavior will be deprecated in the future. Please use httpSend() explicitly for REST delivery.");const{event:s,payload:l}=e,u={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(u.Authorization=`Bearer ${this.socket.accessTokenValue}`);const c={method:"POST",headers:u,body:JSON.stringify({messages:[{topic:this.subTopic,event:s,payload:l,private:this.private}]})};try{const h=await this._fetchWithTimeout(this.broadcastEndpointURL,c,(r=n.timeout)!==null&&r!==void 0?r:this.timeout);return await((a=h.body)===null||a===void 0?void 0:a.cancel()),h.ok?"ok":"error"}catch(h){return h.name==="AbortError"?"timed out":"error"}}else return new Promise(s=>{var l,u,c;const h=this._push(e.type,e,n.timeout||this.timeout);e.type==="broadcast"&&!(!((c=(u=(l=this.params)===null||l===void 0?void 0:l.config)===null||u===void 0?void 0:u.broadcast)===null||c===void 0)&&c.ack)&&s("ok"),h.receive("ok",()=>s("ok")),h.receive("error",()=>s("error")),h.receive("timeout",()=>s("timed out"))})}updateJoinPayload(e){this.joinPush.updatePayload(e)}unsubscribe(e=this.timeout){this.state=Sa.leaving;const n=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(no.close,"leave",this._joinRef())};this.joinPush.destroy();let r=null;return new Promise(a=>{r=new U0(this,no.leave,{},e),r.receive("ok",()=>{n(),a("ok")}).receive("timeout",()=>{n(),a("timed out")}).receive("error",()=>{a("error")}),r.send(),this._canPush()||r.trigger("ok",{})}).finally(()=>{r==null||r.destroy()})}teardown(){this.pushBuffer.forEach(e=>e.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=Sa.closed,this.bindings={}}async _fetchWithTimeout(e,n,r){const a=new AbortController,s=setTimeout(()=>a.abort(),r),l=await this.socket.fetch(e,Object.assign(Object.assign({},n),{signal:a.signal}));return clearTimeout(s),l}_push(e,n,r=this.timeout){if(!this.joinedOnce)throw`tried to push '${e}' to '${this.topic}' before joining. Use channel.subscribe() before pushing events`;let a=new U0(this,e,n,r);return this._canPush()?a.send():this._addToPushBuffer(a),a}_addToPushBuffer(e){if(e.startTimeout(),this.pushBuffer.push(e),this.pushBuffer.length>j8){const n=this.pushBuffer.shift();n&&(n.destroy(),this.socket.log("channel",`discarded push due to buffer overflow: ${n.event}`,n.payload))}}_onMessage(e,n,r){return n}_isMember(e){return this.topic===e}_joinRef(){return this.joinPush.ref}_trigger(e,n,r){var a,s;const l=e.toLocaleLowerCase(),{close:u,error:c,leave:h,join:d}=no;if(r&&[u,c,h,d].indexOf(l)>=0&&r!==this._joinRef())return;let y=this._onMessage(l,n,r);if(n&&!y)throw"channel onMessage callbacks must return the payload, modified or unmodified";["insert","update","delete"].includes(l)?(a=this.bindings.postgres_changes)===null||a===void 0||a.filter(m=>{var x,E,A;return((x=m.filter)===null||x===void 0?void 0:x.event)==="*"||((A=(E=m.filter)===null||E===void 0?void 0:E.event)===null||A===void 0?void 0:A.toLocaleLowerCase())===l}).map(m=>m.callback(y,r)):(s=this.bindings[l])===null||s===void 0||s.filter(m=>{var x,E,A,N,O,T,D,F;if(["broadcast","presence","postgres_changes"].includes(l))if("id"in m){const Q=m.id,P=(x=m.filter)===null||x===void 0?void 0:x.event;return Q&&((E=n.ids)===null||E===void 0?void 0:E.includes(Q))&&(P==="*"||(P==null?void 0:P.toLocaleLowerCase())===((A=n.data)===null||A===void 0?void 0:A.type.toLocaleLowerCase()))&&(!(!((N=m.filter)===null||N===void 0)&&N.table)||m.filter.table===((O=n.data)===null||O===void 0?void 0:O.table))}else{const Q=(D=(T=m==null?void 0:m.filter)===null||T===void 0?void 0:T.event)===null||D===void 0?void 0:D.toLocaleLowerCase();return Q==="*"||Q===((F=n==null?void 0:n.event)===null||F===void 0?void 0:F.toLocaleLowerCase())}else return m.type.toLocaleLowerCase()===l}).map(m=>{if(typeof y=="object"&&"ids"in y){const x=y.data,{schema:E,table:A,commit_timestamp:N,type:O,errors:T}=x;y=Object.assign(Object.assign({},{schema:E,table:A,commit_timestamp:N,eventType:O,new:{},old:{},errors:T}),this._getPayloadRecords(x))}m.callback(y,r)})}_isClosed(){return this.state===Sa.closed}_isJoined(){return this.state===Sa.joined}_isJoining(){return this.state===Sa.joining}_isLeaving(){return this.state===Sa.leaving}_replyEventName(e){return`chan_reply_${e}`}_on(e,n,r){const a=e.toLocaleLowerCase(),s={type:a,filter:n,callback:r};return this.bindings[a]?this.bindings[a].push(s):this.bindings[a]=[s],this}_off(e,n){const r=e.toLocaleLowerCase();return this.bindings[r]&&(this.bindings[r]=this.bindings[r].filter(a=>{var s;return!(((s=a.type)===null||s===void 0?void 0:s.toLocaleLowerCase())===r&&wf.isEqual(a.filter,n))})),this}static isEqual(e,n){if(Object.keys(e).length!==Object.keys(n).length)return!1;for(const r in e)if(e[r]!==n[r])return!1;return!0}static isFilterValueEqual(e,n){return(e??void 0)===(n??void 0)}_rejoinUntilConnected(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this._rejoin()}_onClose(e){this._on(no.close,{},e)}_onError(e){this._on(no.error,{},n=>e(n))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(e=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=Sa.joining,this.joinPush.resend(e))}_getPayloadRecords(e){const n={new:{},old:{}};return(e.type==="INSERT"||e.type==="UPDATE")&&(n.new=$5(e.columns,e.record)),(e.type==="UPDATE"||e.type==="DELETE")&&(n.old=$5(e.columns,e.old_record)),n}}const B0=()=>{},vp={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},U8=[1e3,2e3,5e3,1e4],B8=1e4,$8=`
69
- addEventListener("message", (e) => {
70
- if (e.data.event === "start") {
71
- setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);
72
- }
73
- });`;class z8{constructor(e,n){var r;if(this.accessTokenValue=null,this.apiKey=null,this._manuallySetToken=!1,this.channels=new Array,this.endPoint="",this.httpEndpoint="",this.headers={},this.params={},this.timeout=rv,this.transport=null,this.heartbeatIntervalMs=vp.HEARTBEAT_INTERVAL,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.heartbeatCallback=B0,this.ref=0,this.reconnectTimer=null,this.vsn=B5,this.logger=B0,this.conn=null,this.sendBuffer=[],this.serializer=new R8,this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.accessToken=null,this._connectionState="disconnected",this._wasManualDisconnect=!1,this._authPromise=null,this._heartbeatSentAt=null,this._resolveFetch=a=>a?(...s)=>a(...s):(...s)=>fetch(...s),!(!((r=n==null?void 0:n.params)===null||r===void 0)&&r.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=n.params.apikey,this.endPoint=`${e}/${av.websocket}`,this.httpEndpoint=t4(e),this._initializeOptions(n),this._setupReconnectionTimer(),this.fetch=this._resolveFetch(n==null?void 0:n.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.conn!==null&&this.isConnected())){if(this._setConnectionState("connecting"),this.accessToken&&!this._authPromise&&this._setAuthSafely("connect"),this.transport)this.conn=new this.transport(this.endpointURL());else try{this.conn=N8.createWebSocket(this.endpointURL())}catch(e){this._setConnectionState("disconnected");const n=e.message;throw n.includes("Node.js")?new Error(`${n}
74
-
75
- To use Realtime in Node.js, you need to provide a WebSocket implementation:
76
-
77
- Option 1: Use Node.js 22+ which has native WebSocket support
78
- Option 2: Install and provide the "ws" package:
79
-
80
- npm install ws
81
-
82
- import ws from "ws"
83
- const client = new RealtimeClient(url, {
84
- ...options,
85
- transport: ws
86
- })`):new Error(`WebSocket not available: ${n}`)}this._setupConnectionHandlers()}}endpointURL(){return this._appendParams(this.endPoint,Object.assign({},this.params,{vsn:this.vsn}))}disconnect(e,n){if(!this.isDisconnecting())if(this._setConnectionState("disconnecting",!0),this.conn){const r=setTimeout(()=>{this._setConnectionState("disconnected")},100);this.conn.onclose=()=>{clearTimeout(r),this._setConnectionState("disconnected")},typeof this.conn.close=="function"&&(e?this.conn.close(e,n??""):this.conn.close()),this._teardownConnection()}else this._setConnectionState("disconnected")}getChannels(){return this.channels}async removeChannel(e){const n=await e.unsubscribe();return this.channels.length===0&&this.disconnect(),n}async removeAllChannels(){const e=await Promise.all(this.channels.map(n=>n.unsubscribe()));return this.channels=[],this.disconnect(),e}log(e,n,r){this.logger(e,n,r)}connectionState(){switch(this.conn&&this.conn.readyState){case ou.connecting:return Yu.Connecting;case ou.open:return Yu.Open;case ou.closing:return Yu.Closing;default:return Yu.Closed}}isConnected(){return this.connectionState()===Yu.Open}isConnecting(){return this._connectionState==="connecting"}isDisconnecting(){return this._connectionState==="disconnecting"}channel(e,n={config:{}}){const r=`realtime:${e}`,a=this.getChannels().find(s=>s.topic===r);if(a)return a;{const s=new wf(`realtime:${e}`,n,this);return this.channels.push(s),s}}push(e){const{topic:n,event:r,payload:a,ref:s}=e,l=()=>{this.encode(e,u=>{var c;(c=this.conn)===null||c===void 0||c.send(u)})};this.log("push",`${n} ${r} (${s})`,a),this.isConnected()?l():this.sendBuffer.push(l)}async setAuth(e=null){this._authPromise=this._performAuth(e);try{await this._authPromise}finally{this._authPromise=null}}_isManualToken(){return this._manuallySetToken}async sendHeartbeat(){var e;if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(n){this.log("error","error in heartbeat callback",n)}return}if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this._heartbeatSentAt=null,this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(n){this.log("error","error in heartbeat callback",n)}this._wasManualDisconnect=!1,(e=this.conn)===null||e===void 0||e.close(O8,"heartbeat timeout"),setTimeout(()=>{var n;this.isConnected()||(n=this.reconnectTimer)===null||n===void 0||n.scheduleTimeout()},vp.HEARTBEAT_TIMEOUT_FALLBACK);return}this._heartbeatSentAt=Date.now(),this.pendingHeartbeatRef=this._makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(n){this.log("error","error in heartbeat callback",n)}this._setAuthSafely("heartbeat")}onHeartbeat(e){this.heartbeatCallback=e}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(e=>e()),this.sendBuffer=[])}_makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}_leaveOpenTopic(e){let n=this.channels.find(r=>r.topic===e&&(r._isJoined()||r._isJoining()));n&&(this.log("transport",`leaving duplicate topic "${e}"`),n.unsubscribe())}_remove(e){this.channels=this.channels.filter(n=>n.topic!==e.topic)}_onConnMessage(e){this.decode(e.data,n=>{if(n.topic==="phoenix"&&n.event==="phx_reply"&&n.ref&&n.ref===this.pendingHeartbeatRef){const h=this._heartbeatSentAt?Date.now()-this._heartbeatSentAt:void 0;try{this.heartbeatCallback(n.payload.status==="ok"?"ok":"error",h)}catch(d){this.log("error","error in heartbeat callback",d)}this._heartbeatSentAt=null,this.pendingHeartbeatRef=null}const{topic:r,event:a,payload:s,ref:l}=n,u=l?`(${l})`:"",c=s.status||"";this.log("receive",`${c} ${r} ${a} ${u}`.trim(),s),this.channels.filter(h=>h._isMember(r)).forEach(h=>h._trigger(a,s,l)),this._triggerStateCallbacks("message",n)})}_clearTimer(e){var n;e==="heartbeat"&&this.heartbeatTimer?(clearInterval(this.heartbeatTimer),this.heartbeatTimer=void 0):e==="reconnect"&&((n=this.reconnectTimer)===null||n===void 0||n.reset())}_clearAllTimers(){this._clearTimer("heartbeat"),this._clearTimer("reconnect")}_setupConnectionHandlers(){this.conn&&("binaryType"in this.conn&&(this.conn.binaryType="arraybuffer"),this.conn.onopen=()=>this._onConnOpen(),this.conn.onerror=e=>this._onConnError(e),this.conn.onmessage=e=>this._onConnMessage(e),this.conn.onclose=e=>this._onConnClose(e),this.conn.readyState===ou.open&&this._onConnOpen())}_teardownConnection(){if(this.conn){if(this.conn.readyState===ou.open||this.conn.readyState===ou.connecting)try{this.conn.close()}catch(e){this.log("error","Error closing connection",e)}this.conn.onopen=null,this.conn.onerror=null,this.conn.onmessage=null,this.conn.onclose=null,this.conn=null}this._clearAllTimers(),this._terminateWorker(),this.channels.forEach(e=>e.teardown())}_onConnOpen(){this._setConnectionState("connected"),this.log("transport",`connected to ${this.endpointURL()}`),(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).then(()=>{this.flushSendBuffer()}).catch(n=>{this.log("error","error waiting for auth on connect",n),this.flushSendBuffer()}),this._clearTimer("reconnect"),this.worker?this.workerRef||this._startWorkerHeartbeat():this._startHeartbeat(),this._triggerStateCallbacks("open")}_startHeartbeat(){this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval(()=>this.sendHeartbeat(),this.heartbeatIntervalMs)}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const e=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(e),this.workerRef.onerror=n=>{this.log("worker","worker error",n.message),this._terminateWorker()},this.workerRef.onmessage=n=>{n.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_terminateWorker(){this.workerRef&&(this.log("worker","terminating worker"),this.workerRef.terminate(),this.workerRef=void 0)}_onConnClose(e){var n;this._setConnectionState("disconnected"),this.log("transport","close",e),this._triggerChanError(),this._clearTimer("heartbeat"),this._wasManualDisconnect||(n=this.reconnectTimer)===null||n===void 0||n.scheduleTimeout(),this._triggerStateCallbacks("close",e)}_onConnError(e){this._setConnectionState("disconnected"),this.log("transport",`${e}`),this._triggerChanError(),this._triggerStateCallbacks("error",e)}_triggerChanError(){this.channels.forEach(e=>e._trigger(no.error))}_appendParams(e,n){if(Object.keys(n).length===0)return e;const r=e.match(/\?/)?"&":"?",a=new URLSearchParams(n);return`${e}${r}${a}`}_workerObjectUrl(e){let n;if(e)n=e;else{const r=new Blob([$8],{type:"application/javascript"});n=URL.createObjectURL(r)}return n}_setConnectionState(e,n=!1){this._connectionState=e,e==="connecting"?this._wasManualDisconnect=!1:e==="disconnecting"&&(this._wasManualDisconnect=n)}async _performAuth(e=null){let n,r=!1;if(e)n=e,r=!0;else if(this.accessToken)try{n=await this.accessToken()}catch(a){this.log("error","Error fetching access token from callback",a),n=this.accessTokenValue}else n=this.accessTokenValue;r?this._manuallySetToken=!0:this.accessToken&&(this._manuallySetToken=!1),this.accessTokenValue!=n&&(this.accessTokenValue=n,this.channels.forEach(a=>{const s={access_token:n,version:T8};n&&a.updateJoinPayload(s),a.joinedOnce&&a._isJoined()&&a._push(no.access_token,{access_token:n})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(e="general"){this._isManualToken()||this.setAuth().catch(n=>{this.log("error",`Error setting auth in ${e}`,n)})}_triggerStateCallbacks(e,n){try{this.stateChangeCallbacks[e].forEach(r=>{try{r(n)}catch(a){this.log("error",`error in ${e} callback`,a)}})}catch(r){this.log("error",`error triggering ${e} callbacks`,r)}}_setupReconnectionTimer(){this.reconnectTimer=new Q_(async()=>{setTimeout(async()=>{await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()},vp.RECONNECT_DELAY)},this.reconnectAfterMs)}_initializeOptions(e){var n,r,a,s,l,u,c,h,d,g,y,m;switch(this.transport=(n=e==null?void 0:e.transport)!==null&&n!==void 0?n:null,this.timeout=(r=e==null?void 0:e.timeout)!==null&&r!==void 0?r:rv,this.heartbeatIntervalMs=(a=e==null?void 0:e.heartbeatIntervalMs)!==null&&a!==void 0?a:vp.HEARTBEAT_INTERVAL,this.worker=(s=e==null?void 0:e.worker)!==null&&s!==void 0?s:!1,this.accessToken=(l=e==null?void 0:e.accessToken)!==null&&l!==void 0?l:null,this.heartbeatCallback=(u=e==null?void 0:e.heartbeatCallback)!==null&&u!==void 0?u:B0,this.vsn=(c=e==null?void 0:e.vsn)!==null&&c!==void 0?c:B5,e!=null&&e.params&&(this.params=e.params),e!=null&&e.logger&&(this.logger=e.logger),(e!=null&&e.logLevel||e!=null&&e.log_level)&&(this.logLevel=e.logLevel||e.log_level,this.params=Object.assign(Object.assign({},this.params),{log_level:this.logLevel})),this.reconnectAfterMs=(h=e==null?void 0:e.reconnectAfterMs)!==null&&h!==void 0?h:(x=>U8[x-1]||B8),this.vsn){case Z_:this.encode=(d=e==null?void 0:e.encode)!==null&&d!==void 0?d:((x,E)=>E(JSON.stringify(x))),this.decode=(g=e==null?void 0:e.decode)!==null&&g!==void 0?g:((x,E)=>E(JSON.parse(x)));break;case L8:this.encode=(y=e==null?void 0:e.encode)!==null&&y!==void 0?y:this.serializer.encode.bind(this.serializer),this.decode=(m=e==null?void 0:e.decode)!==null&&m!==void 0?m:this.serializer.decode.bind(this.serializer);break;default:throw new Error(`Unsupported serializer version: ${this.vsn}`)}if(this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=e==null?void 0:e.workerUrl}}}var Wh=class extends Error{constructor(t,e){var n;super(t),this.name="IcebergError",this.status=e.status,this.icebergType=e.icebergType,this.icebergCode=e.icebergCode,this.details=e.details,this.isCommitStateUnknown=e.icebergType==="CommitStateUnknownException"||[500,502,504].includes(e.status)&&((n=e.icebergType)==null?void 0:n.includes("CommitState"))===!0}isNotFound(){return this.status===404}isConflict(){return this.status===409}isAuthenticationTimeout(){return this.status===419}};function q8(t,e,n){const r=new URL(e,t);if(n)for(const[a,s]of Object.entries(n))s!==void 0&&r.searchParams.set(a,s);return r.toString()}async function H8(t){return!t||t.type==="none"?{}:t.type==="bearer"?{Authorization:`Bearer ${t.token}`}:t.type==="header"?{[t.name]:t.value}:t.type==="custom"?await t.getHeaders():{}}function V8(t){const e=t.fetchImpl??globalThis.fetch;return{async request({method:n,path:r,query:a,body:s,headers:l}){const u=q8(t.baseUrl,r,a),c=await H8(t.auth),h=await e(u,{method:n,headers:{...s?{"Content-Type":"application/json"}:{},...c,...l},body:s?JSON.stringify(s):void 0}),d=await h.text(),g=(h.headers.get("content-type")||"").includes("application/json"),y=g&&d?JSON.parse(d):d;if(!h.ok){const m=g?y:void 0,x=m==null?void 0:m.error;throw new Wh((x==null?void 0:x.message)??`Request failed with status ${h.status}`,{status:h.status,icebergType:x==null?void 0:x.type,icebergCode:x==null?void 0:x.code,details:m})}return{status:h.status,headers:h.headers,data:y}}}}function yp(t){return t.join("")}var Y8=class{constructor(t,e=""){this.client=t,this.prefix=e}async listNamespaces(t){const e=t?{parent:yp(t.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:e})).data.namespaces.map(r=>({namespace:r}))}async createNamespace(t,e){const n={namespace:t.namespace,properties:e==null?void 0:e.properties};return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces`,body:n})).data}async dropNamespace(t){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${yp(t.namespace)}`})}async loadNamespaceMetadata(t){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${yp(t.namespace)}`})).data.properties}}async namespaceExists(t){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${yp(t.namespace)}`}),!0}catch(e){if(e instanceof Wh&&e.status===404)return!1;throw e}}async createNamespaceIfNotExists(t,e){try{return await this.createNamespace(t,e)}catch(n){if(n instanceof Wh&&n.status===409)return;throw n}}};function Xc(t){return t.join("")}var G8=class{constructor(t,e="",n){this.client=t,this.prefix=e,this.accessDelegation=n}async listTables(t){return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Xc(t.namespace)}/tables`})).data.identifiers}async createTable(t,e){const n={};return this.accessDelegation&&(n["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${Xc(t.namespace)}/tables`,body:e,headers:n})).data.metadata}async updateTable(t,e){const n=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${Xc(t.namespace)}/tables/${t.name}`,body:e});return{"metadata-location":n.data["metadata-location"],metadata:n.data.metadata}}async dropTable(t,e){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${Xc(t.namespace)}/tables/${t.name}`,query:{purgeRequested:String((e==null?void 0:e.purge)??!1)}})}async loadTable(t){const e={};return this.accessDelegation&&(e["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Xc(t.namespace)}/tables/${t.name}`,headers:e})).data.metadata}async tableExists(t){const e={};this.accessDelegation&&(e["X-Iceberg-Access-Delegation"]=this.accessDelegation);try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${Xc(t.namespace)}/tables/${t.name}`,headers:e}),!0}catch(n){if(n instanceof Wh&&n.status===404)return!1;throw n}}async createTableIfNotExists(t,e){try{return await this.createTable(t,e)}catch(n){if(n instanceof Wh&&n.status===409)return await this.loadTable({namespace:t.namespace,name:e.name});throw n}}},W8=class{constructor(t){var r;let e="v1";t.catalogName&&(e+=`/${t.catalogName}`);const n=t.baseUrl.endsWith("/")?t.baseUrl:`${t.baseUrl}/`;this.client=V8({baseUrl:n,auth:t.auth,fetchImpl:t.fetch}),this.accessDelegation=(r=t.accessDelegation)==null?void 0:r.join(","),this.namespaceOps=new Y8(this.client,e),this.tableOps=new G8(this.client,e,this.accessDelegation)}async listNamespaces(t){return this.namespaceOps.listNamespaces(t)}async createNamespace(t,e){return this.namespaceOps.createNamespace(t,e)}async dropNamespace(t){await this.namespaceOps.dropNamespace(t)}async loadNamespaceMetadata(t){return this.namespaceOps.loadNamespaceMetadata(t)}async listTables(t){return this.tableOps.listTables(t)}async createTable(t,e){return this.tableOps.createTable(t,e)}async updateTable(t,e){return this.tableOps.updateTable(t,e)}async dropTable(t,e){await this.tableOps.dropTable(t,e)}async loadTable(t){return this.tableOps.loadTable(t)}async namespaceExists(t){return this.namespaceOps.namespaceExists(t)}async tableExists(t){return this.tableOps.tableExists(t)}async createNamespaceIfNotExists(t,e){return this.namespaceOps.createNamespaceIfNotExists(t,e)}async createTableIfNotExists(t,e){return this.tableOps.createTableIfNotExists(t,e)}},Gm=class extends Error{constructor(t){super(t),this.__isStorageError=!0,this.name="StorageError"}};function Rr(t){return typeof t=="object"&&t!==null&&"__isStorageError"in t}var K8=class extends Gm{constructor(t,e,n){super(t),this.name="StorageApiError",this.status=e,this.statusCode=n}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}},sv=class extends Gm{constructor(t,e){super(t),this.name="StorageUnknownError",this.originalError=e}};const f2=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),J8=()=>Response,ov=t=>{if(Array.isArray(t))return t.map(n=>ov(n));if(typeof t=="function"||t!==Object(t))return t;const e={};return Object.entries(t).forEach(([n,r])=>{const a=n.replace(/([-_][a-z])/gi,s=>s.toUpperCase().replace(/[-_]/g,""));e[a]=ov(r)}),e},X8=t=>{if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},Z8=t=>!t||typeof t!="string"||t.length===0||t.length>100||t.trim()!==t||t.includes("/")||t.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(t);function Kh(t){"@babel/helpers - typeof";return Kh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Kh(t)}function Q8(t,e){if(Kh(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(Kh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function eT(t){var e=Q8(t,"string");return Kh(e)=="symbol"?e:e+""}function tT(t,e,n){return(e=eT(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function H5(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),n.push.apply(n,r)}return n}function Kt(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?H5(Object(n),!0).forEach(function(r){tT(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):H5(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}const $0=t=>{var e;return t.msg||t.message||t.error_description||(typeof t.error=="string"?t.error:(e=t.error)===null||e===void 0?void 0:e.message)||JSON.stringify(t)},nT=async(t,e,n)=>{t instanceof await J8()&&!(n!=null&&n.noResolveJson)?t.json().then(r=>{const a=t.status||500,s=(r==null?void 0:r.statusCode)||a+"";e(new K8($0(r),a,s))}).catch(r=>{e(new sv($0(r),r))}):e(new sv($0(t),t))},rT=(t,e,n,r)=>{const a={method:t,headers:(e==null?void 0:e.headers)||{}};return t==="GET"||!r?a:(X8(r)?(a.headers=Kt({"Content-Type":"application/json"},e==null?void 0:e.headers),a.body=JSON.stringify(r)):a.body=r,e!=null&&e.duplex&&(a.duplex=e.duplex),Kt(Kt({},a),n))};async function hd(t,e,n,r,a,s){return new Promise((l,u)=>{t(n,rT(e,r,a,s)).then(c=>{if(!c.ok)throw c;return r!=null&&r.noResolveJson?c:c.json()}).then(c=>l(c)).catch(c=>nT(c,u,r))})}async function Jh(t,e,n,r){return hd(t,"GET",e,n,r)}async function to(t,e,n,r,a){return hd(t,"POST",e,r,a,n)}async function lv(t,e,n,r,a){return hd(t,"PUT",e,r,a,n)}async function aT(t,e,n,r){return hd(t,"HEAD",e,Kt(Kt({},n),{},{noResolveJson:!0}),r)}async function h2(t,e,n,r,a){return hd(t,"DELETE",e,r,a,n)}var iT=class{constructor(t,e){this.downloadFn=t,this.shouldThrowOnError=e}then(t,e){return this.execute().then(t,e)}async execute(){var t=this;try{return{data:(await t.downloadFn()).body,error:null}}catch(e){if(t.shouldThrowOnError)throw e;if(Rr(e))return{data:null,error:e};throw e}}};let n4;n4=Symbol.toStringTag;var sT=class{constructor(t,e){this.downloadFn=t,this.shouldThrowOnError=e,this[n4]="BlobDownloadBuilder",this.promise=null}asStream(){return new iT(this.downloadFn,this.shouldThrowOnError)}then(t,e){return this.getPromise().then(t,e)}catch(t){return this.getPromise().catch(t)}finally(t){return this.getPromise().finally(t)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var t=this;try{return{data:await(await t.downloadFn()).blob(),error:null}}catch(e){if(t.shouldThrowOnError)throw e;if(Rr(e))return{data:null,error:e};throw e}}};const oT={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},V5={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};var lT=class{constructor(t,e={},n,r){this.shouldThrowOnError=!1,this.url=t,this.headers=e,this.bucketId=n,this.fetch=f2(r)}throwOnError(){return this.shouldThrowOnError=!0,this}async uploadOrUpdate(t,e,n,r){var a=this;try{let s;const l=Kt(Kt({},V5),r);let u=Kt(Kt({},a.headers),t==="POST"&&{"x-upsert":String(l.upsert)});const c=l.metadata;typeof Blob<"u"&&n instanceof Blob?(s=new FormData,s.append("cacheControl",l.cacheControl),c&&s.append("metadata",a.encodeMetadata(c)),s.append("",n)):typeof FormData<"u"&&n instanceof FormData?(s=n,s.has("cacheControl")||s.append("cacheControl",l.cacheControl),c&&!s.has("metadata")&&s.append("metadata",a.encodeMetadata(c))):(s=n,u["cache-control"]=`max-age=${l.cacheControl}`,u["content-type"]=l.contentType,c&&(u["x-metadata"]=a.toBase64(a.encodeMetadata(c))),(typeof ReadableStream<"u"&&s instanceof ReadableStream||s&&typeof s=="object"&&"pipe"in s&&typeof s.pipe=="function")&&!l.duplex&&(l.duplex="half")),r!=null&&r.headers&&(u=Kt(Kt({},u),r.headers));const h=a._removeEmptyFolders(e),d=a._getFinalPath(h),g=await(t=="PUT"?lv:to)(a.fetch,`${a.url}/object/${d}`,s,Kt({headers:u},l!=null&&l.duplex?{duplex:l.duplex}:{}));return{data:{path:h,id:g.Id,fullPath:g.Key},error:null}}catch(s){if(a.shouldThrowOnError)throw s;if(Rr(s))return{data:null,error:s};throw s}}async upload(t,e,n){return this.uploadOrUpdate("POST",t,e,n)}async uploadToSignedUrl(t,e,n,r){var a=this;const s=a._removeEmptyFolders(t),l=a._getFinalPath(s),u=new URL(a.url+`/object/upload/sign/${l}`);u.searchParams.set("token",e);try{let c;const h=Kt({upsert:V5.upsert},r),d=Kt(Kt({},a.headers),{"x-upsert":String(h.upsert)});return typeof Blob<"u"&&n instanceof Blob?(c=new FormData,c.append("cacheControl",h.cacheControl),c.append("",n)):typeof FormData<"u"&&n instanceof FormData?(c=n,c.append("cacheControl",h.cacheControl)):(c=n,d["cache-control"]=`max-age=${h.cacheControl}`,d["content-type"]=h.contentType),{data:{path:s,fullPath:(await lv(a.fetch,u.toString(),c,{headers:d})).Key},error:null}}catch(c){if(a.shouldThrowOnError)throw c;if(Rr(c))return{data:null,error:c};throw c}}async createSignedUploadUrl(t,e){var n=this;try{let r=n._getFinalPath(t);const a=Kt({},n.headers);e!=null&&e.upsert&&(a["x-upsert"]="true");const s=await to(n.fetch,`${n.url}/object/upload/sign/${r}`,{},{headers:a}),l=new URL(n.url+s.url),u=l.searchParams.get("token");if(!u)throw new Gm("No token returned by API");return{data:{signedUrl:l.toString(),path:t,token:u},error:null}}catch(r){if(n.shouldThrowOnError)throw r;if(Rr(r))return{data:null,error:r};throw r}}async update(t,e,n){return this.uploadOrUpdate("PUT",t,e,n)}async move(t,e,n){var r=this;try{return{data:await to(r.fetch,`${r.url}/object/move`,{bucketId:r.bucketId,sourceKey:t,destinationKey:e,destinationBucket:n==null?void 0:n.destinationBucket},{headers:r.headers}),error:null}}catch(a){if(r.shouldThrowOnError)throw a;if(Rr(a))return{data:null,error:a};throw a}}async copy(t,e,n){var r=this;try{return{data:{path:(await to(r.fetch,`${r.url}/object/copy`,{bucketId:r.bucketId,sourceKey:t,destinationKey:e,destinationBucket:n==null?void 0:n.destinationBucket},{headers:r.headers})).Key},error:null}}catch(a){if(r.shouldThrowOnError)throw a;if(Rr(a))return{data:null,error:a};throw a}}async createSignedUrl(t,e,n){var r=this;try{let a=r._getFinalPath(t),s=await to(r.fetch,`${r.url}/object/sign/${a}`,Kt({expiresIn:e},n!=null&&n.transform?{transform:n.transform}:{}),{headers:r.headers});const l=n!=null&&n.download?`&download=${n.download===!0?"":n.download}`:"";return s={signedUrl:encodeURI(`${r.url}${s.signedURL}${l}`)},{data:s,error:null}}catch(a){if(r.shouldThrowOnError)throw a;if(Rr(a))return{data:null,error:a};throw a}}async createSignedUrls(t,e,n){var r=this;try{const a=await to(r.fetch,`${r.url}/object/sign/${r.bucketId}`,{expiresIn:e,paths:t},{headers:r.headers}),s=n!=null&&n.download?`&download=${n.download===!0?"":n.download}`:"";return{data:a.map(l=>Kt(Kt({},l),{},{signedUrl:l.signedURL?encodeURI(`${r.url}${l.signedURL}${s}`):null})),error:null}}catch(a){if(r.shouldThrowOnError)throw a;if(Rr(a))return{data:null,error:a};throw a}}download(t,e){const n=typeof(e==null?void 0:e.transform)<"u"?"render/image/authenticated":"object",r=this.transformOptsToQueryString((e==null?void 0:e.transform)||{}),a=r?`?${r}`:"",s=this._getFinalPath(t),l=()=>Jh(this.fetch,`${this.url}/${n}/${s}${a}`,{headers:this.headers,noResolveJson:!0});return new sT(l,this.shouldThrowOnError)}async info(t){var e=this;const n=e._getFinalPath(t);try{return{data:ov(await Jh(e.fetch,`${e.url}/object/info/${n}`,{headers:e.headers})),error:null}}catch(r){if(e.shouldThrowOnError)throw r;if(Rr(r))return{data:null,error:r};throw r}}async exists(t){var e=this;const n=e._getFinalPath(t);try{return await aT(e.fetch,`${e.url}/object/${n}`,{headers:e.headers}),{data:!0,error:null}}catch(r){if(e.shouldThrowOnError)throw r;if(Rr(r)&&r instanceof sv){const a=r.originalError;if([400,404].includes(a==null?void 0:a.status))return{data:!1,error:r}}throw r}}getPublicUrl(t,e){const n=this._getFinalPath(t),r=[],a=e!=null&&e.download?`download=${e.download===!0?"":e.download}`:"";a!==""&&r.push(a);const s=typeof(e==null?void 0:e.transform)<"u"?"render/image":"object",l=this.transformOptsToQueryString((e==null?void 0:e.transform)||{});l!==""&&r.push(l);let u=r.join("&");return u!==""&&(u=`?${u}`),{data:{publicUrl:encodeURI(`${this.url}/${s}/public/${n}${u}`)}}}async remove(t){var e=this;try{return{data:await h2(e.fetch,`${e.url}/object/${e.bucketId}`,{prefixes:t},{headers:e.headers}),error:null}}catch(n){if(e.shouldThrowOnError)throw n;if(Rr(n))return{data:null,error:n};throw n}}async list(t,e,n){var r=this;try{const a=Kt(Kt(Kt({},oT),e),{},{prefix:t||""});return{data:await to(r.fetch,`${r.url}/object/list/${r.bucketId}`,a,{headers:r.headers},n),error:null}}catch(a){if(r.shouldThrowOnError)throw a;if(Rr(a))return{data:null,error:a};throw a}}async listV2(t,e){var n=this;try{const r=Kt({},t);return{data:await to(n.fetch,`${n.url}/object/list-v2/${n.bucketId}`,r,{headers:n.headers},e),error:null}}catch(r){if(n.shouldThrowOnError)throw r;if(Rr(r))return{data:null,error:r};throw r}}encodeMetadata(t){return JSON.stringify(t)}toBase64(t){return typeof Buffer<"u"?Buffer.from(t).toString("base64"):btoa(t)}_getFinalPath(t){return`${this.bucketId}/${t.replace(/^\/+/,"")}`}_removeEmptyFolders(t){return t.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(t){const e=[];return t.width&&e.push(`width=${t.width}`),t.height&&e.push(`height=${t.height}`),t.resize&&e.push(`resize=${t.resize}`),t.format&&e.push(`format=${t.format}`),t.quality&&e.push(`quality=${t.quality}`),e.join("&")}};const r4="2.90.1",a4={"X-Client-Info":`storage-js/${r4}`};var uT=class{constructor(t,e={},n,r){this.shouldThrowOnError=!1;const a=new URL(t);r!=null&&r.useNewHostname&&/supabase\.(co|in|red)$/.test(a.hostname)&&!a.hostname.includes("storage.supabase.")&&(a.hostname=a.hostname.replace("supabase.","storage.supabase.")),this.url=a.href.replace(/\/$/,""),this.headers=Kt(Kt({},a4),e),this.fetch=f2(n)}throwOnError(){return this.shouldThrowOnError=!0,this}async listBuckets(t){var e=this;try{const n=e.listBucketOptionsToQueryString(t);return{data:await Jh(e.fetch,`${e.url}/bucket${n}`,{headers:e.headers}),error:null}}catch(n){if(e.shouldThrowOnError)throw n;if(Rr(n))return{data:null,error:n};throw n}}async getBucket(t){var e=this;try{return{data:await Jh(e.fetch,`${e.url}/bucket/${t}`,{headers:e.headers}),error:null}}catch(n){if(e.shouldThrowOnError)throw n;if(Rr(n))return{data:null,error:n};throw n}}async createBucket(t,e={public:!1}){var n=this;try{return{data:await to(n.fetch,`${n.url}/bucket`,{id:t,name:t,type:e.type,public:e.public,file_size_limit:e.fileSizeLimit,allowed_mime_types:e.allowedMimeTypes},{headers:n.headers}),error:null}}catch(r){if(n.shouldThrowOnError)throw r;if(Rr(r))return{data:null,error:r};throw r}}async updateBucket(t,e){var n=this;try{return{data:await lv(n.fetch,`${n.url}/bucket/${t}`,{id:t,name:t,public:e.public,file_size_limit:e.fileSizeLimit,allowed_mime_types:e.allowedMimeTypes},{headers:n.headers}),error:null}}catch(r){if(n.shouldThrowOnError)throw r;if(Rr(r))return{data:null,error:r};throw r}}async emptyBucket(t){var e=this;try{return{data:await to(e.fetch,`${e.url}/bucket/${t}/empty`,{},{headers:e.headers}),error:null}}catch(n){if(e.shouldThrowOnError)throw n;if(Rr(n))return{data:null,error:n};throw n}}async deleteBucket(t){var e=this;try{return{data:await h2(e.fetch,`${e.url}/bucket/${t}`,{},{headers:e.headers}),error:null}}catch(n){if(e.shouldThrowOnError)throw n;if(Rr(n))return{data:null,error:n};throw n}}listBucketOptionsToQueryString(t){const e={};return t&&("limit"in t&&(e.limit=String(t.limit)),"offset"in t&&(e.offset=String(t.offset)),t.search&&(e.search=t.search),t.sortColumn&&(e.sortColumn=t.sortColumn),t.sortOrder&&(e.sortOrder=t.sortOrder)),Object.keys(e).length>0?"?"+new URLSearchParams(e).toString():""}},cT=class{constructor(t,e={},n){this.shouldThrowOnError=!1,this.url=t.replace(/\/$/,""),this.headers=Kt(Kt({},a4),e),this.fetch=f2(n)}throwOnError(){return this.shouldThrowOnError=!0,this}async createBucket(t){var e=this;try{return{data:await to(e.fetch,`${e.url}/bucket`,{name:t},{headers:e.headers}),error:null}}catch(n){if(e.shouldThrowOnError)throw n;if(Rr(n))return{data:null,error:n};throw n}}async listBuckets(t){var e=this;try{const n=new URLSearchParams;(t==null?void 0:t.limit)!==void 0&&n.set("limit",t.limit.toString()),(t==null?void 0:t.offset)!==void 0&&n.set("offset",t.offset.toString()),t!=null&&t.sortColumn&&n.set("sortColumn",t.sortColumn),t!=null&&t.sortOrder&&n.set("sortOrder",t.sortOrder),t!=null&&t.search&&n.set("search",t.search);const r=n.toString(),a=r?`${e.url}/bucket?${r}`:`${e.url}/bucket`;return{data:await Jh(e.fetch,a,{headers:e.headers}),error:null}}catch(n){if(e.shouldThrowOnError)throw n;if(Rr(n))return{data:null,error:n};throw n}}async deleteBucket(t){var e=this;try{return{data:await h2(e.fetch,`${e.url}/bucket/${t}`,{},{headers:e.headers}),error:null}}catch(n){if(e.shouldThrowOnError)throw n;if(Rr(n))return{data:null,error:n};throw n}}from(t){var e=this;if(!Z8(t))throw new Gm("Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.");const n=new W8({baseUrl:this.url,catalogName:t,auth:{type:"custom",getHeaders:async()=>e.headers},fetch:this.fetch}),r=this.shouldThrowOnError;return new Proxy(n,{get(a,s){const l=a[s];return typeof l!="function"?l:async(...u)=>{try{return{data:await l.apply(a,u),error:null}}catch(c){if(r)throw c;return{data:null,error:c}}}}})}};const d2={"X-Client-Info":`storage-js/${r4}`,"Content-Type":"application/json"};var i4=class extends Error{constructor(t){super(t),this.__isStorageVectorsError=!0,this.name="StorageVectorsError"}};function es(t){return typeof t=="object"&&t!==null&&"__isStorageVectorsError"in t}var z0=class extends i4{constructor(t,e,n){super(t),this.name="StorageVectorsApiError",this.status=e,this.statusCode=n}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}},fT=class extends i4{constructor(t,e){super(t),this.name="StorageVectorsUnknownError",this.originalError=e}};const p2=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),hT=t=>{if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},Y5=t=>t.msg||t.message||t.error_description||t.error||JSON.stringify(t),dT=async(t,e,n)=>{if(t&&typeof t=="object"&&"status"in t&&"ok"in t&&typeof t.status=="number"&&!(n!=null&&n.noResolveJson)){const r=t.status||500,a=t;if(typeof a.json=="function")a.json().then(s=>{const l=(s==null?void 0:s.statusCode)||(s==null?void 0:s.code)||r+"";e(new z0(Y5(s),r,l))}).catch(()=>{const s=r+"";e(new z0(a.statusText||`HTTP ${r} error`,r,s))});else{const s=r+"";e(new z0(a.statusText||`HTTP ${r} error`,r,s))}}else e(new fT(Y5(t),t))},pT=(t,e,n,r)=>{const a={method:t,headers:(e==null?void 0:e.headers)||{}};return r?(hT(r)?(a.headers=Kt({"Content-Type":"application/json"},e==null?void 0:e.headers),a.body=JSON.stringify(r)):a.body=r,Kt(Kt({},a),n)):a};async function mT(t,e,n,r,a,s){return new Promise((l,u)=>{t(n,pT(e,r,a,s)).then(c=>{if(!c.ok)throw c;if(r!=null&&r.noResolveJson)return c;const h=c.headers.get("content-type");return!h||!h.includes("application/json")?{}:c.json()}).then(c=>l(c)).catch(c=>dT(c,u,r))})}async function ts(t,e,n,r,a){return mT(t,"POST",e,r,a,n)}var gT=class{constructor(t,e={},n){this.shouldThrowOnError=!1,this.url=t.replace(/\/$/,""),this.headers=Kt(Kt({},d2),e),this.fetch=p2(n)}throwOnError(){return this.shouldThrowOnError=!0,this}async createIndex(t){var e=this;try{return{data:await ts(e.fetch,`${e.url}/CreateIndex`,t,{headers:e.headers})||{},error:null}}catch(n){if(e.shouldThrowOnError)throw n;if(es(n))return{data:null,error:n};throw n}}async getIndex(t,e){var n=this;try{return{data:await ts(n.fetch,`${n.url}/GetIndex`,{vectorBucketName:t,indexName:e},{headers:n.headers}),error:null}}catch(r){if(n.shouldThrowOnError)throw r;if(es(r))return{data:null,error:r};throw r}}async listIndexes(t){var e=this;try{return{data:await ts(e.fetch,`${e.url}/ListIndexes`,t,{headers:e.headers}),error:null}}catch(n){if(e.shouldThrowOnError)throw n;if(es(n))return{data:null,error:n};throw n}}async deleteIndex(t,e){var n=this;try{return{data:await ts(n.fetch,`${n.url}/DeleteIndex`,{vectorBucketName:t,indexName:e},{headers:n.headers})||{},error:null}}catch(r){if(n.shouldThrowOnError)throw r;if(es(r))return{data:null,error:r};throw r}}},vT=class{constructor(t,e={},n){this.shouldThrowOnError=!1,this.url=t.replace(/\/$/,""),this.headers=Kt(Kt({},d2),e),this.fetch=p2(n)}throwOnError(){return this.shouldThrowOnError=!0,this}async putVectors(t){var e=this;try{if(t.vectors.length<1||t.vectors.length>500)throw new Error("Vector batch size must be between 1 and 500 items");return{data:await ts(e.fetch,`${e.url}/PutVectors`,t,{headers:e.headers})||{},error:null}}catch(n){if(e.shouldThrowOnError)throw n;if(es(n))return{data:null,error:n};throw n}}async getVectors(t){var e=this;try{return{data:await ts(e.fetch,`${e.url}/GetVectors`,t,{headers:e.headers}),error:null}}catch(n){if(e.shouldThrowOnError)throw n;if(es(n))return{data:null,error:n};throw n}}async listVectors(t){var e=this;try{if(t.segmentCount!==void 0){if(t.segmentCount<1||t.segmentCount>16)throw new Error("segmentCount must be between 1 and 16");if(t.segmentIndex!==void 0&&(t.segmentIndex<0||t.segmentIndex>=t.segmentCount))throw new Error(`segmentIndex must be between 0 and ${t.segmentCount-1}`)}return{data:await ts(e.fetch,`${e.url}/ListVectors`,t,{headers:e.headers}),error:null}}catch(n){if(e.shouldThrowOnError)throw n;if(es(n))return{data:null,error:n};throw n}}async queryVectors(t){var e=this;try{return{data:await ts(e.fetch,`${e.url}/QueryVectors`,t,{headers:e.headers}),error:null}}catch(n){if(e.shouldThrowOnError)throw n;if(es(n))return{data:null,error:n};throw n}}async deleteVectors(t){var e=this;try{if(t.keys.length<1||t.keys.length>500)throw new Error("Keys batch size must be between 1 and 500 items");return{data:await ts(e.fetch,`${e.url}/DeleteVectors`,t,{headers:e.headers})||{},error:null}}catch(n){if(e.shouldThrowOnError)throw n;if(es(n))return{data:null,error:n};throw n}}},yT=class{constructor(t,e={},n){this.shouldThrowOnError=!1,this.url=t.replace(/\/$/,""),this.headers=Kt(Kt({},d2),e),this.fetch=p2(n)}throwOnError(){return this.shouldThrowOnError=!0,this}async createBucket(t){var e=this;try{return{data:await ts(e.fetch,`${e.url}/CreateVectorBucket`,{vectorBucketName:t},{headers:e.headers})||{},error:null}}catch(n){if(e.shouldThrowOnError)throw n;if(es(n))return{data:null,error:n};throw n}}async getBucket(t){var e=this;try{return{data:await ts(e.fetch,`${e.url}/GetVectorBucket`,{vectorBucketName:t},{headers:e.headers}),error:null}}catch(n){if(e.shouldThrowOnError)throw n;if(es(n))return{data:null,error:n};throw n}}async listBuckets(t={}){var e=this;try{return{data:await ts(e.fetch,`${e.url}/ListVectorBuckets`,t,{headers:e.headers}),error:null}}catch(n){if(e.shouldThrowOnError)throw n;if(es(n))return{data:null,error:n};throw n}}async deleteBucket(t){var e=this;try{return{data:await ts(e.fetch,`${e.url}/DeleteVectorBucket`,{vectorBucketName:t},{headers:e.headers})||{},error:null}}catch(n){if(e.shouldThrowOnError)throw n;if(es(n))return{data:null,error:n};throw n}}},bT=class extends yT{constructor(t,e={}){super(t,e.headers||{},e.fetch)}from(t){return new wT(this.url,this.headers,t,this.fetch)}async createBucket(t){var e=()=>super.createBucket,n=this;return e().call(n,t)}async getBucket(t){var e=()=>super.getBucket,n=this;return e().call(n,t)}async listBuckets(t={}){var e=()=>super.listBuckets,n=this;return e().call(n,t)}async deleteBucket(t){var e=()=>super.deleteBucket,n=this;return e().call(n,t)}},wT=class extends gT{constructor(t,e,n,r){super(t,e,r),this.vectorBucketName=n}async createIndex(t){var e=()=>super.createIndex,n=this;return e().call(n,Kt(Kt({},t),{},{vectorBucketName:n.vectorBucketName}))}async listIndexes(t={}){var e=()=>super.listIndexes,n=this;return e().call(n,Kt(Kt({},t),{},{vectorBucketName:n.vectorBucketName}))}async getIndex(t){var e=()=>super.getIndex,n=this;return e().call(n,n.vectorBucketName,t)}async deleteIndex(t){var e=()=>super.deleteIndex,n=this;return e().call(n,n.vectorBucketName,t)}index(t){return new xT(this.url,this.headers,this.vectorBucketName,t,this.fetch)}},xT=class extends vT{constructor(t,e,n,r,a){super(t,e,a),this.vectorBucketName=n,this.indexName=r}async putVectors(t){var e=()=>super.putVectors,n=this;return e().call(n,Kt(Kt({},t),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async getVectors(t){var e=()=>super.getVectors,n=this;return e().call(n,Kt(Kt({},t),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async listVectors(t={}){var e=()=>super.listVectors,n=this;return e().call(n,Kt(Kt({},t),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async queryVectors(t){var e=()=>super.queryVectors,n=this;return e().call(n,Kt(Kt({},t),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async deleteVectors(t){var e=()=>super.deleteVectors,n=this;return e().call(n,Kt(Kt({},t),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}},ST=class extends uT{constructor(t,e={},n,r){super(t,e,n,r)}from(t){return new lT(this.url,this.headers,t,this.fetch)}get vectors(){return new bT(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new cT(this.url+"/iceberg",this.headers,this.fetch)}};const s4="2.90.1",mf=30*1e3,uv=3,q0=uv*mf,_T="http://localhost:9999",ET="supabase.auth.token",AT={"X-Client-Info":`gotrue-js/${s4}`},cv="X-Supabase-Api-Version",o4={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},NT=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,CT=600*1e3;class Xh extends Error{constructor(e,n,r){super(e),this.__isAuthError=!0,this.name="AuthError",this.status=n,this.code=r}}function Tt(t){return typeof t=="object"&&t!==null&&"__isAuthError"in t}class TT extends Xh{constructor(e,n,r){super(e,n,r),this.name="AuthApiError",this.status=n,this.code=r}}function LT(t){return Tt(t)&&t.name==="AuthApiError"}class Gu extends Xh{constructor(e,n){super(e),this.name="AuthUnknownError",this.originalError=n}}class xl extends Xh{constructor(e,n,r,a){super(e,r,a),this.name=n,this.status=r}}class Zi extends xl{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function OT(t){return Tt(t)&&t.name==="AuthSessionMissingError"}class Zc extends xl{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}}class bp extends xl{constructor(e){super(e,"AuthInvalidCredentialsError",400,void 0)}}class wp extends xl{constructor(e,n=null){super(e,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=n}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}function jT(t){return Tt(t)&&t.name==="AuthImplicitGrantRedirectError"}class G5 extends xl{constructor(e,n=null){super(e,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=n}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}class RT extends xl{constructor(){super("PKCE code verifier not found in storage. This can happen if the auth flow was initiated in a different browser or device, or if the storage was cleared. For SSR frameworks (Next.js, SvelteKit, etc.), use @supabase/ssr on both the server and client to store the code verifier in cookies.","AuthPKCECodeVerifierMissingError",400,"pkce_code_verifier_not_found")}}class fv extends xl{constructor(e,n){super(e,"AuthRetryableFetchError",n,void 0)}}function H0(t){return Tt(t)&&t.name==="AuthRetryableFetchError"}class W5 extends xl{constructor(e,n,r){super(e,"AuthWeakPasswordError",n,"weak_password"),this.reasons=r}}class hv extends xl{constructor(e){super(e,"AuthInvalidJwtError",400,"invalid_jwt")}}const cm="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),K5=`
87
- \r=`.split(""),DT=(()=>{const t=new Array(128);for(let e=0;e<t.length;e+=1)t[e]=-1;for(let e=0;e<K5.length;e+=1)t[K5[e].charCodeAt(0)]=-2;for(let e=0;e<cm.length;e+=1)t[cm[e].charCodeAt(0)]=e;return t})();function J5(t,e,n){if(t!==null)for(e.queue=e.queue<<8|t,e.queuedBits+=8;e.queuedBits>=6;){const r=e.queue>>e.queuedBits-6&63;n(cm[r]),e.queuedBits-=6}else if(e.queuedBits>0)for(e.queue=e.queue<<6-e.queuedBits,e.queuedBits=6;e.queuedBits>=6;){const r=e.queue>>e.queuedBits-6&63;n(cm[r]),e.queuedBits-=6}}function l4(t,e,n){const r=DT[t];if(r>-1)for(e.queue=e.queue<<6|r,e.queuedBits+=6;e.queuedBits>=8;)n(e.queue>>e.queuedBits-8&255),e.queuedBits-=8;else{if(r===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(t)}"`)}}function X5(t){const e=[],n=l=>{e.push(String.fromCodePoint(l))},r={utf8seq:0,codepoint:0},a={queue:0,queuedBits:0},s=l=>{PT(l,r,n)};for(let l=0;l<t.length;l+=1)l4(t.charCodeAt(l),a,s);return e.join("")}function kT(t,e){if(t<=127){e(t);return}else if(t<=2047){e(192|t>>6),e(128|t&63);return}else if(t<=65535){e(224|t>>12),e(128|t>>6&63),e(128|t&63);return}else if(t<=1114111){e(240|t>>18),e(128|t>>12&63),e(128|t>>6&63),e(128|t&63);return}throw new Error(`Unrecognized Unicode codepoint: ${t.toString(16)}`)}function MT(t,e){for(let n=0;n<t.length;n+=1){let r=t.charCodeAt(n);if(r>55295&&r<=56319){const a=(r-55296)*1024&65535;r=(t.charCodeAt(n+1)-56320&65535|a)+65536,n+=1}kT(r,e)}}function PT(t,e,n){if(e.utf8seq===0){if(t<=127){n(t);return}for(let r=1;r<6;r+=1)if((t>>7-r&1)===0){e.utf8seq=r;break}if(e.utf8seq===2)e.codepoint=t&31;else if(e.utf8seq===3)e.codepoint=t&15;else if(e.utf8seq===4)e.codepoint=t&7;else throw new Error("Invalid UTF-8 sequence");e.utf8seq-=1}else if(e.utf8seq>0){if(t<=127)throw new Error("Invalid UTF-8 sequence");e.codepoint=e.codepoint<<6|t&63,e.utf8seq-=1,e.utf8seq===0&&n(e.codepoint)}}function _f(t){const e=[],n={queue:0,queuedBits:0},r=a=>{e.push(a)};for(let a=0;a<t.length;a+=1)l4(t.charCodeAt(a),n,r);return new Uint8Array(e)}function IT(t){const e=[];return MT(t,n=>e.push(n)),new Uint8Array(e)}function Ju(t){const e=[],n={queue:0,queuedBits:0},r=a=>{e.push(a)};return t.forEach(a=>J5(a,n,r)),J5(null,n,r),e.join("")}function FT(t){return Math.round(Date.now()/1e3)+t}function UT(){return Symbol("auth-callback")}const Ga=()=>typeof window<"u"&&typeof document<"u",zu={tested:!1,writable:!1},u4=()=>{if(!Ga())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(zu.tested)return zu.writable;const t=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(t,t),globalThis.localStorage.removeItem(t),zu.tested=!0,zu.writable=!0}catch{zu.tested=!0,zu.writable=!1}return zu.writable};function BT(t){const e={},n=new URL(t);if(n.hash&&n.hash[0]==="#")try{new URLSearchParams(n.hash.substring(1)).forEach((a,s)=>{e[s]=a})}catch{}return n.searchParams.forEach((r,a)=>{e[a]=r}),e}const c4=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),$T=t=>typeof t=="object"&&t!==null&&"status"in t&&"ok"in t&&"json"in t&&typeof t.json=="function",gf=async(t,e,n)=>{await t.setItem(e,JSON.stringify(n))},qu=async(t,e)=>{const n=await t.getItem(e);if(!n)return null;try{return JSON.parse(n)}catch{return n}},Va=async(t,e)=>{await t.removeItem(e)};class Wm{constructor(){this.promise=new Wm.promiseConstructor((e,n)=>{this.resolve=e,this.reject=n})}}Wm.promiseConstructor=Promise;function V0(t){const e=t.split(".");if(e.length!==3)throw new hv("Invalid JWT structure");for(let r=0;r<e.length;r++)if(!NT.test(e[r]))throw new hv("JWT not in base64url format");return{header:JSON.parse(X5(e[0])),payload:JSON.parse(X5(e[1])),signature:_f(e[2]),raw:{header:e[0],payload:e[1]}}}async function zT(t){return await new Promise(e=>{setTimeout(()=>e(null),t)})}function qT(t,e){return new Promise((r,a)=>{(async()=>{for(let s=0;s<1/0;s++)try{const l=await t(s);if(!e(s,null,l)){r(l);return}}catch(l){if(!e(s,l)){a(l);return}}})()})}function HT(t){return("0"+t.toString(16)).substr(-2)}function VT(){const e=new Uint32Array(56);if(typeof crypto>"u"){const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",r=n.length;let a="";for(let s=0;s<56;s++)a+=n.charAt(Math.floor(Math.random()*r));return a}return crypto.getRandomValues(e),Array.from(e,HT).join("")}async function YT(t){const n=new TextEncoder().encode(t),r=await crypto.subtle.digest("SHA-256",n),a=new Uint8Array(r);return Array.from(a).map(s=>String.fromCharCode(s)).join("")}async function GT(t){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),t;const n=await YT(t);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function Qc(t,e,n=!1){const r=VT();let a=r;n&&(a+="/PASSWORD_RECOVERY"),await gf(t,`${e}-code-verifier`,a);const s=await GT(r);return[s,r===s?"plain":"s256"]}const WT=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function KT(t){const e=t.headers.get(cv);if(!e||!e.match(WT))return null;try{return new Date(`${e}T00:00:00.0Z`)}catch{return null}}function JT(t){if(!t)throw new Error("Missing exp claim");const e=Math.floor(Date.now()/1e3);if(t<=e)throw new Error("JWT has expired")}function XT(t){switch(t){case"RS256":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case"ES256":return{name:"ECDSA",namedCurve:"P-256",hash:{name:"SHA-256"}};default:throw new Error("Invalid alg claim")}}const ZT=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function ef(t){if(!ZT.test(t))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function Y0(){const t={};return new Proxy(t,{get:(e,n)=>{if(n==="__isUserNotAvailableProxy")return!0;if(typeof n=="symbol"){const r=n.toString();if(r==="Symbol(Symbol.toPrimitive)"||r==="Symbol(Symbol.toStringTag)"||r==="Symbol(util.inspect.custom)")return}throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the "${n}" property of the session object is not supported. Please use getUser() instead.`)},set:(e,n)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${n}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(e,n)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${n}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function QT(t,e){return new Proxy(t,{get:(n,r,a)=>{if(r==="__isInsecureUserWarningProxy")return!0;if(typeof r=="symbol"){const s=r.toString();if(s==="Symbol(Symbol.toPrimitive)"||s==="Symbol(Symbol.toStringTag)"||s==="Symbol(util.inspect.custom)"||s==="Symbol(nodejs.util.inspect.custom)")return Reflect.get(n,r,a)}return!e.value&&typeof r=="string"&&(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),e.value=!0),Reflect.get(n,r,a)}})}function Z5(t){return JSON.parse(JSON.stringify(t))}const Hu=t=>t.msg||t.message||t.error_description||t.error||JSON.stringify(t),eL=[502,503,504];async function Q5(t){var e;if(!$T(t))throw new fv(Hu(t),0);if(eL.includes(t.status))throw new fv(Hu(t),t.status);let n;try{n=await t.json()}catch(s){throw new Gu(Hu(s),s)}let r;const a=KT(t);if(a&&a.getTime()>=o4["2024-01-01"].timestamp&&typeof n=="object"&&n&&typeof n.code=="string"?r=n.code:typeof n=="object"&&n&&typeof n.error_code=="string"&&(r=n.error_code),r){if(r==="weak_password")throw new W5(Hu(n),t.status,((e=n.weak_password)===null||e===void 0?void 0:e.reasons)||[]);if(r==="session_not_found")throw new Zi}else if(typeof n=="object"&&n&&typeof n.weak_password=="object"&&n.weak_password&&Array.isArray(n.weak_password.reasons)&&n.weak_password.reasons.length&&n.weak_password.reasons.reduce((s,l)=>s&&typeof l=="string",!0))throw new W5(Hu(n),t.status,n.weak_password.reasons);throw new TT(Hu(n),t.status||500,r)}const tL=(t,e,n,r)=>{const a={method:t,headers:(e==null?void 0:e.headers)||{}};return t==="GET"?a:(a.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},e==null?void 0:e.headers),a.body=JSON.stringify(r),Object.assign(Object.assign({},a),n))};async function Gt(t,e,n,r){var a;const s=Object.assign({},r==null?void 0:r.headers);s[cv]||(s[cv]=o4["2024-01-01"].name),r!=null&&r.jwt&&(s.Authorization=`Bearer ${r.jwt}`);const l=(a=r==null?void 0:r.query)!==null&&a!==void 0?a:{};r!=null&&r.redirectTo&&(l.redirect_to=r.redirectTo);const u=Object.keys(l).length?"?"+new URLSearchParams(l).toString():"",c=await nL(t,e,n+u,{headers:s,noResolveJson:r==null?void 0:r.noResolveJson},{},r==null?void 0:r.body);return r!=null&&r.xform?r==null?void 0:r.xform(c):{data:Object.assign({},c),error:null}}async function nL(t,e,n,r,a,s){const l=tL(e,r,a,s);let u;try{u=await t(n,Object.assign({},l))}catch(c){throw console.error(c),new fv(Hu(c),0)}if(u.ok||await Q5(u),r!=null&&r.noResolveJson)return u;try{return await u.json()}catch(c){await Q5(c)}}function eo(t){var e;let n=null;iL(t)&&(n=Object.assign({},t),t.expires_at||(n.expires_at=FT(t.expires_in)));const r=(e=t.user)!==null&&e!==void 0?e:t;return{data:{session:n,user:r},error:null}}function ew(t){const e=eo(t);return!e.error&&t.weak_password&&typeof t.weak_password=="object"&&Array.isArray(t.weak_password.reasons)&&t.weak_password.reasons.length&&t.weak_password.message&&typeof t.weak_password.message=="string"&&t.weak_password.reasons.reduce((n,r)=>n&&typeof r=="string",!0)&&(e.data.weak_password=t.weak_password),e}function fu(t){var e;return{data:{user:(e=t.user)!==null&&e!==void 0?e:t},error:null}}function rL(t){return{data:t,error:null}}function aL(t){const{action_link:e,email_otp:n,hashed_token:r,redirect_to:a,verification_type:s}=t,l=Ym(t,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),u={action_link:e,email_otp:n,hashed_token:r,redirect_to:a,verification_type:s},c=Object.assign({},l);return{data:{properties:u,user:c},error:null}}function tw(t){return t}function iL(t){return t.access_token&&t.refresh_token&&t.expires_in}const G0=["global","local","others"];class sL{constructor({url:e="",headers:n={},fetch:r}){this.url=e,this.headers=n,this.fetch=c4(r),this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)},this.oauth={listClients:this._listOAuthClients.bind(this),createClient:this._createOAuthClient.bind(this),getClient:this._getOAuthClient.bind(this),updateClient:this._updateOAuthClient.bind(this),deleteClient:this._deleteOAuthClient.bind(this),regenerateClientSecret:this._regenerateOAuthClientSecret.bind(this)}}async signOut(e,n=G0[0]){if(G0.indexOf(n)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${G0.join(", ")}`);try{return await Gt(this.fetch,"POST",`${this.url}/logout?scope=${n}`,{headers:this.headers,jwt:e,noResolveJson:!0}),{data:null,error:null}}catch(r){if(Tt(r))return{data:null,error:r};throw r}}async inviteUserByEmail(e,n={}){try{return await Gt(this.fetch,"POST",`${this.url}/invite`,{body:{email:e,data:n.data},headers:this.headers,redirectTo:n.redirectTo,xform:fu})}catch(r){if(Tt(r))return{data:{user:null},error:r};throw r}}async generateLink(e){try{const{options:n}=e,r=Ym(e,["options"]),a=Object.assign(Object.assign({},r),n);return"newEmail"in r&&(a.new_email=r==null?void 0:r.newEmail,delete a.newEmail),await Gt(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:a,headers:this.headers,xform:aL,redirectTo:n==null?void 0:n.redirectTo})}catch(n){if(Tt(n))return{data:{properties:null,user:null},error:n};throw n}}async createUser(e){try{return await Gt(this.fetch,"POST",`${this.url}/admin/users`,{body:e,headers:this.headers,xform:fu})}catch(n){if(Tt(n))return{data:{user:null},error:n};throw n}}async listUsers(e){var n,r,a,s,l,u,c;try{const h={nextPage:null,lastPage:0,total:0},d=await Gt(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(r=(n=e==null?void 0:e.page)===null||n===void 0?void 0:n.toString())!==null&&r!==void 0?r:"",per_page:(s=(a=e==null?void 0:e.perPage)===null||a===void 0?void 0:a.toString())!==null&&s!==void 0?s:""},xform:tw});if(d.error)throw d.error;const g=await d.json(),y=(l=d.headers.get("x-total-count"))!==null&&l!==void 0?l:0,m=(c=(u=d.headers.get("link"))===null||u===void 0?void 0:u.split(","))!==null&&c!==void 0?c:[];return m.length>0&&(m.forEach(x=>{const E=parseInt(x.split(";")[0].split("=")[1].substring(0,1)),A=JSON.parse(x.split(";")[1].split("=")[1]);h[`${A}Page`]=E}),h.total=parseInt(y)),{data:Object.assign(Object.assign({},g),h),error:null}}catch(h){if(Tt(h))return{data:{users:[]},error:h};throw h}}async getUserById(e){ef(e);try{return await Gt(this.fetch,"GET",`${this.url}/admin/users/${e}`,{headers:this.headers,xform:fu})}catch(n){if(Tt(n))return{data:{user:null},error:n};throw n}}async updateUserById(e,n){ef(e);try{return await Gt(this.fetch,"PUT",`${this.url}/admin/users/${e}`,{body:n,headers:this.headers,xform:fu})}catch(r){if(Tt(r))return{data:{user:null},error:r};throw r}}async deleteUser(e,n=!1){ef(e);try{return await Gt(this.fetch,"DELETE",`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:n},xform:fu})}catch(r){if(Tt(r))return{data:{user:null},error:r};throw r}}async _listFactors(e){ef(e.userId);try{const{data:n,error:r}=await Gt(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/factors`,{headers:this.headers,xform:a=>({data:{factors:a},error:null})});return{data:n,error:r}}catch(n){if(Tt(n))return{data:null,error:n};throw n}}async _deleteFactor(e){ef(e.userId),ef(e.id);try{return{data:await Gt(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers}),error:null}}catch(n){if(Tt(n))return{data:null,error:n};throw n}}async _listOAuthClients(e){var n,r,a,s,l,u,c;try{const h={nextPage:null,lastPage:0,total:0},d=await Gt(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(r=(n=e==null?void 0:e.page)===null||n===void 0?void 0:n.toString())!==null&&r!==void 0?r:"",per_page:(s=(a=e==null?void 0:e.perPage)===null||a===void 0?void 0:a.toString())!==null&&s!==void 0?s:""},xform:tw});if(d.error)throw d.error;const g=await d.json(),y=(l=d.headers.get("x-total-count"))!==null&&l!==void 0?l:0,m=(c=(u=d.headers.get("link"))===null||u===void 0?void 0:u.split(","))!==null&&c!==void 0?c:[];return m.length>0&&(m.forEach(x=>{const E=parseInt(x.split(";")[0].split("=")[1].substring(0,1)),A=JSON.parse(x.split(";")[1].split("=")[1]);h[`${A}Page`]=E}),h.total=parseInt(y)),{data:Object.assign(Object.assign({},g),h),error:null}}catch(h){if(Tt(h))return{data:{clients:[]},error:h};throw h}}async _createOAuthClient(e){try{return await Gt(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:e,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(Tt(n))return{data:null,error:n};throw n}}async _getOAuthClient(e){try{return await Gt(this.fetch,"GET",`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(Tt(n))return{data:null,error:n};throw n}}async _updateOAuthClient(e,n){try{return await Gt(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${e}`,{body:n,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(Tt(r))return{data:null,error:r};throw r}}async _deleteOAuthClient(e){try{return await Gt(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(n){if(Tt(n))return{data:null,error:n};throw n}}async _regenerateOAuthClientSecret(e){try{return await Gt(this.fetch,"POST",`${this.url}/admin/oauth/clients/${e}/regenerate_secret`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(Tt(n))return{data:null,error:n};throw n}}}function nw(t={}){return{getItem:e=>t[e]||null,setItem:(e,n)=>{t[e]=n},removeItem:e=>{delete t[e]}}}const tf={debug:!!(globalThis&&u4()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class f4 extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}}class oL extends f4{}async function lL(t,e,n){tf.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",t,e);const r=new globalThis.AbortController;return e>0&&setTimeout(()=>{r.abort(),tf.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",t)},e),await Promise.resolve().then(()=>globalThis.navigator.locks.request(t,e===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:r.signal},async a=>{if(a){tf.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",t,a.name);try{return await n()}finally{tf.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",t,a.name)}}else{if(e===0)throw tf.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",t),new oL(`Acquiring an exclusive Navigator LockManager lock "${t}" immediately failed`);if(tf.debug)try{const s=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(s,null," "))}catch(s){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",s)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),await n()}}))}function uL(){if(typeof globalThis!="object")try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch{typeof self<"u"&&(self.globalThis=self)}}function h4(t){if(!/^0x[a-fA-F0-9]{40}$/.test(t))throw new Error(`@supabase/auth-js: Address "${t}" is invalid.`);return t.toLowerCase()}function cL(t){return parseInt(t,16)}function fL(t){const e=new TextEncoder().encode(t);return"0x"+Array.from(e,r=>r.toString(16).padStart(2,"0")).join("")}function hL(t){var e;const{chainId:n,domain:r,expirationTime:a,issuedAt:s=new Date,nonce:l,notBefore:u,requestId:c,resources:h,scheme:d,uri:g,version:y}=t;{if(!Number.isInteger(n))throw new Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${n}`);if(!r)throw new Error('@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.');if(l&&l.length<8)throw new Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${l}`);if(!g)throw new Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if(y!=="1")throw new Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${y}`);if(!((e=t.statement)===null||e===void 0)&&e.includes(`
88
- `))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${t.statement}`)}const m=h4(t.address),x=d?`${d}://${r}`:r,E=t.statement?`${t.statement}
89
- `:"",A=`${x} wants you to sign in with your Ethereum account:
90
- ${m}
91
-
92
- ${E}`;let N=`URI: ${g}
93
- Version: ${y}
94
- Chain ID: ${n}${l?`
95
- Nonce: ${l}`:""}
96
- Issued At: ${s.toISOString()}`;if(a&&(N+=`
97
- Expiration Time: ${a.toISOString()}`),u&&(N+=`
98
- Not Before: ${u.toISOString()}`),c&&(N+=`
99
- Request ID: ${c}`),h){let O=`
100
- Resources:`;for(const T of h){if(!T||typeof T!="string")throw new Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${T}`);O+=`
101
- - ${T}`}N+=O}return`${A}
102
- ${N}`}class ua extends Error{constructor({message:e,code:n,cause:r,name:a}){var s;super(e,{cause:r}),this.__isWebAuthnError=!0,this.name=(s=a??(r instanceof Error?r.name:void 0))!==null&&s!==void 0?s:"Unknown Error",this.code=n}}class fm extends ua{constructor(e,n){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:n,message:e}),this.name="WebAuthnUnknownError",this.originalError=n}}function dL({error:t,options:e}){var n,r,a;const{publicKey:s}=e;if(!s)throw Error("options was missing required publicKey property");if(t.name==="AbortError"){if(e.signal instanceof AbortSignal)return new ua({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:t})}else if(t.name==="ConstraintError"){if(((n=s.authenticatorSelection)===null||n===void 0?void 0:n.requireResidentKey)===!0)return new ua({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:t});if(e.mediation==="conditional"&&((r=s.authenticatorSelection)===null||r===void 0?void 0:r.userVerification)==="required")return new ua({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:t});if(((a=s.authenticatorSelection)===null||a===void 0?void 0:a.userVerification)==="required")return new ua({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:t})}else{if(t.name==="InvalidStateError")return new ua({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:t});if(t.name==="NotAllowedError")return new ua({message:t.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t});if(t.name==="NotSupportedError")return s.pubKeyCredParams.filter(u=>u.type==="public-key").length===0?new ua({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:t}):new ua({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:t});if(t.name==="SecurityError"){const l=window.location.hostname;if(d4(l)){if(s.rp.id!==l)return new ua({message:`The RP ID "${s.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else return new ua({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:t})}else if(t.name==="TypeError"){if(s.user.id.byteLength<1||s.user.id.byteLength>64)return new ua({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:t})}else if(t.name==="UnknownError")return new ua({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:t})}return new ua({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t})}function pL({error:t,options:e}){const{publicKey:n}=e;if(!n)throw Error("options was missing required publicKey property");if(t.name==="AbortError"){if(e.signal instanceof AbortSignal)return new ua({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:t})}else{if(t.name==="NotAllowedError")return new ua({message:t.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t});if(t.name==="SecurityError"){const r=window.location.hostname;if(d4(r)){if(n.rpId!==r)return new ua({message:`The RP ID "${n.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else return new ua({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:t})}else if(t.name==="UnknownError")return new ua({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:t})}return new ua({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t})}class mL{createNewAbortSignal(){if(this.controller){const n=new Error("Cancelling existing WebAuthn API call for new one");n.name="AbortError",this.controller.abort(n)}const e=new AbortController;return this.controller=e,e.signal}cancelCeremony(){if(this.controller){const e=new Error("Manually cancelling existing WebAuthn API call");e.name="AbortError",this.controller.abort(e),this.controller=void 0}}}const gL=new mL;function vL(t){if(!t)throw new Error("Credential creation options are required");if(typeof PublicKeyCredential<"u"&&"parseCreationOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseCreationOptionsFromJSON=="function")return PublicKeyCredential.parseCreationOptionsFromJSON(t);const{challenge:e,user:n,excludeCredentials:r}=t,a=Ym(t,["challenge","user","excludeCredentials"]),s=_f(e).buffer,l=Object.assign(Object.assign({},n),{id:_f(n.id).buffer}),u=Object.assign(Object.assign({},a),{challenge:s,user:l});if(r&&r.length>0){u.excludeCredentials=new Array(r.length);for(let c=0;c<r.length;c++){const h=r[c];u.excludeCredentials[c]=Object.assign(Object.assign({},h),{id:_f(h.id).buffer,type:h.type||"public-key",transports:h.transports})}}return u}function yL(t){if(!t)throw new Error("Credential request options are required");if(typeof PublicKeyCredential<"u"&&"parseRequestOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseRequestOptionsFromJSON=="function")return PublicKeyCredential.parseRequestOptionsFromJSON(t);const{challenge:e,allowCredentials:n}=t,r=Ym(t,["challenge","allowCredentials"]),a=_f(e).buffer,s=Object.assign(Object.assign({},r),{challenge:a});if(n&&n.length>0){s.allowCredentials=new Array(n.length);for(let l=0;l<n.length;l++){const u=n[l];s.allowCredentials[l]=Object.assign(Object.assign({},u),{id:_f(u.id).buffer,type:u.type||"public-key",transports:u.transports})}}return s}function bL(t){var e;if("toJSON"in t&&typeof t.toJSON=="function")return t.toJSON();const n=t;return{id:t.id,rawId:t.id,response:{attestationObject:Ju(new Uint8Array(t.response.attestationObject)),clientDataJSON:Ju(new Uint8Array(t.response.clientDataJSON))},type:"public-key",clientExtensionResults:t.getClientExtensionResults(),authenticatorAttachment:(e=n.authenticatorAttachment)!==null&&e!==void 0?e:void 0}}function wL(t){var e;if("toJSON"in t&&typeof t.toJSON=="function")return t.toJSON();const n=t,r=t.getClientExtensionResults(),a=t.response;return{id:t.id,rawId:t.id,response:{authenticatorData:Ju(new Uint8Array(a.authenticatorData)),clientDataJSON:Ju(new Uint8Array(a.clientDataJSON)),signature:Ju(new Uint8Array(a.signature)),userHandle:a.userHandle?Ju(new Uint8Array(a.userHandle)):void 0},type:"public-key",clientExtensionResults:r,authenticatorAttachment:(e=n.authenticatorAttachment)!==null&&e!==void 0?e:void 0}}function d4(t){return t==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(t)}function rw(){var t,e;return!!(Ga()&&"PublicKeyCredential"in window&&window.PublicKeyCredential&&"credentials"in navigator&&typeof((t=navigator==null?void 0:navigator.credentials)===null||t===void 0?void 0:t.create)=="function"&&typeof((e=navigator==null?void 0:navigator.credentials)===null||e===void 0?void 0:e.get)=="function")}async function xL(t){try{const e=await navigator.credentials.create(t);return e?e instanceof PublicKeyCredential?{data:e,error:null}:{data:null,error:new fm("Browser returned unexpected credential type",e)}:{data:null,error:new fm("Empty credential response",e)}}catch(e){return{data:null,error:dL({error:e,options:t})}}}async function SL(t){try{const e=await navigator.credentials.get(t);return e?e instanceof PublicKeyCredential?{data:e,error:null}:{data:null,error:new fm("Browser returned unexpected credential type",e)}:{data:null,error:new fm("Empty credential response",e)}}catch(e){return{data:null,error:pL({error:e,options:t})}}}const _L={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},EL={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function hm(...t){const e=a=>a!==null&&typeof a=="object"&&!Array.isArray(a),n=a=>a instanceof ArrayBuffer||ArrayBuffer.isView(a),r={};for(const a of t)if(a)for(const s in a){const l=a[s];if(l!==void 0)if(Array.isArray(l))r[s]=l;else if(n(l))r[s]=l;else if(e(l)){const u=r[s];e(u)?r[s]=hm(u,l):r[s]=hm(l)}else r[s]=l}return r}function AL(t,e){return hm(_L,t,e||{})}function NL(t,e){return hm(EL,t,e||{})}class CL{constructor(e){this.client=e,this.enroll=this._enroll.bind(this),this.challenge=this._challenge.bind(this),this.verify=this._verify.bind(this),this.authenticate=this._authenticate.bind(this),this.register=this._register.bind(this)}async _enroll(e){return this.client.mfa.enroll(Object.assign(Object.assign({},e),{factorType:"webauthn"}))}async _challenge({factorId:e,webauthn:n,friendlyName:r,signal:a},s){try{const{data:l,error:u}=await this.client.mfa.challenge({factorId:e,webauthn:n});if(!l)return{data:null,error:u};const c=a??gL.createNewAbortSignal();if(l.webauthn.type==="create"){const{user:h}=l.webauthn.credential_options.publicKey;h.name||(h.name=`${h.id}:${r}`),h.displayName||(h.displayName=h.name)}switch(l.webauthn.type){case"create":{const h=AL(l.webauthn.credential_options.publicKey,s==null?void 0:s.create),{data:d,error:g}=await xL({publicKey:h,signal:c});return d?{data:{factorId:e,challengeId:l.id,webauthn:{type:l.webauthn.type,credential_response:d}},error:null}:{data:null,error:g}}case"request":{const h=NL(l.webauthn.credential_options.publicKey,s==null?void 0:s.request),{data:d,error:g}=await SL(Object.assign(Object.assign({},l.webauthn.credential_options),{publicKey:h,signal:c}));return d?{data:{factorId:e,challengeId:l.id,webauthn:{type:l.webauthn.type,credential_response:d}},error:null}:{data:null,error:g}}}}catch(l){return Tt(l)?{data:null,error:l}:{data:null,error:new Gu("Unexpected error in challenge",l)}}}async _verify({challengeId:e,factorId:n,webauthn:r}){return this.client.mfa.verify({factorId:n,challengeId:e,webauthn:r})}async _authenticate({factorId:e,webauthn:{rpId:n=typeof window<"u"?window.location.hostname:void 0,rpOrigins:r=typeof window<"u"?[window.location.origin]:void 0,signal:a}={}},s){if(!n)return{data:null,error:new Xh("rpId is required for WebAuthn authentication")};try{if(!rw())return{data:null,error:new Gu("Browser does not support WebAuthn",null)};const{data:l,error:u}=await this.challenge({factorId:e,webauthn:{rpId:n,rpOrigins:r},signal:a},{request:s});if(!l)return{data:null,error:u};const{webauthn:c}=l;return this._verify({factorId:e,challengeId:l.challengeId,webauthn:{type:c.type,rpId:n,rpOrigins:r,credential_response:c.credential_response}})}catch(l){return Tt(l)?{data:null,error:l}:{data:null,error:new Gu("Unexpected error in authenticate",l)}}}async _register({friendlyName:e,webauthn:{rpId:n=typeof window<"u"?window.location.hostname:void 0,rpOrigins:r=typeof window<"u"?[window.location.origin]:void 0,signal:a}={}},s){if(!n)return{data:null,error:new Xh("rpId is required for WebAuthn registration")};try{if(!rw())return{data:null,error:new Gu("Browser does not support WebAuthn",null)};const{data:l,error:u}=await this._enroll({friendlyName:e});if(!l)return await this.client.mfa.listFactors().then(d=>{var g;return(g=d.data)===null||g===void 0?void 0:g.all.find(y=>y.factor_type==="webauthn"&&y.friendly_name===e&&y.status!=="unverified")}).then(d=>d?this.client.mfa.unenroll({factorId:d==null?void 0:d.id}):void 0),{data:null,error:u};const{data:c,error:h}=await this._challenge({factorId:l.id,friendlyName:l.friendly_name,webauthn:{rpId:n,rpOrigins:r},signal:a},{create:s});return c?this._verify({factorId:l.id,challengeId:c.challengeId,webauthn:{rpId:n,rpOrigins:r,type:c.webauthn.type,credential_response:c.webauthn.credential_response}}):{data:null,error:h}}catch(l){return Tt(l)?{data:null,error:l}:{data:null,error:new Gu("Unexpected error in register",l)}}}}uL();const TL={url:_T,storageKey:ET,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:AT,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:1e4};async function aw(t,e,n){return await n()}const nf={};class Zh{get jwks(){var e,n;return(n=(e=nf[this.storageKey])===null||e===void 0?void 0:e.jwks)!==null&&n!==void 0?n:{keys:[]}}set jwks(e){nf[this.storageKey]=Object.assign(Object.assign({},nf[this.storageKey]),{jwks:e})}get jwks_cached_at(){var e,n;return(n=(e=nf[this.storageKey])===null||e===void 0?void 0:e.cachedAt)!==null&&n!==void 0?n:Number.MIN_SAFE_INTEGER}set jwks_cached_at(e){nf[this.storageKey]=Object.assign(Object.assign({},nf[this.storageKey]),{cachedAt:e})}constructor(e){var n,r,a;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.autoRefreshTickTimeout=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log;const s=Object.assign(Object.assign({},TL),e);if(this.storageKey=s.storageKey,this.instanceID=(n=Zh.nextInstanceID[this.storageKey])!==null&&n!==void 0?n:0,Zh.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!s.debug,typeof s.debug=="function"&&(this.logger=s.debug),this.instanceID>0&&Ga()){const l=`${this._logPrefix()} Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.`;console.warn(l),this.logDebugMessages&&console.trace(l)}if(this.persistSession=s.persistSession,this.autoRefreshToken=s.autoRefreshToken,this.admin=new sL({url:s.url,headers:s.headers,fetch:s.fetch}),this.url=s.url,this.headers=s.headers,this.fetch=c4(s.fetch),this.lock=s.lock||aw,this.detectSessionInUrl=s.detectSessionInUrl,this.flowType=s.flowType,this.hasCustomAuthorizationHeader=s.hasCustomAuthorizationHeader,this.throwOnError=s.throwOnError,this.lockAcquireTimeout=s.lockAcquireTimeout,s.lock?this.lock=s.lock:this.persistSession&&Ga()&&(!((r=globalThis==null?void 0:globalThis.navigator)===null||r===void 0)&&r.locks)?this.lock=lL:this.lock=aw,this.jwks||(this.jwks={keys:[]},this.jwks_cached_at=Number.MIN_SAFE_INTEGER),this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this),webauthn:new CL(this)},this.oauth={getAuthorizationDetails:this._getAuthorizationDetails.bind(this),approveAuthorization:this._approveAuthorization.bind(this),denyAuthorization:this._denyAuthorization.bind(this),listGrants:this._listOAuthGrants.bind(this),revokeGrant:this._revokeOAuthGrant.bind(this)},this.persistSession?(s.storage?this.storage=s.storage:u4()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=nw(this.memoryStorage)),s.userStorage&&(this.userStorage=s.userStorage)):(this.memoryStorage={},this.storage=nw(this.memoryStorage)),Ga()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(l){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",l)}(a=this.broadcastChannel)===null||a===void 0||a.addEventListener("message",async l=>{this._debug("received broadcast notification from other tab or client",l),await this._notifyAllSubscribers(l.data.event,l.data.session,!1)})}this.initialize()}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(e){if(this.throwOnError&&e&&e.error)throw e.error;return e}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${s4}) ${new Date().toISOString()}`}_debug(...e){return this.logDebugMessages&&this.logger(this._logPrefix(),...e),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(this.lockAcquireTimeout,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){var e;try{let n={},r="none";if(Ga()&&(n=BT(window.location.href),this._isImplicitGrantCallback(n)?r="implicit":await this._isPKCECallback(n)&&(r="pkce")),Ga()&&this.detectSessionInUrl&&r!=="none"){const{data:a,error:s}=await this._getSessionFromURL(n,r);if(s){if(this._debug("#_initialize()","error detecting session from URL",s),jT(s)){const c=(e=s.details)===null||e===void 0?void 0:e.code;if(c==="identity_already_exists"||c==="identity_not_found"||c==="single_identity_not_deletable")return{error:s}}return{error:s}}const{session:l,redirectType:u}=a;return this._debug("#_initialize()","detected session in URL",l,"redirect type",u),await this._saveSession(l),setTimeout(async()=>{u==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",l):await this._notifyAllSubscribers("SIGNED_IN",l)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(n){return Tt(n)?this._returnResult({error:n}):this._returnResult({error:new Gu("Unexpected error during initialization",n)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(e){var n,r,a;try{const s=await Gt(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(r=(n=e==null?void 0:e.options)===null||n===void 0?void 0:n.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:(a=e==null?void 0:e.options)===null||a===void 0?void 0:a.captchaToken}},xform:eo}),{data:l,error:u}=s;if(u||!l)return this._returnResult({data:{user:null,session:null},error:u});const c=l.session,h=l.user;return l.session&&(await this._saveSession(l.session),await this._notifyAllSubscribers("SIGNED_IN",c)),this._returnResult({data:{user:h,session:c},error:null})}catch(s){if(Tt(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}}async signUp(e){var n,r,a;try{let s;if("email"in e){const{email:d,password:g,options:y}=e;let m=null,x=null;this.flowType==="pkce"&&([m,x]=await Qc(this.storage,this.storageKey)),s=await Gt(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:y==null?void 0:y.emailRedirectTo,body:{email:d,password:g,data:(n=y==null?void 0:y.data)!==null&&n!==void 0?n:{},gotrue_meta_security:{captcha_token:y==null?void 0:y.captchaToken},code_challenge:m,code_challenge_method:x},xform:eo})}else if("phone"in e){const{phone:d,password:g,options:y}=e;s=await Gt(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:d,password:g,data:(r=y==null?void 0:y.data)!==null&&r!==void 0?r:{},channel:(a=y==null?void 0:y.channel)!==null&&a!==void 0?a:"sms",gotrue_meta_security:{captcha_token:y==null?void 0:y.captchaToken}},xform:eo})}else throw new bp("You must provide either an email or phone number and a password");const{data:l,error:u}=s;if(u||!l)return await Va(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:u});const c=l.session,h=l.user;return l.session&&(await this._saveSession(l.session),await this._notifyAllSubscribers("SIGNED_IN",c)),this._returnResult({data:{user:h,session:c},error:null})}catch(s){if(await Va(this.storage,`${this.storageKey}-code-verifier`),Tt(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}}async signInWithPassword(e){try{let n;if("email"in e){const{email:s,password:l,options:u}=e;n=await Gt(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:s,password:l,gotrue_meta_security:{captcha_token:u==null?void 0:u.captchaToken}},xform:ew})}else if("phone"in e){const{phone:s,password:l,options:u}=e;n=await Gt(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:s,password:l,gotrue_meta_security:{captcha_token:u==null?void 0:u.captchaToken}},xform:ew})}else throw new bp("You must provide either an email or phone number and a password");const{data:r,error:a}=n;if(a)return this._returnResult({data:{user:null,session:null},error:a});if(!r||!r.session||!r.user){const s=new Zc;return this._returnResult({data:{user:null,session:null},error:s})}return r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers("SIGNED_IN",r.session)),this._returnResult({data:Object.assign({user:r.user,session:r.session},r.weak_password?{weakPassword:r.weak_password}:null),error:a})}catch(n){if(Tt(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async signInWithOAuth(e){var n,r,a,s;return await this._handleProviderSignIn(e.provider,{redirectTo:(n=e.options)===null||n===void 0?void 0:n.redirectTo,scopes:(r=e.options)===null||r===void 0?void 0:r.scopes,queryParams:(a=e.options)===null||a===void 0?void 0:a.queryParams,skipBrowserRedirect:(s=e.options)===null||s===void 0?void 0:s.skipBrowserRedirect})}async exchangeCodeForSession(e){return await this.initializePromise,this._acquireLock(this.lockAcquireTimeout,async()=>this._exchangeCodeForSession(e))}async signInWithWeb3(e){const{chain:n}=e;switch(n){case"ethereum":return await this.signInWithEthereum(e);case"solana":return await this.signInWithSolana(e);default:throw new Error(`@supabase/auth-js: Unsupported chain "${n}"`)}}async signInWithEthereum(e){var n,r,a,s,l,u,c,h,d,g,y;let m,x;if("message"in e)m=e.message,x=e.signature;else{const{chain:E,wallet:A,statement:N,options:O}=e;let T;if(Ga())if(typeof A=="object")T=A;else{const B=window;if("ethereum"in B&&typeof B.ethereum=="object"&&"request"in B.ethereum&&typeof B.ethereum.request=="function")T=B.ethereum;else throw new Error("@supabase/auth-js: No compatible Ethereum wallet interface on the window object (window.ethereum) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'ethereum', wallet: resolvedUserWallet }) instead.")}else{if(typeof A!="object"||!(O!=null&&O.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");T=A}const D=new URL((n=O==null?void 0:O.url)!==null&&n!==void 0?n:window.location.href),F=await T.request({method:"eth_requestAccounts"}).then(B=>B).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!F||F.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const Q=h4(F[0]);let P=(r=O==null?void 0:O.signInWithEthereum)===null||r===void 0?void 0:r.chainId;if(!P){const B=await T.request({method:"eth_chainId"});P=cL(B)}const $={domain:D.host,address:Q,statement:N,uri:D.href,version:"1",chainId:P,nonce:(a=O==null?void 0:O.signInWithEthereum)===null||a===void 0?void 0:a.nonce,issuedAt:(l=(s=O==null?void 0:O.signInWithEthereum)===null||s===void 0?void 0:s.issuedAt)!==null&&l!==void 0?l:new Date,expirationTime:(u=O==null?void 0:O.signInWithEthereum)===null||u===void 0?void 0:u.expirationTime,notBefore:(c=O==null?void 0:O.signInWithEthereum)===null||c===void 0?void 0:c.notBefore,requestId:(h=O==null?void 0:O.signInWithEthereum)===null||h===void 0?void 0:h.requestId,resources:(d=O==null?void 0:O.signInWithEthereum)===null||d===void 0?void 0:d.resources};m=hL($),x=await T.request({method:"personal_sign",params:[fL(m),Q]})}try{const{data:E,error:A}=await Gt(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:m,signature:x},!((g=e.options)===null||g===void 0)&&g.captchaToken?{gotrue_meta_security:{captcha_token:(y=e.options)===null||y===void 0?void 0:y.captchaToken}}:null),xform:eo});if(A)throw A;if(!E||!E.session||!E.user){const N=new Zc;return this._returnResult({data:{user:null,session:null},error:N})}return E.session&&(await this._saveSession(E.session),await this._notifyAllSubscribers("SIGNED_IN",E.session)),this._returnResult({data:Object.assign({},E),error:A})}catch(E){if(Tt(E))return this._returnResult({data:{user:null,session:null},error:E});throw E}}async signInWithSolana(e){var n,r,a,s,l,u,c,h,d,g,y,m;let x,E;if("message"in e)x=e.message,E=e.signature;else{const{chain:A,wallet:N,statement:O,options:T}=e;let D;if(Ga())if(typeof N=="object")D=N;else{const Q=window;if("solana"in Q&&typeof Q.solana=="object"&&("signIn"in Q.solana&&typeof Q.solana.signIn=="function"||"signMessage"in Q.solana&&typeof Q.solana.signMessage=="function"))D=Q.solana;else throw new Error("@supabase/auth-js: No compatible Solana wallet interface on the window object (window.solana) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'solana', wallet: resolvedUserWallet }) instead.")}else{if(typeof N!="object"||!(T!=null&&T.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");D=N}const F=new URL((n=T==null?void 0:T.url)!==null&&n!==void 0?n:window.location.href);if("signIn"in D&&D.signIn){const Q=await D.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},T==null?void 0:T.signInWithSolana),{version:"1",domain:F.host,uri:F.href}),O?{statement:O}:null));let P;if(Array.isArray(Q)&&Q[0]&&typeof Q[0]=="object")P=Q[0];else if(Q&&typeof Q=="object"&&"signedMessage"in Q&&"signature"in Q)P=Q;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in P&&"signature"in P&&(typeof P.signedMessage=="string"||P.signedMessage instanceof Uint8Array)&&P.signature instanceof Uint8Array)x=typeof P.signedMessage=="string"?P.signedMessage:new TextDecoder().decode(P.signedMessage),E=P.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in D)||typeof D.signMessage!="function"||!("publicKey"in D)||typeof D!="object"||!D.publicKey||!("toBase58"in D.publicKey)||typeof D.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");x=[`${F.host} wants you to sign in with your Solana account:`,D.publicKey.toBase58(),...O?["",O,""]:[""],"Version: 1",`URI: ${F.href}`,`Issued At: ${(a=(r=T==null?void 0:T.signInWithSolana)===null||r===void 0?void 0:r.issuedAt)!==null&&a!==void 0?a:new Date().toISOString()}`,...!((s=T==null?void 0:T.signInWithSolana)===null||s===void 0)&&s.notBefore?[`Not Before: ${T.signInWithSolana.notBefore}`]:[],...!((l=T==null?void 0:T.signInWithSolana)===null||l===void 0)&&l.expirationTime?[`Expiration Time: ${T.signInWithSolana.expirationTime}`]:[],...!((u=T==null?void 0:T.signInWithSolana)===null||u===void 0)&&u.chainId?[`Chain ID: ${T.signInWithSolana.chainId}`]:[],...!((c=T==null?void 0:T.signInWithSolana)===null||c===void 0)&&c.nonce?[`Nonce: ${T.signInWithSolana.nonce}`]:[],...!((h=T==null?void 0:T.signInWithSolana)===null||h===void 0)&&h.requestId?[`Request ID: ${T.signInWithSolana.requestId}`]:[],...!((g=(d=T==null?void 0:T.signInWithSolana)===null||d===void 0?void 0:d.resources)===null||g===void 0)&&g.length?["Resources",...T.signInWithSolana.resources.map(P=>`- ${P}`)]:[]].join(`
103
- `);const Q=await D.signMessage(new TextEncoder().encode(x),"utf8");if(!Q||!(Q instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");E=Q}}try{const{data:A,error:N}=await Gt(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:x,signature:Ju(E)},!((y=e.options)===null||y===void 0)&&y.captchaToken?{gotrue_meta_security:{captcha_token:(m=e.options)===null||m===void 0?void 0:m.captchaToken}}:null),xform:eo});if(N)throw N;if(!A||!A.session||!A.user){const O=new Zc;return this._returnResult({data:{user:null,session:null},error:O})}return A.session&&(await this._saveSession(A.session),await this._notifyAllSubscribers("SIGNED_IN",A.session)),this._returnResult({data:Object.assign({},A),error:N})}catch(A){if(Tt(A))return this._returnResult({data:{user:null,session:null},error:A});throw A}}async _exchangeCodeForSession(e){const n=await qu(this.storage,`${this.storageKey}-code-verifier`),[r,a]=(n??"").split("/");try{if(!r&&this.flowType==="pkce")throw new RT;const{data:s,error:l}=await Gt(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:r},xform:eo});if(await Va(this.storage,`${this.storageKey}-code-verifier`),l)throw l;if(!s||!s.session||!s.user){const u=new Zc;return this._returnResult({data:{user:null,session:null,redirectType:null},error:u})}return s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",s.session)),this._returnResult({data:Object.assign(Object.assign({},s),{redirectType:a??null}),error:l})}catch(s){if(await Va(this.storage,`${this.storageKey}-code-verifier`),Tt(s))return this._returnResult({data:{user:null,session:null,redirectType:null},error:s});throw s}}async signInWithIdToken(e){try{const{options:n,provider:r,token:a,access_token:s,nonce:l}=e,u=await Gt(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:r,id_token:a,access_token:s,nonce:l,gotrue_meta_security:{captcha_token:n==null?void 0:n.captchaToken}},xform:eo}),{data:c,error:h}=u;if(h)return this._returnResult({data:{user:null,session:null},error:h});if(!c||!c.session||!c.user){const d=new Zc;return this._returnResult({data:{user:null,session:null},error:d})}return c.session&&(await this._saveSession(c.session),await this._notifyAllSubscribers("SIGNED_IN",c.session)),this._returnResult({data:c,error:h})}catch(n){if(Tt(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async signInWithOtp(e){var n,r,a,s,l;try{if("email"in e){const{email:u,options:c}=e;let h=null,d=null;this.flowType==="pkce"&&([h,d]=await Qc(this.storage,this.storageKey));const{error:g}=await Gt(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:u,data:(n=c==null?void 0:c.data)!==null&&n!==void 0?n:{},create_user:(r=c==null?void 0:c.shouldCreateUser)!==null&&r!==void 0?r:!0,gotrue_meta_security:{captcha_token:c==null?void 0:c.captchaToken},code_challenge:h,code_challenge_method:d},redirectTo:c==null?void 0:c.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:g})}if("phone"in e){const{phone:u,options:c}=e,{data:h,error:d}=await Gt(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:u,data:(a=c==null?void 0:c.data)!==null&&a!==void 0?a:{},create_user:(s=c==null?void 0:c.shouldCreateUser)!==null&&s!==void 0?s:!0,gotrue_meta_security:{captcha_token:c==null?void 0:c.captchaToken},channel:(l=c==null?void 0:c.channel)!==null&&l!==void 0?l:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:h==null?void 0:h.message_id},error:d})}throw new bp("You must provide either an email or phone number.")}catch(u){if(await Va(this.storage,`${this.storageKey}-code-verifier`),Tt(u))return this._returnResult({data:{user:null,session:null},error:u});throw u}}async verifyOtp(e){var n,r;try{let a,s;"options"in e&&(a=(n=e.options)===null||n===void 0?void 0:n.redirectTo,s=(r=e.options)===null||r===void 0?void 0:r.captchaToken);const{data:l,error:u}=await Gt(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:s}}),redirectTo:a,xform:eo});if(u)throw u;if(!l)throw new Error("An error occurred on token verification.");const c=l.session,h=l.user;return c!=null&&c.access_token&&(await this._saveSession(c),await this._notifyAllSubscribers(e.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",c)),this._returnResult({data:{user:h,session:c},error:null})}catch(a){if(Tt(a))return this._returnResult({data:{user:null,session:null},error:a});throw a}}async signInWithSSO(e){var n,r,a,s,l;try{let u=null,c=null;this.flowType==="pkce"&&([u,c]=await Qc(this.storage,this.storageKey));const h=await Gt(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in e?{provider_id:e.providerId}:null),"domain"in e?{domain:e.domain}:null),{redirect_to:(r=(n=e.options)===null||n===void 0?void 0:n.redirectTo)!==null&&r!==void 0?r:void 0}),!((a=e==null?void 0:e.options)===null||a===void 0)&&a.captchaToken?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:u,code_challenge_method:c}),headers:this.headers,xform:rL});return!((s=h.data)===null||s===void 0)&&s.url&&Ga()&&!(!((l=e.options)===null||l===void 0)&&l.skipBrowserRedirect)&&window.location.assign(h.data.url),this._returnResult(h)}catch(u){if(await Va(this.storage,`${this.storageKey}-code-verifier`),Tt(u))return this._returnResult({data:null,error:u});throw u}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async e=>{const{data:{session:n},error:r}=e;if(r)throw r;if(!n)throw new Zi;const{error:a}=await Gt(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:n.access_token});return this._returnResult({data:{user:null,session:null},error:a})})}catch(e){if(Tt(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async resend(e){try{const n=`${this.url}/resend`;if("email"in e){const{email:r,type:a,options:s}=e,{error:l}=await Gt(this.fetch,"POST",n,{headers:this.headers,body:{email:r,type:a,gotrue_meta_security:{captcha_token:s==null?void 0:s.captchaToken}},redirectTo:s==null?void 0:s.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:l})}else if("phone"in e){const{phone:r,type:a,options:s}=e,{data:l,error:u}=await Gt(this.fetch,"POST",n,{headers:this.headers,body:{phone:r,type:a,gotrue_meta_security:{captcha_token:s==null?void 0:s.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:l==null?void 0:l.message_id},error:u})}throw new bp("You must provide either an email or phone number and a type")}catch(n){if(Tt(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async getSession(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>this._useSession(async n=>n))}async _acquireLock(e,n){this._debug("#_acquireLock","begin",e);try{if(this.lockAcquired){const r=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),a=(async()=>(await r,await n()))();return this.pendingInLock.push((async()=>{try{await a}catch{}})()),a}return await this.lock(`lock:${this.storageKey}`,e,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const r=n();for(this.pendingInLock.push((async()=>{try{await r}catch{}})()),await r;this.pendingInLock.length;){const a=[...this.pendingInLock];await Promise.all(a),this.pendingInLock.splice(0,a.length)}return await r}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(e){this._debug("#_useSession","begin");try{const n=await this.__loadSession();return await e(n)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let e=null;const n=await qu(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",n),n!==null&&(this._isValidSession(n)?e=n:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!e)return{data:{session:null},error:null};const r=e.expires_at?e.expires_at*1e3-Date.now()<q0:!1;if(this._debug("#__loadSession()",`session has${r?"":" not"} expired`,"expires_at",e.expires_at),!r){if(this.userStorage){const l=await qu(this.userStorage,this.storageKey+"-user");l!=null&&l.user?e.user=l.user:e.user=Y0()}if(this.storage.isServer&&e.user&&!e.user.__isUserNotAvailableProxy){const l={value:this.suppressGetSessionWarning};e.user=QT(e.user,l),l.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:e},error:null}}const{data:a,error:s}=await this._callRefreshToken(e.refresh_token);return s?this._returnResult({data:{session:null},error:s}):this._returnResult({data:{session:a},error:null})}finally{this._debug("#__loadSession()","end")}}async getUser(e){if(e)return await this._getUser(e);await this.initializePromise;const n=await this._acquireLock(this.lockAcquireTimeout,async()=>await this._getUser());return n.data.user&&(this.suppressGetSessionWarning=!0),n}async _getUser(e){try{return e?await Gt(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:e,xform:fu}):await this._useSession(async n=>{var r,a,s;const{data:l,error:u}=n;if(u)throw u;return!(!((r=l.session)===null||r===void 0)&&r.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new Zi}:await Gt(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(s=(a=l.session)===null||a===void 0?void 0:a.access_token)!==null&&s!==void 0?s:void 0,xform:fu})})}catch(n){if(Tt(n))return OT(n)&&(await this._removeSession(),await Va(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:n});throw n}}async updateUser(e,n={}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._updateUser(e,n))}async _updateUser(e,n={}){try{return await this._useSession(async r=>{const{data:a,error:s}=r;if(s)throw s;if(!a.session)throw new Zi;const l=a.session;let u=null,c=null;this.flowType==="pkce"&&e.email!=null&&([u,c]=await Qc(this.storage,this.storageKey));const{data:h,error:d}=await Gt(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:n==null?void 0:n.emailRedirectTo,body:Object.assign(Object.assign({},e),{code_challenge:u,code_challenge_method:c}),jwt:l.access_token,xform:fu});if(d)throw d;return l.user=h.user,await this._saveSession(l),await this._notifyAllSubscribers("USER_UPDATED",l),this._returnResult({data:{user:l.user},error:null})})}catch(r){if(await Va(this.storage,`${this.storageKey}-code-verifier`),Tt(r))return this._returnResult({data:{user:null},error:r});throw r}}async setSession(e){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._setSession(e))}async _setSession(e){try{if(!e.access_token||!e.refresh_token)throw new Zi;const n=Date.now()/1e3;let r=n,a=!0,s=null;const{payload:l}=V0(e.access_token);if(l.exp&&(r=l.exp,a=r<=n),a){const{data:u,error:c}=await this._callRefreshToken(e.refresh_token);if(c)return this._returnResult({data:{user:null,session:null},error:c});if(!u)return{data:{user:null,session:null},error:null};s=u}else{const{data:u,error:c}=await this._getUser(e.access_token);if(c)throw c;s={access_token:e.access_token,refresh_token:e.refresh_token,user:u.user,token_type:"bearer",expires_in:r-n,expires_at:r},await this._saveSession(s),await this._notifyAllSubscribers("SIGNED_IN",s)}return this._returnResult({data:{user:s.user,session:s},error:null})}catch(n){if(Tt(n))return this._returnResult({data:{session:null,user:null},error:n});throw n}}async refreshSession(e){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._refreshSession(e))}async _refreshSession(e){try{return await this._useSession(async n=>{var r;if(!e){const{data:l,error:u}=n;if(u)throw u;e=(r=l.session)!==null&&r!==void 0?r:void 0}if(!(e!=null&&e.refresh_token))throw new Zi;const{data:a,error:s}=await this._callRefreshToken(e.refresh_token);return s?this._returnResult({data:{user:null,session:null},error:s}):a?this._returnResult({data:{user:a.user,session:a},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(n){if(Tt(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async _getSessionFromURL(e,n){try{if(!Ga())throw new wp("No browser detected.");if(e.error||e.error_description||e.error_code)throw new wp(e.error_description||"Error in URL with unspecified error_description",{error:e.error||"unspecified_error",code:e.error_code||"unspecified_code"});switch(n){case"implicit":if(this.flowType==="pkce")throw new G5("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new wp("Not a valid implicit grant flow url.");break;default:}if(n==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!e.code)throw new G5("No code detected.");const{data:O,error:T}=await this._exchangeCodeForSession(e.code);if(T)throw T;const D=new URL(window.location.href);return D.searchParams.delete("code"),window.history.replaceState(window.history.state,"",D.toString()),{data:{session:O.session,redirectType:null},error:null}}const{provider_token:r,provider_refresh_token:a,access_token:s,refresh_token:l,expires_in:u,expires_at:c,token_type:h}=e;if(!s||!u||!l||!h)throw new wp("No session defined in URL");const d=Math.round(Date.now()/1e3),g=parseInt(u);let y=d+g;c&&(y=parseInt(c));const m=y-d;m*1e3<=mf&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${m}s, should have been closer to ${g}s`);const x=y-g;d-x>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",x,y,d):d-x<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",x,y,d);const{data:E,error:A}=await this._getUser(s);if(A)throw A;const N={provider_token:r,provider_refresh_token:a,access_token:s,expires_in:g,expires_at:y,refresh_token:l,token_type:h,user:E.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:N,redirectType:e.type},error:null})}catch(r){if(Tt(r))return this._returnResult({data:{session:null,redirectType:null},error:r});throw r}}_isImplicitGrantCallback(e){return typeof this.detectSessionInUrl=="function"?this.detectSessionInUrl(new URL(window.location.href),e):!!(e.access_token||e.error_description)}async _isPKCECallback(e){const n=await qu(this.storage,`${this.storageKey}-code-verifier`);return!!(e.code&&n)}async signOut(e={scope:"global"}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._signOut(e))}async _signOut({scope:e}={scope:"global"}){return await this._useSession(async n=>{var r;const{data:a,error:s}=n;if(s)return this._returnResult({error:s});const l=(r=a.session)===null||r===void 0?void 0:r.access_token;if(l){const{error:u}=await this.admin.signOut(l,e);if(u&&!(LT(u)&&(u.status===404||u.status===401||u.status===403)))return this._returnResult({error:u})}return e!=="others"&&(await this._removeSession(),await Va(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(e){const n=UT(),r={id:n,callback:e,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",n),this.stateChangeEmitters.delete(n)}};return this._debug("#onAuthStateChange()","registered callback with id",n),this.stateChangeEmitters.set(n,r),(async()=>(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{this._emitInitialSession(n)})))(),{data:{subscription:r}}}async _emitInitialSession(e){return await this._useSession(async n=>{var r,a;try{const{data:{session:s},error:l}=n;if(l)throw l;await((r=this.stateChangeEmitters.get(e))===null||r===void 0?void 0:r.callback("INITIAL_SESSION",s)),this._debug("INITIAL_SESSION","callback id",e,"session",s)}catch(s){await((a=this.stateChangeEmitters.get(e))===null||a===void 0?void 0:a.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",e,"error",s),console.error(s)}})}async resetPasswordForEmail(e,n={}){let r=null,a=null;this.flowType==="pkce"&&([r,a]=await Qc(this.storage,this.storageKey,!0));try{return await Gt(this.fetch,"POST",`${this.url}/recover`,{body:{email:e,code_challenge:r,code_challenge_method:a,gotrue_meta_security:{captcha_token:n.captchaToken}},headers:this.headers,redirectTo:n.redirectTo})}catch(s){if(await Va(this.storage,`${this.storageKey}-code-verifier`),Tt(s))return this._returnResult({data:null,error:s});throw s}}async getUserIdentities(){var e;try{const{data:n,error:r}=await this.getUser();if(r)throw r;return this._returnResult({data:{identities:(e=n.user.identities)!==null&&e!==void 0?e:[]},error:null})}catch(n){if(Tt(n))return this._returnResult({data:null,error:n});throw n}}async linkIdentity(e){return"token"in e?this.linkIdentityIdToken(e):this.linkIdentityOAuth(e)}async linkIdentityOAuth(e){var n;try{const{data:r,error:a}=await this._useSession(async s=>{var l,u,c,h,d;const{data:g,error:y}=s;if(y)throw y;const m=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,e.provider,{redirectTo:(l=e.options)===null||l===void 0?void 0:l.redirectTo,scopes:(u=e.options)===null||u===void 0?void 0:u.scopes,queryParams:(c=e.options)===null||c===void 0?void 0:c.queryParams,skipBrowserRedirect:!0});return await Gt(this.fetch,"GET",m,{headers:this.headers,jwt:(d=(h=g.session)===null||h===void 0?void 0:h.access_token)!==null&&d!==void 0?d:void 0})});if(a)throw a;return Ga()&&!(!((n=e.options)===null||n===void 0)&&n.skipBrowserRedirect)&&window.location.assign(r==null?void 0:r.url),this._returnResult({data:{provider:e.provider,url:r==null?void 0:r.url},error:null})}catch(r){if(Tt(r))return this._returnResult({data:{provider:e.provider,url:null},error:r});throw r}}async linkIdentityIdToken(e){return await this._useSession(async n=>{var r;try{const{error:a,data:{session:s}}=n;if(a)throw a;const{options:l,provider:u,token:c,access_token:h,nonce:d}=e,g=await Gt(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:(r=s==null?void 0:s.access_token)!==null&&r!==void 0?r:void 0,body:{provider:u,id_token:c,access_token:h,nonce:d,link_identity:!0,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken}},xform:eo}),{data:y,error:m}=g;return m?this._returnResult({data:{user:null,session:null},error:m}):!y||!y.session||!y.user?this._returnResult({data:{user:null,session:null},error:new Zc}):(y.session&&(await this._saveSession(y.session),await this._notifyAllSubscribers("USER_UPDATED",y.session)),this._returnResult({data:y,error:m}))}catch(a){if(await Va(this.storage,`${this.storageKey}-code-verifier`),Tt(a))return this._returnResult({data:{user:null,session:null},error:a});throw a}})}async unlinkIdentity(e){try{return await this._useSession(async n=>{var r,a;const{data:s,error:l}=n;if(l)throw l;return await Gt(this.fetch,"DELETE",`${this.url}/user/identities/${e.identity_id}`,{headers:this.headers,jwt:(a=(r=s.session)===null||r===void 0?void 0:r.access_token)!==null&&a!==void 0?a:void 0})})}catch(n){if(Tt(n))return this._returnResult({data:null,error:n});throw n}}async _refreshAccessToken(e){const n=`#_refreshAccessToken(${e.substring(0,5)}...)`;this._debug(n,"begin");try{const r=Date.now();return await qT(async a=>(a>0&&await zT(200*Math.pow(2,a-1)),this._debug(n,"refreshing attempt",a),await Gt(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:eo})),(a,s)=>{const l=200*Math.pow(2,a);return s&&H0(s)&&Date.now()+l-r<mf})}catch(r){if(this._debug(n,"error",r),Tt(r))return this._returnResult({data:{session:null,user:null},error:r});throw r}finally{this._debug(n,"end")}}_isValidSession(e){return typeof e=="object"&&e!==null&&"access_token"in e&&"refresh_token"in e&&"expires_at"in e}async _handleProviderSignIn(e,n){const r=await this._getUrlForProvider(`${this.url}/authorize`,e,{redirectTo:n.redirectTo,scopes:n.scopes,queryParams:n.queryParams});return this._debug("#_handleProviderSignIn()","provider",e,"options",n,"url",r),Ga()&&!n.skipBrowserRedirect&&window.location.assign(r),{data:{provider:e,url:r},error:null}}async _recoverAndRefresh(){var e,n;const r="#_recoverAndRefresh()";this._debug(r,"begin");try{const a=await qu(this.storage,this.storageKey);if(a&&this.userStorage){let l=await qu(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!l&&(l={user:a.user},await gf(this.userStorage,this.storageKey+"-user",l)),a.user=(e=l==null?void 0:l.user)!==null&&e!==void 0?e:Y0()}else if(a&&!a.user&&!a.user){const l=await qu(this.storage,this.storageKey+"-user");l&&(l!=null&&l.user)?(a.user=l.user,await Va(this.storage,this.storageKey+"-user"),await gf(this.storage,this.storageKey,a)):a.user=Y0()}if(this._debug(r,"session from storage",a),!this._isValidSession(a)){this._debug(r,"session is not valid"),a!==null&&await this._removeSession();return}const s=((n=a.expires_at)!==null&&n!==void 0?n:1/0)*1e3-Date.now()<q0;if(this._debug(r,`session has${s?"":" not"} expired with margin of ${q0}s`),s){if(this.autoRefreshToken&&a.refresh_token){const{error:l}=await this._callRefreshToken(a.refresh_token);l&&(console.error(l),H0(l)||(this._debug(r,"refresh failed with a non-retryable error, removing the session",l),await this._removeSession()))}}else if(a.user&&a.user.__isUserNotAvailableProxy===!0)try{const{data:l,error:u}=await this._getUser(a.access_token);!u&&(l!=null&&l.user)?(a.user=l.user,await this._saveSession(a),await this._notifyAllSubscribers("SIGNED_IN",a)):this._debug(r,"could not get user data, skipping SIGNED_IN notification")}catch(l){console.error("Error getting user data:",l),this._debug(r,"error getting user data, skipping SIGNED_IN notification",l)}else await this._notifyAllSubscribers("SIGNED_IN",a)}catch(a){this._debug(r,"error",a),console.error(a);return}finally{this._debug(r,"end")}}async _callRefreshToken(e){var n,r;if(!e)throw new Zi;if(this.refreshingDeferred)return this.refreshingDeferred.promise;const a=`#_callRefreshToken(${e.substring(0,5)}...)`;this._debug(a,"begin");try{this.refreshingDeferred=new Wm;const{data:s,error:l}=await this._refreshAccessToken(e);if(l)throw l;if(!s.session)throw new Zi;await this._saveSession(s.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",s.session);const u={data:s.session,error:null};return this.refreshingDeferred.resolve(u),u}catch(s){if(this._debug(a,"error",s),Tt(s)){const l={data:null,error:s};return H0(s)||await this._removeSession(),(n=this.refreshingDeferred)===null||n===void 0||n.resolve(l),l}throw(r=this.refreshingDeferred)===null||r===void 0||r.reject(s),s}finally{this.refreshingDeferred=null,this._debug(a,"end")}}async _notifyAllSubscribers(e,n,r=!0){const a=`#_notifyAllSubscribers(${e})`;this._debug(a,"begin",n,`broadcast = ${r}`);try{this.broadcastChannel&&r&&this.broadcastChannel.postMessage({event:e,session:n});const s=[],l=Array.from(this.stateChangeEmitters.values()).map(async u=>{try{await u.callback(e,n)}catch(c){s.push(c)}});if(await Promise.all(l),s.length>0){for(let u=0;u<s.length;u+=1)console.error(s[u]);throw s[0]}}finally{this._debug(a,"end")}}async _saveSession(e){this._debug("#_saveSession()",e),this.suppressGetSessionWarning=!0,await Va(this.storage,`${this.storageKey}-code-verifier`);const n=Object.assign({},e),r=n.user&&n.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!r&&n.user&&await gf(this.userStorage,this.storageKey+"-user",{user:n.user});const a=Object.assign({},n);delete a.user;const s=Z5(a);await gf(this.storage,this.storageKey,s)}else{const a=Z5(n);await gf(this.storage,this.storageKey,a)}}async _removeSession(){this._debug("#_removeSession()"),this.suppressGetSessionWarning=!1,await Va(this.storage,this.storageKey),await Va(this.storage,this.storageKey+"-code-verifier"),await Va(this.storage,this.storageKey+"-user"),this.userStorage&&await Va(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const e=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{e&&Ga()&&(window!=null&&window.removeEventListener)&&window.removeEventListener("visibilitychange",e)}catch(n){console.error("removing visibilitychange callback failed",n)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const e=setInterval(()=>this._autoRefreshTokenTick(),mf);this.autoRefreshTicker=e,e&&typeof e=="object"&&typeof e.unref=="function"?e.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(e);const n=setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0);this.autoRefreshTickTimeout=n,n&&typeof n=="object"&&typeof n.unref=="function"?n.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(n)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const e=this.autoRefreshTicker;this.autoRefreshTicker=null,e&&clearInterval(e);const n=this.autoRefreshTickTimeout;this.autoRefreshTickTimeout=null,n&&clearTimeout(n)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,async()=>{try{const e=Date.now();try{return await this._useSession(async n=>{const{data:{session:r}}=n;if(!r||!r.refresh_token||!r.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const a=Math.floor((r.expires_at*1e3-e)/mf);this._debug("#_autoRefreshTokenTick()",`access token expires in ${a} ticks, a tick lasts ${mf}ms, refresh threshold is ${uv} ticks`),a<=uv&&await this._callRefreshToken(r.refresh_token)})}catch(n){console.error("Auto refresh tick failed with error. This is likely a transient error.",n)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(e){if(e.isAcquireTimeout||e instanceof f4)this._debug("auto refresh token tick lock not available");else throw e}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!Ga()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>await this._onVisibilityChanged(!1),window==null||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(e){console.error("_handleVisibilityChange",e)}}async _onVisibilityChanged(e){const n=`#_onVisibilityChanged(${e})`;this._debug(n,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),e||(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{if(document.visibilityState!=="visible"){this._debug(n,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(e,n,r){const a=[`provider=${encodeURIComponent(n)}`];if(r!=null&&r.redirectTo&&a.push(`redirect_to=${encodeURIComponent(r.redirectTo)}`),r!=null&&r.scopes&&a.push(`scopes=${encodeURIComponent(r.scopes)}`),this.flowType==="pkce"){const[s,l]=await Qc(this.storage,this.storageKey),u=new URLSearchParams({code_challenge:`${encodeURIComponent(s)}`,code_challenge_method:`${encodeURIComponent(l)}`});a.push(u.toString())}if(r!=null&&r.queryParams){const s=new URLSearchParams(r.queryParams);a.push(s.toString())}return r!=null&&r.skipBrowserRedirect&&a.push(`skip_http_redirect=${r.skipBrowserRedirect}`),`${e}?${a.join("&")}`}async _unenroll(e){try{return await this._useSession(async n=>{var r;const{data:a,error:s}=n;return s?this._returnResult({data:null,error:s}):await Gt(this.fetch,"DELETE",`${this.url}/factors/${e.factorId}`,{headers:this.headers,jwt:(r=a==null?void 0:a.session)===null||r===void 0?void 0:r.access_token})})}catch(n){if(Tt(n))return this._returnResult({data:null,error:n});throw n}}async _enroll(e){try{return await this._useSession(async n=>{var r,a;const{data:s,error:l}=n;if(l)return this._returnResult({data:null,error:l});const u=Object.assign({friendly_name:e.friendlyName,factor_type:e.factorType},e.factorType==="phone"?{phone:e.phone}:e.factorType==="totp"?{issuer:e.issuer}:{}),{data:c,error:h}=await Gt(this.fetch,"POST",`${this.url}/factors`,{body:u,headers:this.headers,jwt:(r=s==null?void 0:s.session)===null||r===void 0?void 0:r.access_token});return h?this._returnResult({data:null,error:h}):(e.factorType==="totp"&&c.type==="totp"&&(!((a=c==null?void 0:c.totp)===null||a===void 0)&&a.qr_code)&&(c.totp.qr_code=`data:image/svg+xml;utf-8,${c.totp.qr_code}`),this._returnResult({data:c,error:null}))})}catch(n){if(Tt(n))return this._returnResult({data:null,error:n});throw n}}async _verify(e){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async n=>{var r;const{data:a,error:s}=n;if(s)return this._returnResult({data:null,error:s});const l=Object.assign({challenge_id:e.challengeId},"webauthn"in e?{webauthn:Object.assign(Object.assign({},e.webauthn),{credential_response:e.webauthn.type==="create"?bL(e.webauthn.credential_response):wL(e.webauthn.credential_response)})}:{code:e.code}),{data:u,error:c}=await Gt(this.fetch,"POST",`${this.url}/factors/${e.factorId}/verify`,{body:l,headers:this.headers,jwt:(r=a==null?void 0:a.session)===null||r===void 0?void 0:r.access_token});return c?this._returnResult({data:null,error:c}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+u.expires_in},u)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",u),this._returnResult({data:u,error:c}))})}catch(n){if(Tt(n))return this._returnResult({data:null,error:n});throw n}})}async _challenge(e){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async n=>{var r;const{data:a,error:s}=n;if(s)return this._returnResult({data:null,error:s});const l=await Gt(this.fetch,"POST",`${this.url}/factors/${e.factorId}/challenge`,{body:e,headers:this.headers,jwt:(r=a==null?void 0:a.session)===null||r===void 0?void 0:r.access_token});if(l.error)return l;const{data:u}=l;if(u.type!=="webauthn")return{data:u,error:null};switch(u.webauthn.type){case"create":return{data:Object.assign(Object.assign({},u),{webauthn:Object.assign(Object.assign({},u.webauthn),{credential_options:Object.assign(Object.assign({},u.webauthn.credential_options),{publicKey:vL(u.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},u),{webauthn:Object.assign(Object.assign({},u.webauthn),{credential_options:Object.assign(Object.assign({},u.webauthn.credential_options),{publicKey:yL(u.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(n){if(Tt(n))return this._returnResult({data:null,error:n});throw n}})}async _challengeAndVerify(e){const{data:n,error:r}=await this._challenge({factorId:e.factorId});return r?this._returnResult({data:null,error:r}):await this._verify({factorId:e.factorId,challengeId:n.id,code:e.code})}async _listFactors(){var e;const{data:{user:n},error:r}=await this.getUser();if(r)return{data:null,error:r};const a={all:[],phone:[],totp:[],webauthn:[]};for(const s of(e=n==null?void 0:n.factors)!==null&&e!==void 0?e:[])a.all.push(s),s.status==="verified"&&a[s.factor_type].push(s);return{data:a,error:null}}async _getAuthenticatorAssuranceLevel(){var e,n;const{data:{session:r},error:a}=await this.getSession();if(a)return this._returnResult({data:null,error:a});if(!r)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:s}=V0(r.access_token);let l=null;s.aal&&(l=s.aal);let u=l;((n=(e=r.user.factors)===null||e===void 0?void 0:e.filter(d=>d.status==="verified"))!==null&&n!==void 0?n:[]).length>0&&(u="aal2");const h=s.amr||[];return{data:{currentLevel:l,nextLevel:u,currentAuthenticationMethods:h},error:null}}async _getAuthorizationDetails(e){try{return await this._useSession(async n=>{const{data:{session:r},error:a}=n;return a?this._returnResult({data:null,error:a}):r?await Gt(this.fetch,"GET",`${this.url}/oauth/authorizations/${e}`,{headers:this.headers,jwt:r.access_token,xform:s=>({data:s,error:null})}):this._returnResult({data:null,error:new Zi})})}catch(n){if(Tt(n))return this._returnResult({data:null,error:n});throw n}}async _approveAuthorization(e,n){try{return await this._useSession(async r=>{const{data:{session:a},error:s}=r;if(s)return this._returnResult({data:null,error:s});if(!a)return this._returnResult({data:null,error:new Zi});const l=await Gt(this.fetch,"POST",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:a.access_token,body:{action:"approve"},xform:u=>({data:u,error:null})});return l.data&&l.data.redirect_url&&Ga()&&!(n!=null&&n.skipBrowserRedirect)&&window.location.assign(l.data.redirect_url),l})}catch(r){if(Tt(r))return this._returnResult({data:null,error:r});throw r}}async _denyAuthorization(e,n){try{return await this._useSession(async r=>{const{data:{session:a},error:s}=r;if(s)return this._returnResult({data:null,error:s});if(!a)return this._returnResult({data:null,error:new Zi});const l=await Gt(this.fetch,"POST",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:a.access_token,body:{action:"deny"},xform:u=>({data:u,error:null})});return l.data&&l.data.redirect_url&&Ga()&&!(n!=null&&n.skipBrowserRedirect)&&window.location.assign(l.data.redirect_url),l})}catch(r){if(Tt(r))return this._returnResult({data:null,error:r});throw r}}async _listOAuthGrants(){try{return await this._useSession(async e=>{const{data:{session:n},error:r}=e;return r?this._returnResult({data:null,error:r}):n?await Gt(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:n.access_token,xform:a=>({data:a,error:null})}):this._returnResult({data:null,error:new Zi})})}catch(e){if(Tt(e))return this._returnResult({data:null,error:e});throw e}}async _revokeOAuthGrant(e){try{return await this._useSession(async n=>{const{data:{session:r},error:a}=n;return a?this._returnResult({data:null,error:a}):r?(await Gt(this.fetch,"DELETE",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:r.access_token,query:{client_id:e.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new Zi})})}catch(n){if(Tt(n))return this._returnResult({data:null,error:n});throw n}}async fetchJwk(e,n={keys:[]}){let r=n.keys.find(u=>u.kid===e);if(r)return r;const a=Date.now();if(r=this.jwks.keys.find(u=>u.kid===e),r&&this.jwks_cached_at+CT>a)return r;const{data:s,error:l}=await Gt(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(l)throw l;return!s.keys||s.keys.length===0||(this.jwks=s,this.jwks_cached_at=a,r=s.keys.find(u=>u.kid===e),!r)?null:r}async getClaims(e,n={}){try{let r=e;if(!r){const{data:m,error:x}=await this.getSession();if(x||!m.session)return this._returnResult({data:null,error:x});r=m.session.access_token}const{header:a,payload:s,signature:l,raw:{header:u,payload:c}}=V0(r);n!=null&&n.allowExpired||JT(s.exp);const h=!a.alg||a.alg.startsWith("HS")||!a.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(a.kid,n!=null&&n.keys?{keys:n.keys}:n==null?void 0:n.jwks);if(!h){const{error:m}=await this.getUser(r);if(m)throw m;return{data:{claims:s,header:a,signature:l},error:null}}const d=XT(a.alg),g=await crypto.subtle.importKey("jwk",h,d,!0,["verify"]);if(!await crypto.subtle.verify(d,g,l,IT(`${u}.${c}`)))throw new hv("Invalid JWT signature");return{data:{claims:s,header:a,signature:l},error:null}}catch(r){if(Tt(r))return this._returnResult({data:null,error:r});throw r}}}Zh.nextInstanceID={};const LL=Zh,OL="2.90.1";let Mh="";typeof Deno<"u"?Mh="deno":typeof document<"u"?Mh="web":typeof navigator<"u"&&navigator.product==="ReactNative"?Mh="react-native":Mh="node";const jL={"X-Client-Info":`supabase-js-${Mh}/${OL}`},RL={headers:jL},DL={schema:"public"},kL={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},ML={};function Qh(t){"@babel/helpers - typeof";return Qh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Qh(t)}function PL(t,e){if(Qh(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(Qh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function IL(t){var e=PL(t,"string");return Qh(e)=="symbol"?e:e+""}function FL(t,e,n){return(e=IL(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function iw(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),n.push.apply(n,r)}return n}function Vr(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?iw(Object(n),!0).forEach(function(r){FL(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):iw(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}const UL=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),BL=()=>Headers,$L=(t,e,n)=>{const r=UL(n),a=BL();return async(s,l)=>{var u;const c=(u=await e())!==null&&u!==void 0?u:t;let h=new a(l==null?void 0:l.headers);return h.has("apikey")||h.set("apikey",t),h.has("Authorization")||h.set("Authorization",`Bearer ${c}`),r(s,Vr(Vr({},l),{},{headers:h}))}};function zL(t){return t.endsWith("/")?t:t+"/"}function qL(t,e){var n,r;const{db:a,auth:s,realtime:l,global:u}=t,{db:c,auth:h,realtime:d,global:g}=e,y={db:Vr(Vr({},c),a),auth:Vr(Vr({},h),s),realtime:Vr(Vr({},d),l),storage:{},global:Vr(Vr(Vr({},g),u),{},{headers:Vr(Vr({},(n=g==null?void 0:g.headers)!==null&&n!==void 0?n:{}),(r=u==null?void 0:u.headers)!==null&&r!==void 0?r:{})}),accessToken:async()=>""};return t.accessToken?y.accessToken=t.accessToken:delete y.accessToken,y}function HL(t){const e=t==null?void 0:t.trim();if(!e)throw new Error("supabaseUrl is required.");if(!e.match(/^https?:\/\//i))throw new Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(zL(e))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}var VL=class extends LL{constructor(t){super(t)}},YL=class{constructor(t,e,n){var r,a;this.supabaseUrl=t,this.supabaseKey=e;const s=HL(t);if(!e)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",s),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",s),this.storageUrl=new URL("storage/v1",s),this.functionsUrl=new URL("functions/v1",s);const l=`sb-${s.hostname.split(".")[0]}-auth-token`,u={db:DL,realtime:ML,auth:Vr(Vr({},kL),{},{storageKey:l}),global:RL},c=qL(n??{},u);if(this.storageKey=(r=c.auth.storageKey)!==null&&r!==void 0?r:"",this.headers=(a=c.global.headers)!==null&&a!==void 0?a:{},c.accessToken)this.accessToken=c.accessToken,this.auth=new Proxy({},{get:(d,g)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(g)} is not possible`)}});else{var h;this.auth=this._initSupabaseAuthClient((h=c.auth)!==null&&h!==void 0?h:{},this.headers,c.global.fetch)}this.fetch=$L(e,this._getAccessToken.bind(this),c.global.fetch),this.realtime=this._initRealtimeClient(Vr({headers:this.headers,accessToken:this._getAccessToken.bind(this)},c.realtime)),this.accessToken&&this.accessToken().then(d=>this.realtime.setAuth(d)).catch(d=>console.warn("Failed to set initial Realtime auth token:",d)),this.rest=new A8(new URL("rest/v1",s).href,{headers:this.headers,schema:c.db.schema,fetch:this.fetch}),this.storage=new ST(this.storageUrl.href,this.headers,this.fetch,n==null?void 0:n.storage),c.accessToken||this._listenForAuthEvents()}get functions(){return new w8(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(t){return this.rest.from(t)}schema(t){return this.rest.schema(t)}rpc(t,e={},n={head:!1,get:!1,count:void 0}){return this.rest.rpc(t,e,n)}channel(t,e={config:{}}){return this.realtime.channel(t,e)}getChannels(){return this.realtime.getChannels()}removeChannel(t){return this.realtime.removeChannel(t)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var t=this,e,n;if(t.accessToken)return await t.accessToken();const{data:r}=await t.auth.getSession();return(e=(n=r.session)===null||n===void 0?void 0:n.access_token)!==null&&e!==void 0?e:t.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:t,persistSession:e,detectSessionInUrl:n,storage:r,userStorage:a,storageKey:s,flowType:l,lock:u,debug:c,throwOnError:h},d,g){const y={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new VL({url:this.authUrl.href,headers:Vr(Vr({},y),d),storageKey:s,autoRefreshToken:t,persistSession:e,detectSessionInUrl:n,storage:r,userStorage:a,flowType:l,lock:u,debug:c,throwOnError:h,fetch:g,hasCustomAuthorizationHeader:Object.keys(this.headers).some(m=>m.toLowerCase()==="authorization")})}_initRealtimeClient(t){return new z8(this.realtimeUrl.href,Vr(Vr({},t),{},{params:Vr(Vr({},{apikey:this.supabaseKey}),t==null?void 0:t.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((t,e)=>{this._handleTokenChanged(t,"CLIENT",e==null?void 0:e.access_token)})}_handleTokenChanged(t,e,n){(t==="TOKEN_REFRESHED"||t==="SIGNED_IN")&&this.changedAccessToken!==n?(this.changedAccessToken=n,this.realtime.setAuth(n)):t==="SIGNED_OUT"&&(this.realtime.setAuth(),e=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};const GL=(t,e,n)=>new YL(t,e,n);function WL(){if(typeof window<"u")return!1;const t=globalThis.process;if(!t)return!1;const e=t.version;if(e==null)return!1;const n=e.match(/^v(\d+)\./);return n?parseInt(n[1],10)<=18:!1}WL()&&console.warn("⚠️ Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217");const KL="https://yhbphdjhoxovcxfoimdx.supabase.co",JL="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InloYnBoZGpob3hvdmN4Zm9pbWR4Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3Njc2NTkwMDUsImV4cCI6MjA4MzIzNTAwNX0.kf2JdL8_xep-8XFp8uRvOh4d6ZoBKRF8-uhtjncrxAM",ft=GL(KL,JL),dv=(t,e)=>e.some(n=>t instanceof n);let sw,ow;function XL(){return sw||(sw=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function ZL(){return ow||(ow=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const pv=new WeakMap,W0=new WeakMap,Km=new WeakMap;function QL(t){const e=new Promise((n,r)=>{const a=()=>{t.removeEventListener("success",s),t.removeEventListener("error",l)},s=()=>{n(Zu(t.result)),a()},l=()=>{r(t.error),a()};t.addEventListener("success",s),t.addEventListener("error",l)});return Km.set(e,t),e}function eO(t){if(pv.has(t))return;const e=new Promise((n,r)=>{const a=()=>{t.removeEventListener("complete",s),t.removeEventListener("error",l),t.removeEventListener("abort",l)},s=()=>{n(),a()},l=()=>{r(t.error||new DOMException("AbortError","AbortError")),a()};t.addEventListener("complete",s),t.addEventListener("error",l),t.addEventListener("abort",l)});pv.set(t,e)}let mv={get(t,e,n){if(t instanceof IDBTransaction){if(e==="done")return pv.get(t);if(e==="store")return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return Zu(t[e])},set(t,e,n){return t[e]=n,!0},has(t,e){return t instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in t}};function p4(t){mv=t(mv)}function tO(t){return ZL().includes(t)?function(...e){return t.apply(gv(this),e),Zu(this.request)}:function(...e){return Zu(t.apply(gv(this),e))}}function nO(t){return typeof t=="function"?tO(t):(t instanceof IDBTransaction&&eO(t),dv(t,XL())?new Proxy(t,mv):t)}function Zu(t){if(t instanceof IDBRequest)return QL(t);if(W0.has(t))return W0.get(t);const e=nO(t);return e!==t&&(W0.set(t,e),Km.set(e,t)),e}const gv=t=>Km.get(t);function Gr(t,e,{blocked:n,upgrade:r,blocking:a,terminated:s}={}){const l=indexedDB.open(t,e),u=Zu(l);return r&&l.addEventListener("upgradeneeded",c=>{r(Zu(l.result),c.oldVersion,c.newVersion,Zu(l.transaction),c)}),n&&l.addEventListener("blocked",c=>n(c.oldVersion,c.newVersion,c)),u.then(c=>{s&&c.addEventListener("close",()=>s()),a&&c.addEventListener("versionchange",h=>a(h.oldVersion,h.newVersion,h))}).catch(()=>{}),u}const rO=["get","getKey","getAll","getAllKeys","count"],aO=["put","add","delete","clear"],K0=new Map;function lw(t,e){if(!(t instanceof IDBDatabase&&!(e in t)&&typeof e=="string"))return;if(K0.get(e))return K0.get(e);const n=e.replace(/FromIndex$/,""),r=e!==n,a=aO.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!(a||rO.includes(n)))return;const s=async function(l,...u){const c=this.transaction(l,a?"readwrite":"readonly");let h=c.store;return r&&(h=h.index(u.shift())),(await Promise.all([h[n](...u),a&&c.done]))[0]};return K0.set(e,s),s}p4(t=>({...t,get:(e,n,r)=>lw(e,n)||t.get(e,n,r),has:(e,n)=>!!lw(e,n)||t.has(e,n)}));const iO=["continue","continuePrimaryKey","advance"],uw={},vv=new WeakMap,m4=new WeakMap,sO={get(t,e){if(!iO.includes(e))return t[e];let n=uw[e];return n||(n=uw[e]=function(...r){vv.set(this,m4.get(this)[e](...r))}),n}};async function*oO(...t){let e=this;if(e instanceof IDBCursor||(e=await e.openCursor(...t)),!e)return;e=e;const n=new Proxy(e,sO);for(m4.set(n,e),Km.set(n,gv(e));e;)yield n,e=await(vv.get(n)||e.continue()),vv.delete(n)}function cw(t,e){return e===Symbol.asyncIterator&&dv(t,[IDBIndex,IDBObjectStore,IDBCursor])||e==="iterate"&&dv(t,[IDBIndex,IDBObjectStore])}p4(t=>({...t,get(e,n,r){return cw(e,n)?oO:t.get(e,n,r)},has(e,n){return cw(e,n)||t.has(e,n)}}));const g4="site-language-db",Ef="mosqueLanguage";async function fw(t,e){await(await Gr(g4,1,{upgrade(r){r.objectStoreNames.contains(Ef)||r.createObjectStore(Ef)}})).put(Ef,e,t)}async function hw(t){return(await Gr(g4,1,{upgrade(n){n.objectStoreNames.contains(Ef)||n.createObjectStore(Ef)}})).get(Ef,t)}const lO=t=>({no:1,en:2,ar:3})[t]||2,yv=t=>({1:"no",2:"en",3:"ar"})[t]||"en";function Sl(t){const[e,n]=k.useState(null),[r,a]=k.useState(!0);return k.useEffect(()=>{if(!t){n("en"),a(!1);return}let s=null;return(async()=>{if(a(!0),!navigator.onLine){const u=await hw(t);if(u){n(u),a(!1);return}}try{const{data:u}=await ft.from("mosque_t").select("language").eq("organisasjonsnummer",t).single(),c=(u==null?void 0:u.language)||2,h=yv(c);await fw(t,h),n(h)}catch(u){const c=await hw(t);c&&n(c),console.error("Error fetching mosque language:",u)}finally{a(!1)}})(),s=ft.channel(`mosque_language_changes:${t}`).on("postgres_changes",{event:"*",schema:"public",table:"mosque_t",filter:`organisasjonsnummer=eq.${t}`},async u=>{var h;const c=(h=u.new)==null?void 0:h.language;c&&(await fw(t,c),n(c))}).subscribe(),()=>{s==null||s.unsubscribe()}},[t]),{language:e,loading:r}}var v4={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},dw=yn.createContext&&yn.createContext(v4),uO=["attr","size","title"];function cO(t,e){if(t==null)return{};var n=fO(t,e),r,a;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(a=0;a<s.length;a++)r=s[a],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function fO(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function dm(){return dm=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},dm.apply(this,arguments)}function pw(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),n.push.apply(n,r)}return n}function pm(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?pw(Object(n),!0).forEach(function(r){hO(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):pw(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function hO(t,e,n){return e=dO(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function dO(t){var e=pO(t,"string");return typeof e=="symbol"?e:e+""}function pO(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function y4(t){return t&&t.map((e,n)=>yn.createElement(e.tag,pm({key:n},e.attr),y4(e.child)))}function Aa(t){return e=>yn.createElement(mO,dm({attr:pm({},t.attr)},e),y4(t.child))}function mO(t){var e=n=>{var{attr:r,size:a,title:s}=t,l=cO(t,uO),u=a||n.size||"1em",c;return n.className&&(c=n.className),t.className&&(c=(c?c+" ":"")+t.className),yn.createElement("svg",dm({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,r,l,{className:c,style:pm(pm({color:t.color||n.color},n.style),t.style),height:u,width:u,xmlns:"http://www.w3.org/2000/svg"}),s&&yn.createElement("title",null,s),t.children)};return dw!==void 0?yn.createElement(dw.Consumer,null,n=>e(n)):e(v4)}function dd(t){return Aa({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 32l-64 80h32v64h64v-64h32l-64-80zm-9 187v80h18v-80h-18zm-63.992 53.602l-16.631 6.886 15.309 36.955 16.628-6.886-15.306-36.955zm145.984 0l-15.306 36.955 16.628 6.886 15.309-36.955-16.63-6.886zM77.795 284.068l-12.727 12.727 56.569 56.568 12.726-12.726-56.568-56.569zm356.41 0l-56.568 56.569 12.726 12.726 56.569-56.568-12.727-12.727zM256 337.994a118.919 118.919 0 0 0-59.5 15.95c-34.215 19.754-56.177 55.048-59.129 94.056H374.63c-2.952-39.008-24.914-74.302-59.129-94.057a118.919 118.919 0 0 0-59.5-15.949zM66.488 387.377l-6.886 16.63 36.955 15.307 6.886-16.628-36.955-15.309zm379.024 0l-36.955 15.309 6.886 16.628 36.955-15.306-6.886-16.631zM24 466v18h464v-18H24z"},child:[]}]})(t)}const mw=t=>{const[e,n]=t.split(":").map(Number);return e*60+n};function gO({prayerTimes:t,extraInfo:e,prayerTimesColor:n,extraInfoColor:r,isDefault:a}){const{org_nr:s}=xr(),{t:l}=kr(),u=new Date,c=u.getHours()*60+u.getMinutes(),h=t.findIndex(m=>mw(m.adhan)>c),{language:d}=Sl(s||void 0),{darkMode:g}=Ea(),y=d==="ar";return _.jsx("div",{className:"font-chakra ",style:{color:g?"#F2E7D5":n.text},children:_.jsxs("div",{className:"backdrop-blur-md rounded-4xl p- shadow-sm min-w-[340px] dark:bg-gradient-to-r dark:from-[#1C1B1BBF] dark:to-[#13121299]",style:{backgroundColor:g?"":a?K_(n.bg,.75):n.bg},dir:y?"rtl":"ltr",children:[_.jsxs("div",{className:"table w-full border-b-2 border-[#00000026] dark:border-[#F2E7D530] p-6",children:[_.jsx("div",{className:"table-header-group w-full text-md md:text-lg 2xl:text-2xl font-bold",style:{color:g?"#F2E7D5":a?"#53452E":n.text},children:_.jsxs("div",{className:"table-row",children:[_.jsx("div",{className:`table-cell py-4 pl-2 ${y?"text-right":"text-left"} border-b-2 border-[#00000026] dark:border-[#F2E7D530]`,children:l("SALAH")}),!y&&_.jsx("div",{className:"table-cell py-2 text-right border-b-2 border-[#00000026] dark:border-[#F2E7D530]"}),_.jsx("div",{className:"table-cell py-2 text-center border-b-2 border-[#00000026] dark:border-[#F2E7D530]",children:l("ADHAN")}),_.jsx("div",{className:"table-cell py-2 text-center border-b-2 border-[#00000026] dark:border-[#F2E7D530]",children:l("IQAMAH")}),_.jsx("div",{className:"table-cell py-2 text-center border-b-2 border-[#00000026] dark:border-[#F2E7D530]",children:l("TOMORROW")})]})}),_.jsx("div",{className:"table-row-group w-full text-md md:text-lg 2xl:text-2xl",children:t.map((m,x)=>{const E=mw(m.adhan),A=x===h,O=E<c&&!A?"opacity-40 dark:text-[#F2E7D5]":"",T={backgroundColor:g?"#54462E":a?"#CFB78F":r.bg,color:a?"":r.text,borderBlockColor:g?"#F2E7DF":a?"#53452E":r.text};return _.jsxs("div",{className:"table-row overflow-hidden text-lg md:text-xl lg:text-3xl",children:[_.jsx("div",{className:`table-cell py-2 pl-2 ${y?"text-right":"text-left"} font-bold ${A?y?"border-r-2 border-y-2 rounded-r-xl":"border-l-2 border-y-2 rounded-l-xl":""}`,style:A?T:{},children:m.name==="Fajr end"?_.jsx(dd,{color:"orange",size:28}):l(m.name.toUpperCase())}),!y&&_.jsx("div",{className:`table-cell py-2 text-right ${A&&"border-y-2"}`,style:A?T:{},children:m.arabic?l(m.arabic.toUpperCase()):""}),_.jsx("div",{className:`table-cell py-2 text-center font-bold ${O} ${A&&"border-y-2"}`,style:A?T:{},children:m.adhan}),_.jsx("div",{className:`table-cell py-2 text-center font-semibold ${O} ${A?y?"border-l-2 border-y-2 rounded-l-xl":"border-r-2 border-y-2 rounded-r-xl":""}`,style:A?T:{},children:m.iqamah}),_.jsx("div",{className:"table-cell py-2 text-center font-semibold",children:m.tomorrow})]},x)})})]}),_.jsx("div",{className:"px-8 py-6 font-semibold rounded-b-4xl text-lg md:text-xl 2xl:text-3xl",style:{color:g?"#F2E7D5":r.text,backgroundColor:g?"#54462E":a?"#CFB78F":r.bg},children:_.jsx("div",{className:y?"w-[55%]":"",children:e.filter(m=>m.label==="Eid"?Array.isArray(m.time)&&m.time.some(x=>x&&x.trim()!==""):!0).map((m,x)=>_.jsxs("div",{className:"flex justify-between py-2",children:[_.jsx("div",{className:"w-2/5",children:l(m==null?void 0:m.label.toUpperCase())}),Array.isArray(m.time)?(y?[2,1,0]:[0,1,2]).map(E=>_.jsx("div",{className:"w-1/4 md:w-1/5 text-center ",children:m.time[E]},E)):_.jsxs(_.Fragment,{children:[_.jsx("div",{className:"w-1/5 text-center ",children:m.time}),_.jsx("div",{className:"w-1/5"}),_.jsx("div",{className:"w-1/5"})]})]},x))})})]})})}const b4="masjid-info-db",mm="masjid_info";async function gw(t){return await(await Gr(b4,1,{upgrade(n){n.createObjectStore(mm)}})).get(mm,t)}async function vO(t,e){await(await Gr(b4,1,{upgrade(r){r.createObjectStore(mm)}})).put(mm,e,t)}function w4(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var a=t.length;for(e=0;e<a;e++)t[e]&&(n=w4(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function Qu(){for(var t,e,n=0,r="",a=arguments.length;n<a;n++)(t=arguments[n])&&(e=w4(t))&&(r&&(r+=" "),r+=e);return r}function yO(t){if(typeof document>"u")return;let e=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",e.firstChild?e.insertBefore(n,e.firstChild):e.appendChild(n),n.styleSheet?n.styleSheet.cssText=t:n.appendChild(document.createTextNode(t))}yO(`:root{--toastify-color-light: #fff;--toastify-color-dark: #121212;--toastify-color-info: #3498db;--toastify-color-success: #07bc0c;--toastify-color-warning: #f1c40f;--toastify-color-error: hsl(6, 78%, 57%);--toastify-color-transparent: rgba(255, 255, 255, .7);--toastify-icon-color-info: var(--toastify-color-info);--toastify-icon-color-success: var(--toastify-color-success);--toastify-icon-color-warning: var(--toastify-color-warning);--toastify-icon-color-error: var(--toastify-color-error);--toastify-container-width: fit-content;--toastify-toast-width: 320px;--toastify-toast-offset: 16px;--toastify-toast-top: max(var(--toastify-toast-offset), env(safe-area-inset-top));--toastify-toast-right: max(var(--toastify-toast-offset), env(safe-area-inset-right));--toastify-toast-left: max(var(--toastify-toast-offset), env(safe-area-inset-left));--toastify-toast-bottom: max(var(--toastify-toast-offset), env(safe-area-inset-bottom));--toastify-toast-background: #fff;--toastify-toast-padding: 14px;--toastify-toast-min-height: 64px;--toastify-toast-max-height: 800px;--toastify-toast-bd-radius: 6px;--toastify-toast-shadow: 0px 4px 12px rgba(0, 0, 0, .1);--toastify-font-family: sans-serif;--toastify-z-index: 9999;--toastify-text-color-light: #757575;--toastify-text-color-dark: #fff;--toastify-text-color-info: #fff;--toastify-text-color-success: #fff;--toastify-text-color-warning: #fff;--toastify-text-color-error: #fff;--toastify-spinner-color: #616161;--toastify-spinner-color-empty-area: #e0e0e0;--toastify-color-progress-light: linear-gradient(to right, #4cd964, #5ac8fa, #007aff, #34aadc, #5856d6, #ff2d55);--toastify-color-progress-dark: #bb86fc;--toastify-color-progress-info: var(--toastify-color-info);--toastify-color-progress-success: var(--toastify-color-success);--toastify-color-progress-warning: var(--toastify-color-warning);--toastify-color-progress-error: var(--toastify-color-error);--toastify-color-progress-bgo: .2}.Toastify__toast-container{z-index:var(--toastify-z-index);-webkit-transform:translate3d(0,0,var(--toastify-z-index));position:fixed;width:var(--toastify-container-width);box-sizing:border-box;color:#fff;display:flex;flex-direction:column}.Toastify__toast-container--top-left{top:var(--toastify-toast-top);left:var(--toastify-toast-left)}.Toastify__toast-container--top-center{top:var(--toastify-toast-top);left:50%;transform:translate(-50%);align-items:center}.Toastify__toast-container--top-right{top:var(--toastify-toast-top);right:var(--toastify-toast-right);align-items:end}.Toastify__toast-container--bottom-left{bottom:var(--toastify-toast-bottom);left:var(--toastify-toast-left)}.Toastify__toast-container--bottom-center{bottom:var(--toastify-toast-bottom);left:50%;transform:translate(-50%);align-items:center}.Toastify__toast-container--bottom-right{bottom:var(--toastify-toast-bottom);right:var(--toastify-toast-right);align-items:end}.Toastify__toast{--y: 0;position:relative;touch-action:none;width:var(--toastify-toast-width);min-height:var(--toastify-toast-min-height);box-sizing:border-box;margin-bottom:1rem;padding:var(--toastify-toast-padding);border-radius:var(--toastify-toast-bd-radius);box-shadow:var(--toastify-toast-shadow);max-height:var(--toastify-toast-max-height);font-family:var(--toastify-font-family);z-index:0;display:flex;flex:1 auto;align-items:center;word-break:break-word}@media only screen and (max-width: 480px){.Toastify__toast-container{width:100vw;left:env(safe-area-inset-left);margin:0}.Toastify__toast-container--top-left,.Toastify__toast-container--top-center,.Toastify__toast-container--top-right{top:env(safe-area-inset-top);transform:translate(0)}.Toastify__toast-container--bottom-left,.Toastify__toast-container--bottom-center,.Toastify__toast-container--bottom-right{bottom:env(safe-area-inset-bottom);transform:translate(0)}.Toastify__toast-container--rtl{right:env(safe-area-inset-right);left:initial}.Toastify__toast{--toastify-toast-width: 100%;margin-bottom:0;border-radius:0}}.Toastify__toast-container[data-stacked=true]{width:var(--toastify-toast-width)}.Toastify__toast--stacked{position:absolute;width:100%;transform:translate3d(0,var(--y),0) scale(var(--s));transition:transform .3s}.Toastify__toast--stacked[data-collapsed] .Toastify__toast-body,.Toastify__toast--stacked[data-collapsed] .Toastify__close-button{transition:opacity .1s}.Toastify__toast--stacked[data-collapsed=false]{overflow:visible}.Toastify__toast--stacked[data-collapsed=true]:not(:last-child)>*{opacity:0}.Toastify__toast--stacked:after{content:"";position:absolute;left:0;right:0;height:calc(var(--g) * 1px);bottom:100%}.Toastify__toast--stacked[data-pos=top]{top:0}.Toastify__toast--stacked[data-pos=bot]{bottom:0}.Toastify__toast--stacked[data-pos=bot].Toastify__toast--stacked:before{transform-origin:top}.Toastify__toast--stacked[data-pos=top].Toastify__toast--stacked:before{transform-origin:bottom}.Toastify__toast--stacked:before{content:"";position:absolute;left:0;right:0;bottom:0;height:100%;transform:scaleY(3);z-index:-1}.Toastify__toast--rtl{direction:rtl}.Toastify__toast--close-on-click{cursor:pointer}.Toastify__toast-icon{margin-inline-end:10px;width:22px;flex-shrink:0;display:flex}.Toastify--animate{animation-fill-mode:both;animation-duration:.5s}.Toastify--animate-icon{animation-fill-mode:both;animation-duration:.3s}.Toastify__toast-theme--dark{background:var(--toastify-color-dark);color:var(--toastify-text-color-dark)}.Toastify__toast-theme--light,.Toastify__toast-theme--colored.Toastify__toast--default{background:var(--toastify-color-light);color:var(--toastify-text-color-light)}.Toastify__toast-theme--colored.Toastify__toast--info{color:var(--toastify-text-color-info);background:var(--toastify-color-info)}.Toastify__toast-theme--colored.Toastify__toast--success{color:var(--toastify-text-color-success);background:var(--toastify-color-success)}.Toastify__toast-theme--colored.Toastify__toast--warning{color:var(--toastify-text-color-warning);background:var(--toastify-color-warning)}.Toastify__toast-theme--colored.Toastify__toast--error{color:var(--toastify-text-color-error);background:var(--toastify-color-error)}.Toastify__progress-bar-theme--light{background:var(--toastify-color-progress-light)}.Toastify__progress-bar-theme--dark{background:var(--toastify-color-progress-dark)}.Toastify__progress-bar--info{background:var(--toastify-color-progress-info)}.Toastify__progress-bar--success{background:var(--toastify-color-progress-success)}.Toastify__progress-bar--warning{background:var(--toastify-color-progress-warning)}.Toastify__progress-bar--error{background:var(--toastify-color-progress-error)}.Toastify__progress-bar-theme--colored.Toastify__progress-bar--info,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--success,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--warning,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--error{background:var(--toastify-color-transparent)}.Toastify__close-button{color:#fff;position:absolute;top:6px;right:6px;background:transparent;outline:none;border:none;padding:0;cursor:pointer;opacity:.7;transition:.3s ease;z-index:1}.Toastify__toast--rtl .Toastify__close-button{left:6px;right:unset}.Toastify__close-button--light{color:#000;opacity:.3}.Toastify__close-button>svg{fill:currentColor;height:16px;width:14px}.Toastify__close-button:hover,.Toastify__close-button:focus{opacity:1}@keyframes Toastify__trackProgress{0%{transform:scaleX(1)}to{transform:scaleX(0)}}.Toastify__progress-bar{position:absolute;bottom:0;left:0;width:100%;height:100%;z-index:1;opacity:.7;transform-origin:left}.Toastify__progress-bar--animated{animation:Toastify__trackProgress linear 1 forwards}.Toastify__progress-bar--controlled{transition:transform .2s}.Toastify__progress-bar--rtl{right:0;left:initial;transform-origin:right;border-bottom-left-radius:initial}.Toastify__progress-bar--wrp{position:absolute;overflow:hidden;bottom:0;left:0;width:100%;height:5px;border-bottom-left-radius:var(--toastify-toast-bd-radius);border-bottom-right-radius:var(--toastify-toast-bd-radius)}.Toastify__progress-bar--wrp[data-hidden=true]{opacity:0}.Toastify__progress-bar--bg{opacity:var(--toastify-color-progress-bgo);width:100%;height:100%}.Toastify__spinner{width:20px;height:20px;box-sizing:border-box;border:2px solid;border-radius:100%;border-color:var(--toastify-spinner-color-empty-area);border-right-color:var(--toastify-spinner-color);animation:Toastify__spin .65s linear infinite}@keyframes Toastify__bounceInRight{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(3000px,0,0)}60%{opacity:1;transform:translate3d(-25px,0,0)}75%{transform:translate3d(10px,0,0)}90%{transform:translate3d(-5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutRight{20%{opacity:1;transform:translate3d(-20px,var(--y),0)}to{opacity:0;transform:translate3d(2000px,var(--y),0)}}@keyframes Toastify__bounceInLeft{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(-3000px,0,0)}60%{opacity:1;transform:translate3d(25px,0,0)}75%{transform:translate3d(-10px,0,0)}90%{transform:translate3d(5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutLeft{20%{opacity:1;transform:translate3d(20px,var(--y),0)}to{opacity:0;transform:translate3d(-2000px,var(--y),0)}}@keyframes Toastify__bounceInUp{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,3000px,0)}60%{opacity:1;transform:translate3d(0,-20px,0)}75%{transform:translate3d(0,10px,0)}90%{transform:translate3d(0,-5px,0)}to{transform:translateZ(0)}}@keyframes Toastify__bounceOutUp{20%{transform:translate3d(0,calc(var(--y) - 10px),0)}40%,45%{opacity:1;transform:translate3d(0,calc(var(--y) + 20px),0)}to{opacity:0;transform:translate3d(0,-2000px,0)}}@keyframes Toastify__bounceInDown{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,-3000px,0)}60%{opacity:1;transform:translate3d(0,25px,0)}75%{transform:translate3d(0,-10px,0)}90%{transform:translate3d(0,5px,0)}to{transform:none}}@keyframes Toastify__bounceOutDown{20%{transform:translate3d(0,calc(var(--y) - 10px),0)}40%,45%{opacity:1;transform:translate3d(0,calc(var(--y) + 20px),0)}to{opacity:0;transform:translate3d(0,2000px,0)}}.Toastify__bounce-enter--top-left,.Toastify__bounce-enter--bottom-left{animation-name:Toastify__bounceInLeft}.Toastify__bounce-enter--top-right,.Toastify__bounce-enter--bottom-right{animation-name:Toastify__bounceInRight}.Toastify__bounce-enter--top-center{animation-name:Toastify__bounceInDown}.Toastify__bounce-enter--bottom-center{animation-name:Toastify__bounceInUp}.Toastify__bounce-exit--top-left,.Toastify__bounce-exit--bottom-left{animation-name:Toastify__bounceOutLeft}.Toastify__bounce-exit--top-right,.Toastify__bounce-exit--bottom-right{animation-name:Toastify__bounceOutRight}.Toastify__bounce-exit--top-center{animation-name:Toastify__bounceOutUp}.Toastify__bounce-exit--bottom-center{animation-name:Toastify__bounceOutDown}@keyframes Toastify__zoomIn{0%{opacity:0;transform:scale3d(.3,.3,.3)}50%{opacity:1}}@keyframes Toastify__zoomOut{0%{opacity:1}50%{opacity:0;transform:translate3d(0,var(--y),0) scale3d(.3,.3,.3)}to{opacity:0}}.Toastify__zoom-enter{animation-name:Toastify__zoomIn}.Toastify__zoom-exit{animation-name:Toastify__zoomOut}@keyframes Toastify__flipIn{0%{transform:perspective(400px) rotateX(90deg);animation-timing-function:ease-in;opacity:0}40%{transform:perspective(400px) rotateX(-20deg);animation-timing-function:ease-in}60%{transform:perspective(400px) rotateX(10deg);opacity:1}80%{transform:perspective(400px) rotateX(-5deg)}to{transform:perspective(400px)}}@keyframes Toastify__flipOut{0%{transform:translate3d(0,var(--y),0) perspective(400px)}30%{transform:translate3d(0,var(--y),0) perspective(400px) rotateX(-20deg);opacity:1}to{transform:translate3d(0,var(--y),0) perspective(400px) rotateX(90deg);opacity:0}}.Toastify__flip-enter{animation-name:Toastify__flipIn}.Toastify__flip-exit{animation-name:Toastify__flipOut}@keyframes Toastify__slideInRight{0%{transform:translate3d(110%,0,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInLeft{0%{transform:translate3d(-110%,0,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInUp{0%{transform:translate3d(0,110%,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInDown{0%{transform:translate3d(0,-110%,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideOutRight{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(110%,var(--y),0)}}@keyframes Toastify__slideOutLeft{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(-110%,var(--y),0)}}@keyframes Toastify__slideOutDown{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(0,500px,0)}}@keyframes Toastify__slideOutUp{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(0,-500px,0)}}.Toastify__slide-enter--top-left,.Toastify__slide-enter--bottom-left{animation-name:Toastify__slideInLeft}.Toastify__slide-enter--top-right,.Toastify__slide-enter--bottom-right{animation-name:Toastify__slideInRight}.Toastify__slide-enter--top-center{animation-name:Toastify__slideInDown}.Toastify__slide-enter--bottom-center{animation-name:Toastify__slideInUp}.Toastify__slide-exit--top-left,.Toastify__slide-exit--bottom-left{animation-name:Toastify__slideOutLeft;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--top-right,.Toastify__slide-exit--bottom-right{animation-name:Toastify__slideOutRight;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--top-center{animation-name:Toastify__slideOutUp;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--bottom-center{animation-name:Toastify__slideOutDown;animation-timing-function:ease-in;animation-duration:.3s}@keyframes Toastify__spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}
104
- `);var pd=t=>typeof t=="number"&&!isNaN(t),nc=t=>typeof t=="string",vl=t=>typeof t=="function",bO=t=>nc(t)||pd(t),bv=t=>nc(t)||vl(t)?t:null,wO=(t,e)=>t===!1||pd(t)&&t>0?t:e,wv=t=>k.isValidElement(t)||nc(t)||vl(t)||pd(t);function xO(t,e,n=300){let{scrollHeight:r,style:a}=t;requestAnimationFrame(()=>{a.minHeight="initial",a.height=r+"px",a.transition=`all ${n}ms`,requestAnimationFrame(()=>{a.height="0",a.padding="0",a.margin="0",setTimeout(e,n)})})}function SO({enter:t,exit:e,appendPosition:n=!1,collapse:r=!0,collapseDuration:a=300}){return function({children:s,position:l,preventExitTransition:u,done:c,nodeRef:h,isIn:d,playToast:g}){let y=n?`${t}--${l}`:t,m=n?`${e}--${l}`:e,x=k.useRef(0);return k.useLayoutEffect(()=>{let E=h.current,A=y.split(" "),N=O=>{O.target===h.current&&(g(),E.removeEventListener("animationend",N),E.removeEventListener("animationcancel",N),x.current===0&&O.type!=="animationcancel"&&E.classList.remove(...A))};E.classList.add(...A),E.addEventListener("animationend",N),E.addEventListener("animationcancel",N)},[]),k.useEffect(()=>{let E=h.current,A=()=>{E.removeEventListener("animationend",A),r?xO(E,c,a):c()};d||(u?A():(x.current=1,E.className+=` ${m}`,E.addEventListener("animationend",A)))},[d]),yn.createElement(yn.Fragment,null,s)}}function vw(t,e){return{content:x4(t.content,t.props),containerId:t.props.containerId,id:t.props.toastId,theme:t.props.theme,type:t.props.type,data:t.props.data||{},isLoading:t.props.isLoading,icon:t.props.icon,reason:t.removalReason,status:e}}function x4(t,e,n=!1){return k.isValidElement(t)&&!nc(t.type)?k.cloneElement(t,{closeToast:e.closeToast,toastProps:e,data:e.data,isPaused:n}):vl(t)?t({closeToast:e.closeToast,toastProps:e,data:e.data,isPaused:n}):t}function _O({closeToast:t,theme:e,ariaLabel:n="close"}){return yn.createElement("button",{className:`Toastify__close-button Toastify__close-button--${e}`,type:"button",onClick:r=>{r.stopPropagation(),t(!0)},"aria-label":n},yn.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},yn.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}function EO({delay:t,isRunning:e,closeToast:n,type:r="default",hide:a,className:s,controlledProgress:l,progress:u,rtl:c,isIn:h,theme:d}){let g=a||l&&u===0,y={animationDuration:`${t}ms`,animationPlayState:e?"running":"paused"};l&&(y.transform=`scaleX(${u})`);let m=Qu("Toastify__progress-bar",l?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${d}`,`Toastify__progress-bar--${r}`,{"Toastify__progress-bar--rtl":c}),x=vl(s)?s({rtl:c,type:r,defaultClassName:m}):Qu(m,s),E={[l&&u>=1?"onTransitionEnd":"onAnimationEnd"]:l&&u<1?null:()=>{h&&n()}};return yn.createElement("div",{className:"Toastify__progress-bar--wrp","data-hidden":g},yn.createElement("div",{className:`Toastify__progress-bar--bg Toastify__progress-bar-theme--${d} Toastify__progress-bar--${r}`}),yn.createElement("div",{role:"progressbar","aria-hidden":g?"true":"false","aria-label":"notification timer",className:x,style:y,...E}))}var AO=1,S4=()=>`${AO++}`;function NO(t,e,n){let r=1,a=0,s=[],l=[],u=e,c=new Map,h=new Set,d=O=>(h.add(O),()=>h.delete(O)),g=()=>{l=Array.from(c.values()),h.forEach(O=>O())},y=({containerId:O,toastId:T,updateId:D})=>{let F=O?O!==t:t!==1,Q=c.has(T)&&D==null;return F||Q},m=(O,T)=>{c.forEach(D=>{var F;(T==null||T===D.props.toastId)&&((F=D.toggle)==null||F.call(D,O))})},x=O=>{var T,D;(D=(T=O.props)==null?void 0:T.onClose)==null||D.call(T,O.removalReason),O.isActive=!1},E=O=>{if(O==null)c.forEach(x);else{let T=c.get(O);T&&x(T)}g()},A=()=>{a-=s.length,s=[]},N=O=>{var T,D;let{toastId:F,updateId:Q}=O.props,P=Q==null;O.staleId&&c.delete(O.staleId),O.isActive=!0,c.set(F,O),g(),n(vw(O,P?"added":"updated")),P&&((D=(T=O.props).onOpen)==null||D.call(T))};return{id:t,props:u,observe:d,toggle:m,removeToast:E,toasts:c,clearQueue:A,buildToast:(O,T)=>{if(y(T))return;let{toastId:D,updateId:F,data:Q,staleId:P,delay:$}=T,B=F==null;B&&a++;let ne={...u,style:u.toastStyle,key:r++,...Object.fromEntries(Object.entries(T).filter(([z,J])=>J!=null)),toastId:D,updateId:F,data:Q,isIn:!1,className:bv(T.className||u.toastClassName),progressClassName:bv(T.progressClassName||u.progressClassName),autoClose:T.isLoading?!1:wO(T.autoClose,u.autoClose),closeToast(z){c.get(D).removalReason=z,E(D)},deleteToast(){let z=c.get(D);if(z!=null){if(n(vw(z,"removed")),c.delete(D),a--,a<0&&(a=0),s.length>0){N(s.shift());return}g()}}};ne.closeButton=u.closeButton,T.closeButton===!1||wv(T.closeButton)?ne.closeButton=T.closeButton:T.closeButton===!0&&(ne.closeButton=wv(u.closeButton)?u.closeButton:!0);let I={content:O,props:ne,staleId:P};u.limit&&u.limit>0&&a>u.limit&&B?s.push(I):pd($)?setTimeout(()=>{N(I)},$):N(I)},setProps(O){u=O},setToggle:(O,T)=>{let D=c.get(O);D&&(D.toggle=T)},isToastActive:O=>{var T;return(T=c.get(O))==null?void 0:T.isActive},getSnapshot:()=>l}}var gi=new Map,ed=[],xv=new Set,CO=t=>xv.forEach(e=>e(t)),_4=()=>gi.size>0;function TO(){ed.forEach(t=>A4(t.content,t.options)),ed=[]}var LO=(t,{containerId:e})=>{var n;return(n=gi.get(e||1))==null?void 0:n.toasts.get(t)};function E4(t,e){var n;if(e)return!!((n=gi.get(e))!=null&&n.isToastActive(t));let r=!1;return gi.forEach(a=>{a.isToastActive(t)&&(r=!0)}),r}function OO(t){if(!_4()){ed=ed.filter(e=>t!=null&&e.options.toastId!==t);return}if(t==null||bO(t))gi.forEach(e=>{e.removeToast(t)});else if(t&&("containerId"in t||"id"in t)){let e=gi.get(t.containerId);e?e.removeToast(t.id):gi.forEach(n=>{n.removeToast(t.id)})}}var jO=(t={})=>{gi.forEach(e=>{e.props.limit&&(!t.containerId||e.id===t.containerId)&&e.clearQueue()})};function A4(t,e){wv(t)&&(_4()||ed.push({content:t,options:e}),gi.forEach(n=>{n.buildToast(t,e)}))}function RO(t){var e;(e=gi.get(t.containerId||1))==null||e.setToggle(t.id,t.fn)}function N4(t,e){gi.forEach(n=>{(e==null||!(e!=null&&e.containerId)||(e==null?void 0:e.containerId)===n.id)&&n.toggle(t,e==null?void 0:e.id)})}function DO(t){let e=t.containerId||1;return{subscribe(n){let r=NO(e,t,CO);gi.set(e,r);let a=r.observe(n);return TO(),()=>{a(),gi.delete(e)}},setProps(n){var r;(r=gi.get(e))==null||r.setProps(n)},getSnapshot(){var n;return(n=gi.get(e))==null?void 0:n.getSnapshot()}}}function kO(t){return xv.add(t),()=>{xv.delete(t)}}function MO(t){return t&&(nc(t.toastId)||pd(t.toastId))?t.toastId:S4()}function md(t,e){return A4(t,e),e.toastId}function Jm(t,e){return{...e,type:e&&e.type||t,toastId:MO(e)}}function Xm(t){return(e,n)=>md(e,Jm(t,n))}function Yn(t,e){return md(t,Jm("default",e))}Yn.loading=(t,e)=>md(t,Jm("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...e}));function PO(t,{pending:e,error:n,success:r},a){let s;e&&(s=nc(e)?Yn.loading(e,a):Yn.loading(e.render,{...a,...e}));let l={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},u=(h,d,g)=>{if(d==null){Yn.dismiss(s);return}let y={type:h,...l,...a,data:g},m=nc(d)?{render:d}:d;return s?Yn.update(s,{...y,...m}):Yn(m.render,{...y,...m}),g},c=vl(t)?t():t;return c.then(h=>u("success",r,h)).catch(h=>u("error",n,h)),c}Yn.promise=PO;Yn.success=Xm("success");Yn.info=Xm("info");Yn.error=Xm("error");Yn.warning=Xm("warning");Yn.warn=Yn.warning;Yn.dark=(t,e)=>md(t,Jm("default",{theme:"dark",...e}));function IO(t){OO(t)}Yn.dismiss=IO;Yn.clearWaitingQueue=jO;Yn.isActive=E4;Yn.update=(t,e={})=>{let n=LO(t,e);if(n){let{props:r,content:a}=n,s={delay:100,...r,...e,toastId:e.toastId||t,updateId:S4()};s.toastId!==t&&(s.staleId=t);let l=s.render||a;delete s.render,md(l,s)}};Yn.done=t=>{Yn.update(t,{progress:1})};Yn.onChange=kO;Yn.play=t=>N4(!0,t);Yn.pause=t=>N4(!1,t);function FO(t){var e;let{subscribe:n,getSnapshot:r,setProps:a}=k.useRef(DO(t)).current;a(t);let s=(e=k.useSyncExternalStore(n,r,r))==null?void 0:e.slice();function l(u){if(!s)return[];let c=new Map;return t.newestOnTop&&s.reverse(),s.forEach(h=>{let{position:d}=h.props;c.has(d)||c.set(d,[]),c.get(d).push(h)}),Array.from(c,h=>u(h[0],h[1]))}return{getToastToRender:l,isToastActive:E4,count:s==null?void 0:s.length}}function UO(t){let[e,n]=k.useState(!1),[r,a]=k.useState(!1),s=k.useRef(null),l=k.useRef({start:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,didMove:!1}).current,{autoClose:u,pauseOnHover:c,closeToast:h,onClick:d,closeOnClick:g}=t;RO({id:t.toastId,containerId:t.containerId,fn:n}),k.useEffect(()=>{if(t.pauseOnFocusLoss)return y(),()=>{m()}},[t.pauseOnFocusLoss]);function y(){document.hasFocus()||N(),window.addEventListener("focus",A),window.addEventListener("blur",N)}function m(){window.removeEventListener("focus",A),window.removeEventListener("blur",N)}function x(P){if(t.draggable===!0||t.draggable===P.pointerType){O();let $=s.current;l.canCloseOnClick=!0,l.canDrag=!0,$.style.transition="none",t.draggableDirection==="x"?(l.start=P.clientX,l.removalDistance=$.offsetWidth*(t.draggablePercent/100)):(l.start=P.clientY,l.removalDistance=$.offsetHeight*(t.draggablePercent===80?t.draggablePercent*1.5:t.draggablePercent)/100)}}function E(P){let{top:$,bottom:B,left:ne,right:I}=s.current.getBoundingClientRect();P.nativeEvent.type!=="touchend"&&t.pauseOnHover&&P.clientX>=ne&&P.clientX<=I&&P.clientY>=$&&P.clientY<=B?N():A()}function A(){n(!0)}function N(){n(!1)}function O(){l.didMove=!1,document.addEventListener("pointermove",D),document.addEventListener("pointerup",F)}function T(){document.removeEventListener("pointermove",D),document.removeEventListener("pointerup",F)}function D(P){let $=s.current;if(l.canDrag&&$){l.didMove=!0,e&&N(),t.draggableDirection==="x"?l.delta=P.clientX-l.start:l.delta=P.clientY-l.start,l.start!==P.clientX&&(l.canCloseOnClick=!1);let B=t.draggableDirection==="x"?`${l.delta}px, var(--y)`:`0, calc(${l.delta}px + var(--y))`;$.style.transform=`translate3d(${B},0)`,$.style.opacity=`${1-Math.abs(l.delta/l.removalDistance)}`}}function F(){T();let P=s.current;if(l.canDrag&&l.didMove&&P){if(l.canDrag=!1,Math.abs(l.delta)>l.removalDistance){a(!0),t.closeToast(!0),t.collapseAll();return}P.style.transition="transform 0.2s, opacity 0.2s",P.style.removeProperty("transform"),P.style.removeProperty("opacity")}}let Q={onPointerDown:x,onPointerUp:E};return u&&c&&(Q.onMouseEnter=N,t.stacked||(Q.onMouseLeave=A)),g&&(Q.onClick=P=>{d&&d(P),l.canCloseOnClick&&h(!0)}),{playToast:A,pauseToast:N,isRunning:e,preventExitTransition:r,toastRef:s,eventHandlers:Q}}var BO=typeof window<"u"?k.useLayoutEffect:k.useEffect,Zm=({theme:t,type:e,isLoading:n,...r})=>yn.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:t==="colored"?"currentColor":`var(--toastify-icon-color-${e})`,...r});function $O(t){return yn.createElement(Zm,{...t},yn.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))}function zO(t){return yn.createElement(Zm,{...t},yn.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))}function qO(t){return yn.createElement(Zm,{...t},yn.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))}function HO(t){return yn.createElement(Zm,{...t},yn.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))}function VO(){return yn.createElement("div",{className:"Toastify__spinner"})}var Sv={info:zO,warning:$O,success:qO,error:HO,spinner:VO},YO=t=>t in Sv;function GO({theme:t,type:e,isLoading:n,icon:r}){let a=null,s={theme:t,type:e};return r===!1||(vl(r)?a=r({...s,isLoading:n}):k.isValidElement(r)?a=k.cloneElement(r,s):n?a=Sv.spinner():YO(e)&&(a=Sv[e](s))),a}var WO=t=>{let{isRunning:e,preventExitTransition:n,toastRef:r,eventHandlers:a,playToast:s}=UO(t),{closeButton:l,children:u,autoClose:c,onClick:h,type:d,hideProgressBar:g,closeToast:y,transition:m,position:x,className:E,style:A,progressClassName:N,updateId:O,role:T,progress:D,rtl:F,toastId:Q,deleteToast:P,isIn:$,isLoading:B,closeOnClick:ne,theme:I,ariaLabel:z}=t,J=Qu("Toastify__toast",`Toastify__toast-theme--${I}`,`Toastify__toast--${d}`,{"Toastify__toast--rtl":F},{"Toastify__toast--close-on-click":ne}),ae=vl(E)?E({rtl:F,position:x,type:d,defaultClassName:J}):Qu(J,E),me=GO(t),Z=!!D||!c,ce={closeToast:y,type:d,theme:I},oe=null;return l===!1||(vl(l)?oe=l(ce):k.isValidElement(l)?oe=k.cloneElement(l,ce):oe=_O(ce)),yn.createElement(m,{isIn:$,done:P,position:x,preventExitTransition:n,nodeRef:r,playToast:s},yn.createElement("div",{id:Q,tabIndex:0,onClick:h,"data-in":$,className:ae,...a,style:A,ref:r,...$&&{role:T,"aria-label":z}},me!=null&&yn.createElement("div",{className:Qu("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!B})},me),x4(u,t,!e),oe,!t.customProgressBar&&yn.createElement(EO,{...O&&!Z?{key:`p-${O}`}:{},rtl:F,theme:I,delay:c,isRunning:e,isIn:$,closeToast:y,hide:g,type:d,className:N,controlledProgress:Z,progress:D||0})))},KO=(t,e=!1)=>({enter:`Toastify--animate Toastify__${t}-enter`,exit:`Toastify--animate Toastify__${t}-exit`,appendPosition:e}),JO=SO(KO("bounce",!0)),XO={position:"top-right",transition:JO,autoClose:5e3,closeButton:!0,pauseOnHover:!0,pauseOnFocusLoss:!0,draggable:"touch",draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light","aria-label":"Notifications Alt+T",hotKeys:t=>t.altKey&&t.code==="KeyT"};function ZO(t){let e={...XO,...t},n=t.stacked,[r,a]=k.useState(!0),s=k.useRef(null),{getToastToRender:l,isToastActive:u,count:c}=FO(e),{className:h,style:d,rtl:g,containerId:y,hotKeys:m}=e;function x(A){let N=Qu("Toastify__toast-container",`Toastify__toast-container--${A}`,{"Toastify__toast-container--rtl":g});return vl(h)?h({position:A,rtl:g,defaultClassName:N}):Qu(N,bv(h))}function E(){n&&(a(!0),Yn.play())}return BO(()=>{var A;if(n){let N=s.current.querySelectorAll('[data-in="true"]'),O=12,T=(A=e.position)==null?void 0:A.includes("top"),D=0,F=0;Array.from(N).reverse().forEach((Q,P)=>{let $=Q;$.classList.add("Toastify__toast--stacked"),P>0&&($.dataset.collapsed=`${r}`),$.dataset.pos||($.dataset.pos=T?"top":"bot");let B=D*(r?.2:1)+(r?0:O*P);$.style.setProperty("--y",`${T?B:B*-1}px`),$.style.setProperty("--g",`${O}`),$.style.setProperty("--s",`${1-(r?F:0)}`),D+=$.offsetHeight,F+=.025})}},[r,c,n]),k.useEffect(()=>{function A(N){var O;let T=s.current;m(N)&&((O=T.querySelector('[tabIndex="0"]'))==null||O.focus(),a(!1),Yn.pause()),N.key==="Escape"&&(document.activeElement===T||T!=null&&T.contains(document.activeElement))&&(a(!0),Yn.play())}return document.addEventListener("keydown",A),()=>{document.removeEventListener("keydown",A)}},[m]),yn.createElement("section",{ref:s,className:"Toastify",id:y,onMouseEnter:()=>{n&&(a(!1),Yn.pause())},onMouseLeave:E,"aria-live":"polite","aria-atomic":"false","aria-relevant":"additions text","aria-label":e["aria-label"]},l((A,N)=>{let O=N.length?{...d}:{...d,pointerEvents:"none"};return yn.createElement("div",{tabIndex:-1,className:x(A),"data-stacked":n,style:O,key:`c-${A}`},N.map(({content:T,props:D})=>yn.createElement(WO,{...D,stacked:n,collapseAll:E,isIn:u(D.toastId,D.containerId),key:`t-${D.key}`},T)))}))}const Un=(t,e)=>{switch(console.log("showToast called with:",t,e),t){case"success":Yn.success(e,{position:"bottom-left",autoClose:5e3});break;case"warning":Yn.warn(e,{position:"bottom-left",autoClose:5e3});break;case"error":Yn.error(e,{position:"bottom-left",autoClose:5e3});break;default:Yn.info(e,{position:"bottom-left",autoClose:5e3})}},fa=async(t,e={})=>{const n={message:t.message||String(t),stack:t.stack||null,context:e,url:typeof window<"u"?window.location.href:null,useragent:typeof navigator<"u"?navigator.userAgent:null,created_at:new Date().toISOString()};try{const{error:r}=await ft.from("logs").insert([n]);r&&console.error("Supabase insert error:",r)}catch(r){console.error("Failed to send log:",r)}},C4=async t=>{try{const{data:e,error:n}=await ft.from("mosque_t").select("*").eq("organisasjonsnummer",t).single();if(n||!e)throw new Error("Mosque not found");return e}catch(e){return console.log("Error fetching mosque data: ",e),null}},QO=async t=>{try{const{data:e,error:n}=await ft.from("location_postnumber").select("post_no").eq("location_iso",t);if(n)return console.error(`Error fetching post ids of location ${t}: `,n.message),await fa(n,{message:`Error fetching post ids of location ${t}:`,function:"fetchMosquesInALocation"}),Un("error","Error fetching post ids"),null;if(!e||e.length===0)return[];const r=e.map(d=>d.post_no),{data:a,error:s}=await ft.from("mosque_t").select("organisasjonsnummer, reg_navn, org_name2, post_no, reg_postnummer").order("org_name2");if(s)return console.error("Error fetching mosques: ",s.message),await fa(s,{message:"Error fetching mosques"}),Un("error","Error fetching mosques"),null;const l=a.filter(d=>r.includes(d.reg_postnummer||d.post_no)),u=a.filter(d=>!r.includes(d.reg_postnummer||d.post_no)),c=l.map(d=>({id:d.organisasjonsnummer,name:d.reg_navn||d.org_name2})),h=u.map(d=>({id:d.organisasjonsnummer,name:d.reg_navn||d.org_name2}));return[...c,{name:"Other Masjids",id:"",isDisabled:!0},...h]}catch(e){return console.error(`Some error occurred while fetching mosques in location ${t}: `,e.message),await fa(e,{message:`Some error occurred while fetching mosques in location: ${t}`,function:"fetchMosquesInALocation"}),Un("error","Unexpected error occurred while fetching mosques"),null}},ej=async t=>{try{const{data:e,error:n}=await ft.from("mosque_t").select("org_name2, reg_navn").eq("organisasjonsnummer",t).single();if(n)throw n;return{value:t,label:e.org_name2||e.reg_navn}}catch(e){console.log(e)}};function gd(t){const[e,n]=k.useState(""),[r,a]=k.useState(""),[s,l]=k.useState(""),[u,c]=k.useState(""),[h,d]=k.useState(""),[g,y]=k.useState(""),[m,x]=k.useState(""),[E,A]=k.useState(!0);return k.useEffect(()=>{if(!t){A(!1);return}A(!0);const N=async()=>{if(!navigator.onLine){const T=await gw(t);if(T){n(T.org_name2||T.reg_navn||""),a(T.logo||""),l(T.reg_adresse||T.address||""),c(T.post_name||""),d(T.contact_phone||T.reg_mobil||""),y(T.contact_email||""),x(T.org_info||""),A(!1);return}}try{const T=await C4(t);if(!T)n(""),a(""),d(""),y("");else{if(n(T.org_name2||T.reg_navn||""),l(T.reg_adresse||T.address||""),d(T.reg_mobil||T.contact_phone||""),y(T.reg_epostadresse||T.contact_email||""),x(T.org_info||""),T.logo)a(T.logo);else{const{data:Q,error:P}=await ft.from("mosque_t").select("logo").eq("organisasjonsnummer",982842840).single();if(P)throw Error(P.message);a(Q.logo)}const{data:D,error:F}=await ft.from("location_postnumber").select("post_name").eq("post_no",T.reg_postnummer||T.post_no).single();if(F){console.error("Error fetching post info: ",F),await fa(F,{message:"Error fetching post info",function:"useMasjidInfo"}),Un("error","Error fetching post info");return}else c(D.post_name);await vO(t,{...T,postData:D})}}catch{const D=await gw(t);D?(n(D.org_name2||""),a(D.logo||""),l(D.reg_adresse||D.address||""),c(D.post_name||""),d(D.reg_mobil||D.contact_phone||""),y(D.contact_email||""),x(D.org_info||"")):(n(""),a(""),l(""),c(""),d(""),y(""),x(""))}finally{A(!1)}};N();const O=ft.channel("masjid_info_changes").on("postgres_changes",{event:"*",schema:"public",table:"mosque_t",filter:`organisasjonsnummer=eq.${t}`},()=>{N()}).subscribe();return()=>{ft.removeChannel(O)}},[t]),{masjidName:e,masjidLogo:r,masjidAddress:s,masjidPostName:u,masjidContact:h,masjidEmail:g,masjidInfo:m,loading:E}}function Mo({hijriDayObj:t,language:e="en",t:n,hijriMonthNames:r}){if(!t)return console.warn("formatHijriDate: hijriDayObj is null",{language:e,t:n}),"";const{hijri_date_day:a,hijri_date_month:s,hijri_date_year:l}=t;let u="";return u=r[s-1]||"",e==="ar"?`${l}-${u}-${a}`:`${a}-${u}-${l}`}const T4="hijri-date-db",gm="hijri_dates";async function gl(t){return await(await Gr(T4,1,{upgrade(n){n.createObjectStore(gm)}})).get(gm,t)}async function Qm(t,e){await(await Gr(T4,1,{upgrade(r){r.createObjectStore(gm)}})).put(gm,e,t)}async function eg(t,e){try{const{data:n,error:r}=await ft.from("hijri_dates").select("gregorian_date, hijri_date_day, hijri_date_month, hijri_date_year").gte("gregorian_date",t).lte("gregorian_date",e);if(r)throw new Error(r.message);const a=new Map;return(n||[]).forEach(s=>{a.set(s.gregorian_date,{hijri_date_day:s.hijri_date_day,hijri_date_month:s.hijri_date_month,hijri_date_year:s.hijri_date_year})}),a}catch(n){return console.error("Error fetching all Hijri dates: ",n),await fa(n,{message:"Failed to load Hijri dates at fetchAllHijriDates"}),Un("error","Failed to load Hijri dates"),new Map}}const tj=async t=>{try{const e=new Date,n=e.toLocaleDateString("en-CA"),r=new Date(e);r.setFullYear(r.getFullYear()+1),r.setDate(r.getDate()-1);const a=r.toLocaleDateString("en-CA",{timeZone:"Europe/Oslo"}),s={en:"special_date_en",no:"special_date_no",ar:"special_date_ar"},l=s[t]??s.en,{data:u,error:c}=await ft.from("hijri_dates").select(`${l}, gregorian_date`).gte("gregorian_date",n).lte("gregorian_date",a).not(l,"is",null);if(c)throw c;return u.map(h=>({date:h.gregorian_date,description:h[l],formatted:new Date(h.gregorian_date).toLocaleDateString("en-US",{month:"long",day:"numeric",timeZone:"Europe/Oslo"})})).sort((h,d)=>new Date(h.date).getTime()-new Date(d.date).getTime())}catch(e){return console.error("Failed to load special dates: ",e.message),await fa(e,{message:"Failed to load special dates (in getSpecialDates helper)"}),Un("error","Failed to load special dates"),[]}},L4=async()=>{try{const{data:t,error:e}=await ft.from("hijri_month").select("name_long").order("hijri_date_month");if(e)throw e;return t?t.map(n=>n.name_long):[]}catch(t){return console.error("Error fetching hijri month names: ",t),await fa(t,{message:"Error fetching hijri month names",function:"fetchHijriMonthNames"}),Un("error","Error fetching hijri month names"),[]}};let xp=null,rf=null;function tg(){const[t,e]=k.useState(()=>xp||[]);return k.useEffect(()=>{if(xp){e(xp);return}if(rf){rf.then(n=>{e(n)});return}rf=L4(),rf.then(n=>{xp=n,e(n),rf=null}).catch(n=>{console.error("Error fetching Hijri month names:",n),rf=null})},[]),t}const O4=({date:t,color:e,isLobby:n})=>{const{i18n:r,t:a}=kr(),s=r.language||"en",{darkMode:l}=Ea(),u=tg(),[c,h]=k.useState(()=>new Date(t).toLocaleDateString(s==="no"?"nb-NO":"en-IN",{year:"numeric",month:"long",day:"numeric"}));k.useEffect(()=>{const y=new Date(t);h(y.toLocaleDateString(s==="no"?"nb-NO":"en-IN",{year:"numeric",month:"long",day:"numeric"}))},[t,s]);const[d,g]=k.useState(null);return k.useEffect(()=>{(async()=>{if(t){if(!navigator.onLine){const m=await gl(t);if(m){g(m);return}}try{const{data:m,error:x}=await ft.from("hijri_dates").select("hijri_date_day, hijri_date_month, hijri_date_year").eq("gregorian_date",t).maybeSingle();if(x){console.error("Error fetching hijri date: ",x),await fa(x,{message:"Error fetching hijri date"}),Un("error","Error fetching hijri date in DateInfo");return}if(!m){console.warn(`No hijri date found for gregorian date: ${t}`);const E=await gl(t);E&&g(E);return}g(m),await Qm(t,m)}catch(m){const x=await gl(t);x&&g(x),console.error(m)}}})()},[t]),_.jsxs("div",{className:`mt- text-base font-bold ${n?"sm:text-xl lg:text-2xl":"sm:mt-4 sm:text-2xl lg:text-3xl text-center"}`,style:{color:l?"#DDF4E7":e},children:[d&&u.length>0?Mo({hijriDayObj:d,language:s,t:a,hijriMonthNames:u}):" ",n?" | ":_.jsx("br",{}),c]})},vd=({nr:t,textColor:e,orgNr:n,isLobby:r,date:a,isDefault:s})=>{const{org_nr:l}=xr(),{darkMode:u}=Ea(),{masjidName:c,masjidLogo:h,masjidInfo:d,loading:g}=gd(l||n),y=u?t===1?"#F2E7D5":t===2?"#F5C45E":"#DDF4E7":s&&t===2?"#F5C45E":e;return g?_.jsx("div",{children:_.jsx("h1",{className:"text-base sm:text-lg md:text-xl",children:"Logo"})}):_.jsxs("div",{className:`flex mt-2 flex-row gap-x-4 items-center ${t===3?"font-DM":"font-montserrat"}`,style:{color:y},children:[_.jsx("img",{src:h!=null&&h.startsWith("http")?h:h?`data:image/png;base64,${h}`:"/default-logo.png",alt:"logo",className:"block h-12 sm:h-14 2xl:h-16 w-auto max-w-[50%] sm:max-w-[40%]"}),_.jsxs("div",{className:"flex flex-col 2xl:gap-2",children:[_.jsx("h2",{className:"font-bold text-lg md:text-xl lg:text-3xl",children:c}),!r&&_.jsx("h4",{className:"text-xl font-medium",style:{color:u?t===1?"#F2E7D5":t===2?"#F5C45E":"#DDF4E7":s?t===1?"#0D0E0E":"":e},children:d}),t===3&&r&&_.jsx(O4,{date:a,color:y,isLobby:!0})]})]})},m2=()=>_.jsxs("div",{className:"flex flex-col justify-center items-center gap-10",children:[_.jsx("h2",{className:"text-5xl font-bold text-red-600 text-center",children:"Please switch off your mobile phones"}),_.jsx("img",{src:"/img/instruction.jpg",alt:"",className:"h-120"})]});function g2(t){const[e,n]=k.useState(null),[r,a]=k.useState(null);return k.useEffect(()=>{if(!t||t.length===0)return;let s=null;const l=120,u=()=>{const c=new Date,h=c.getHours()*3600+c.getMinutes()*60+c.getSeconds();console.log("useIqamahCheck - Checking time:",c.toISOString());let d=null,g=1/0;for(const y of t){if(!(y!=null&&y.iqamah)||!(y!=null&&y.name))continue;const[m,x]=y.iqamah.split(":").map(Number);if(isNaN(m)||isNaN(x))continue;const A=m*3600+x*60-h;if(A>=0&&A<g)g=A,d=y;else if(A>=-l&&A<0){n(l-Math.abs(A)),a({iqamah:y.iqamah,name:y.name}),console.log("useIqamahCheck - Iqamah found:",y,"Duration:",l-Math.abs(A));return}}d&&(console.log("Scheduling iqamah for:",d,"in",g,"seconds"),s=setTimeout(()=>{n(l),a({iqamah:d.iqamah,name:d.name}),console.log("useIqamahCheck - Iqamah triggered:",d),s=setTimeout(()=>{n(null),a(null),console.log("useIqamahCheck - Iqamah window ended, rescheduling"),u()},l*1e3)},g*1e3))};return u(),()=>{s&&clearTimeout(s)}},[t]),{iqamahDuration:e,currentPrayer:r}}const nj=({prayerTimes:t,extraInfo:e,textColor:n="#53452E",prayerTimesColor:r,extraInfoColor:a,isDefault:s})=>{const[l,u]=k.useState(null),{org_nr:c}=xr(),{iqamahDuration:h,currentPrayer:d}=g2(t);k.useEffect(()=>{const y=setInterval(()=>{u(()=>{const m=new Date,x=m.getHours()*3600+m.getMinutes()*60+m.getSeconds();let E=1/0;for(const A of t){const N=A==null?void 0:A.iqamah;if(!N)continue;const[O,T]=N.split(":").map(Number);if(Number.isNaN(O)||Number.isNaN(T))continue;const F=O*3600+T*60-x;F>0&&F<E&&(E=F)}return E===1/0?null:E})},1e3);return()=>clearInterval(y)},[t]);const g=l!==null&&l<=60&&l>0;return k.useEffect(()=>{if(h&&d&&c){const y=new URLSearchParams({name:d.name,iqamah:d.iqamah??"",duration:String(h)});window.location.href=`/${c}/masjid/iqamah?${y.toString()}`}},[h,d,c]),_.jsxs("div",{className:"flex flex-col h-full w-full px-6 py-8",children:[_.jsx("div",{className:"flex items-center gap-x-3 mb-6",children:_.jsx(vd,{nr:1,textColor:n,isDefault:s})}),_.jsx("div",{className:"flex-1 min-h-0 flex flex-col justify-center",children:g?_.jsx(m2,{}):_.jsx(gO,{prayerTimes:t,extraInfo:e,prayerTimesColor:r,extraInfoColor:a,isDefault:s})})]})};function J0(t){if(!t||typeof t!="string"||!t.includes(":"))return null;const[e,n]=t.split(":").map(Number),r=new Date;return r.setHours(e,n,0,0),r}function X0(t){const e=Math.ceil(t/1e3),n=Math.floor(e/3600),r=Math.floor(e%3600/60),a=e%60;return{hours:n,minutes:r,seconds:a}}function ng(t){var r;const e=new Date;for(let a=0;a<t.length;a++){if(t[a].name==="SUNRISE")continue;const s=t[a],l=J0(s.adhan),u=J0(s.iqamah);if(l&&e<l){const{hours:c,minutes:h,seconds:d}=X0(l.getTime()-e.getTime());return{label:`${s.name.charAt(0).toUpperCase()+s.name.slice(1).toLowerCase()} Adhan`,hours:c,minutes:h,seconds:d}}if(u&&l&&e>=l&&e<u){const{hours:c,minutes:h,seconds:d}=X0(u.getTime()-e.getTime());return{label:`${s.name.charAt(0).toUpperCase()+s.name.slice(1).toLowerCase()} Iqamah`,hours:c,minutes:h,seconds:d}}}const n=J0((r=t[0])==null?void 0:r.adhan);if(n){n.setDate(n.getDate()+1);const{hours:a,minutes:s,seconds:l}=X0(n.getTime()-e.getTime());return{label:"Fajr Adhan",hours:a,minutes:s,seconds:l}}return{label:"",hours:0,minutes:0,seconds:0}}function rg(t){const e={};for(const n of t){const r=n.name.toLowerCase();["fajr","fajr end","dhuhr","asr","maghrib","isha"].includes(r)&&(e[r]=n.adhan)}return e}const rj={1:{light:{day:"#ECDCC3",dayOpacity:1,night:"#A5A6A5",nightOpacity:1,border:"#A08963",bg:"#DBDBDB",text:"#706D54",centerOuter:"#DBDBDB",centerMid:"#A08963",center:"#6D9886",handStart:"#6D9886",handEnd:"#A08963",shadow:"#000000",shadowOpacity:1},dark:{day:"#ECDCC3",dayOpacity:.75,night:"#4A4A49",nightOpacity:1,border:"#A08963",bg:"#1E1E1E",text:"#F2E7D5",centerOuter:"#1E1E1E",centerMid:"#DBDBDB",center:"#6D9886",handStart:"#6D9886",handEnd:"#F2E7D5",shadow:"#DBDBDB",shadowOpacity:1}},2:{light:{day:"#E78B48",dayOpacity:.5,night:"#102E50",nightOpacity:.5,border:"#BE3D2A",bg:"#F5C45E",text:"#102E50",centerOuter:"#F5C45E",centerMid:"#BE3D2A",center:"#E78B48",shadow:"#BE3D2A",shadowOpacity:.5},dark:{day:"#E78B48",dayOpacity:.5,night:"#03070C",nightOpacity:.5,border:"#BE3D2A",bg:"#102E50",text:"#F5C45E",centerOuter:"#102E50",centerMid:"#F5C45E",center:"#E78B48",shadow:"#F5C45E",shadowOpacity:.2}}},af=t=>{if(typeof t!="string"||!t.includes(":"))return 0;const[e,n]=t.split(":").map(Number);return e+n/60};function ul(t){return(t%24*15+180)%360}function lu(t,e,n,r){const a=(r-90)*Math.PI/180;return{x:t+n*Math.cos(a),y:e+n*Math.sin(a)}}function yw(t,e,n,r,a){r=r%360,a=a%360,a<=r&&(a+=360);const s=lu(t,e,n,a),l=lu(t,e,n,r),u=a-r<=180?"0":"1";return["M",s.x,s.y,"A",n,n,0,u,0,l.x,l.y,"L",t,e,"Z"].join(" ")}function aj(t,e,n){const r=Math.floor(e*60),s=t.map((l,u)=>({p:l,i:u})).filter(l=>l.p.name!==n).map(l=>l.i).find(l=>Math.floor(t[l].time*60)>r);return t.map((l,u)=>{if(l.name===n)return"none";const c=Math.floor(l.time*60);return u===s?"next":c<r?"past":"future"})}const ag=({width:t,height:e,prayerTimes:n,theme:r})=>{const{t:a}=kr(),{darkMode:s}=Ea(),l=s?"dark":"light",u=rj[r][l],[c,h]=k.useState(()=>{const A=new Date;return A.getHours()+A.getMinutes()/60+A.getSeconds()/3600});k.useEffect(()=>{const A=setInterval(()=>{const N=new Date;h(N.getHours()+N.getMinutes()/60+N.getSeconds()/3600)},1e3);return()=>clearInterval(A)},[]);const d={fajr:af(n.fajr),sunrise:af(n["fajr end"]),dhuhr:af(n.dhuhr),asr:af(n.asr),maghrib:af(n.maghrib),isha:af(n.isha)},g=[{startLabel:"Dhuhr",endLabel:"",start:d.dhuhr,end:d.asr-.01,color:"#B7CD8E",textPosition:["start","end"],textColor:"#ffffff"},{startLabel:"1X ",endLabel:null,start:d.asr,end:d.asr+20/60,color:"#FFDF77",textPosition:["start","end"],textColor:"#ffffff"},{startLabel:"50%",endLabel:null,start:d.asr+20/60,end:d.asr+40/60,color:"E1B936",textPosition:["start","end"],textColor:"#ffffff"},{startLabel:"2X",endLabel:"Asr end",start:d.asr+40/60,end:d.maghrib-10/60,color:"#B38F17",textPosition:["start","end"],textColor:"#ffffff"},{startLabel:null,endLabel:null,start:d.maghrib-20/60,end:d.maghrib-1/60,color:"#C53434",textPosition:["start","end"],textColor:"#ffffff"},{startLabel:"Maghrib",endLabel:"Dusk",start:d.maghrib,end:d.isha-1/60,color:"#D8702B",textPosition:["start","end"],textColor:"#ffffff"},{startLabel:"Isha",endLabel:null,start:d.isha,end:23.9833,color:"#254465",textPosition:["start","end"],textColor:"#ffffff"},{startLabel:"Thahajjud",endLabel:"Thahajjud end",start:0,end:d.fajr,color:"#232E3A",textPosition:["start","end"],textColor:"#ffffff"},{startLabel:"Fajr",endLabel:"Fajr end",start:d.fajr,end:d.sunrise-1/60,color:"#D8702B",textPosition:["start","end"],textColor:"#ffffff"},{startLabel:null,endLabel:null,start:d.sunrise,end:d.sunrise+20/60,color:"#C53434",textPosition:["start","end"],textColor:"#ffffff"},{startLabel:"Dhuha",endLabel:"Dhuha end",start:d.sunrise+20/60,end:d.dhuhr-20/60,color:"#E8C85E",textPosition:["start","end"],textColor:"#ffffff"},{startLabel:null,endLabel:null,start:d.dhuhr-20/60,end:d.dhuhr,color:"#C53434",textPosition:["start","end"],textColor:"#ffffff"}],y=[{name:"FAJR",time:d.fajr},{name:a("SUNRISE"),time:d.sunrise},{name:"DHUHR",time:d.dhuhr},{name:"ASR",time:d.asr},{name:"MAGHRIB",time:d.maghrib},{name:"ISHA",time:d.isha}],m=aj(y,c,a("SUNRISE")),x=180,E=ul(c);return _.jsxs("svg",{width:t||"100%",height:e||"100%",viewBox:"0 0 400 400",className:`rounded-full shadow-lg font-chakra font-light text-${u.text}`,children:[_.jsx("defs",{children:_.jsx("filter",{id:"inner-shadow",x:"-10%",y:"-10%",width:"120%",height:"120%",children:_.jsx("feGaussianBlur",{stdDeviation:"7"})})}),_.jsx("circle",{cx:200,cy:200,r:200,fill:u.border}),_.jsx("circle",{cx:200,cy:200,r:190,fill:u.bg}),_.jsx("path",{d:`
105
- M 200,200
106
- m -190,0
107
- a 190,190 0 1,0 380,0
108
- a 190,190 0 1,0 -380,0
109
- M 200,200
110
- m -183,0
111
- a 183,183 0 1,1 366,0
112
- a 183,183 0 1,1 -366,0
113
- Z
114
- `,fill:u.shadow,opacity:u.shadowOpacity,filter:"url(#inner-shadow)"}),g.map((A,N)=>{const Q=ul(A.start);let P=ul(A.end);P<=Q&&(P+=360);const $=P-Q<=180?"0":"1",B=me=>(me-90)*(Math.PI/180),ne={x:200+190*Math.cos(B(Q)),y:200+190*Math.sin(B(Q))},I={x:200+190*Math.cos(B(P)),y:200+190*Math.sin(B(P))},z={x:200+172*Math.cos(B(P)),y:200+172*Math.sin(B(P))},J={x:200+172*Math.cos(B(Q)),y:200+172*Math.sin(B(Q))},ae=[`M ${ne.x} ${ne.y}`,`A 190 190 0 ${$} 1 ${I.x} ${I.y}`,`L ${z.x} ${z.y}`,`A 172 172 0 ${$} 0 ${J.x} ${J.y}`,"Z"].join(" ");return _.jsxs("g",{children:[_.jsx("path",{id:`arcPath-${N}`,d:ae,fill:A.color,opacity:A.startLabel||A.endLabel?.5:1}),_.jsx("path",{id:`textArc-${N}`,d:`M ${ne.x} ${ne.y} A 190 190 0 ${$} 1 ${I.x} ${I.y}`,fill:"none",stroke:"none"}),A.startLabel&&_.jsx("text",{fontSize:10,dx:1,dy:10,fill:"#ffffff",children:_.jsx("textPath",{href:`#textArc-${N}`,startOffset:"0%",textAnchor:"start",dominantBaseline:"middle",children:A.startLabel})})]},`seg-${N}`)}),_.jsx("path",{d:yw(200,200,135,ul(d.sunrise),ul(d.maghrib)),fill:u.day,opacity:u.dayOpacity}),_.jsx("path",{d:yw(200,200,135,ul(d.maghrib),ul(d.sunrise+24)),fill:u.night,opacity:u.nightOpacity}),Array.from({length:24},(A,N)=>{if(N===0||N===6||N===12||N===18)return null;const O=ul(N),T=x-30,D=lu(200,200,T,O);return _.jsx("text",{x:D.x,y:D.y+8,fontSize:18,fill:u.text,textAnchor:"middle",children:N},N)}),r===1&&_.jsx("defs",{children:_.jsxs("linearGradient",{id:"clockHandGradient",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[_.jsx("stop",{offset:"0%",stopColor:u.handStart}),_.jsx("stop",{offset:"100%",stopColor:u.handEnd})]})}),_.jsxs("g",{children:[_.jsx("circle",{cx:200,cy:200,r:22,fill:u.centerOuter}),_.jsx("circle",{cx:200,cy:200,r:14,fill:u.centerMid}),_.jsx("line",{x1:200,y1:200,x2:lu(200,200,120,E).x,y2:lu(200,200,120,E).y,stroke:r===1?"url(#clockHandGradient)":u.centerMid,strokeWidth:14,strokeLinecap:"round"}),_.jsx("circle",{cx:200,cy:200,r:6,fill:u.center})]}),y.map((A,N)=>{if(A.name===a("SUNRISE"))return null;const O=ul(A.time),T=70,D=lu(200,200,T,O),F=T+30,Q=x-50,P=lu(200,200,F,O),$=lu(200,200,Q,O),B=m[N],ne=u.text,I=B==="past"?.5:1,z=B==="next"?"bold":"normal";let J=O;return A.name==="FAJR"?J+=90:J+=-90,_.jsxs(yn.Fragment,{children:[_.jsx("line",{x1:P.x,y1:P.y,x2:$.x,y2:$.y,stroke:"#0000004D",strokeWidth:1}),_.jsx("text",{x:D.x,y:D.y,textAnchor:"middle",dominantBaseline:"middle",fontSize:A.name===a("SUNRISE")?10:18,fontWeight:z,fill:ne,opacity:I,transform:`rotate(${J} ${D.x} ${D.y})`,children:A.name})]},A.name)}),_.jsx("text",{x:"200",y:"60",textAnchor:"middle",fontSize:40,fill:u.text,fontWeight:"",children:"12"}),_.jsx("text",{x:"200",y:"368",textAnchor:"middle",fontSize:40,fill:u.text,fontWeight:"",children:"0"}),_.jsx("text",{x:"42",y:"210",textAnchor:"middle",fontSize:40,fill:u.text,fontWeight:"",children:"6"}),_.jsx("text",{x:"352",y:"210",textAnchor:"middle",fontSize:40,fill:u.text,fontWeight:"",children:"18"})]})},ij=({prayerTimes:t,date:e})=>{const{i18n:n,t:r}=kr(),a=n.language||"en",s=tg(),[l,u]=k.useState(()=>new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})),[c,h]=k.useState(()=>new Date(e).toLocaleDateString(a==="no"?"nb-NO":"en-IN",{year:"numeric",month:"long",day:"numeric"})),[d,g]=k.useState({label:"",hours:0,minutes:0,seconds:0});k.useEffect(()=>{const E=setInterval(()=>{u(new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}))},1e3);return()=>clearInterval(E)},[]),k.useEffect(()=>{const E=new Date(e);h(E.toLocaleDateString(a==="no"?"nb-NO":"en-IN",{year:"numeric",month:"long",day:"numeric"}))},[e,a]),k.useEffect(()=>{if(!t.length)return;function E(){g(ng(t))}E();const A=setInterval(E,1e3);return()=>clearInterval(A)},[t]);const y=rg(t),[m,x]=k.useState(null);return k.useEffect(()=>{(async()=>{if(e){if(!navigator.onLine){const A=await gl(e);if(A){x(A);return}}try{const{data:A,error:N}=await ft.from("hijri_dates").select("hijri_date_day, hijri_date_month, hijri_date_year").eq("gregorian_date",e).single();if(N)throw new Error(N.message);if(!A)throw new Error("No corresponding hijri day found!");x(A),await Qm(e,A)}catch(A){const N=await gl(e);N&&x(N),console.log(A)}}})()},[e]),_.jsxs("div",{className:"font-chakra w-full h-full flex flex-col justify-center items-center text-center gap-4 p-4 dark:text-[#F2E7D5]",children:[_.jsxs("div",{className:"",children:[_.jsx("h2",{className:"font-bold text-2xl md:text-3xl lg:text-5xl mb-2",children:l}),_.jsxs("h4",{className:"font-semibold text-lg md:text-xl lg:text-2xl",children:[m&&s.length>0?Mo({hijriDayObj:m,language:a,t:r,hijriMonthNames:s}):" "," | ",c]})]}),_.jsx("div",{className:"w-full",children:_.jsx(ag,{prayerTimes:y,theme:1})}),d&&d.label&&_.jsxs("div",{children:[_.jsxs("h2",{className:"font-semibold text-lg md:text-xl lg:text-2xl mb-1",children:[d.label," In"]}),_.jsx("h4",{className:"font-bold text-2xl md:text-3xl lg:text-5xl",children:`${String(d.hours).padStart(2,"0")}:${String(d.minutes).padStart(2,"0")}:${String(d.seconds).padStart(2,"0")}`})]})]})},sj=({date:t,textColor:e})=>{const{i18n:n,t:r}=kr(),a=n.language||"en",{darkMode:s}=Ea(),l=tg(),[u,c]=k.useState(()=>new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})),[h,d]=k.useState(()=>new Date(t).toLocaleDateString(a==="no"?"nb-NO":"en-IN",{year:"numeric",month:"long",day:"numeric"}));k.useEffect(()=>{const m=setInterval(()=>{c(new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}))},1e3);return()=>clearInterval(m)},[]),k.useEffect(()=>{const m=new Date(t);d(m.toLocaleDateString(a==="no"?"nb-NO":"en-IN",{year:"numeric",month:"long",day:"numeric"}))},[t,a]);const[g,y]=k.useState(null);return k.useEffect(()=>{(async()=>{if(t){if(!navigator.onLine){const x=await gl(t);if(x){y(x);return}}try{const{data:x,error:E}=await ft.from("hijri_dates").select("hijri_date_day, hijri_date_month, hijri_date_year").eq("gregorian_date",t).single();if(E)throw new Error(E.message);if(!x)throw new Error("No corresponding hijri day found!");y(x),await Qm(t,x)}catch(x){const E=await gl(t);E&&y(E),console.log(x)}}})()},[t]),_.jsxs("div",{className:"flex flex-col items-end font-montserrat pr-6",style:{color:s?"#F5C45E":e},children:[_.jsx("h2",{className:"font-bold text-lg md:text-xl lg:text-3xl",children:u}),_.jsxs("h4",{className:"font-semibold text-sm md:text-base lg:text-xl text-right",children:[g&&l.length>0?Mo({hijriDayObj:g,language:a,t:r,hijriMonthNames:l}):"-"," | ",h]})]})},j4=({name:t,arabic:e,adhan:n,iqamah:r,tomorrow:a,isNext:s,isPast:l,isSmall:u=!1,color:c,bg:h,isDefault:d,isPreview:g})=>{const{t:y}=kr(),{darkMode:m}=Ea(),{org_nr:x}=xr(),{language:E}=Sl(x||void 0),A=E==="ar";return _.jsxs("div",{className:`
115
- w-${u?g?"w-40":"w-52":"w-55"} flex flex-col mx-auto
116
- py-1 rounded-lg shadow-md text-center transition
117
- ${s?"dark:border-4 dark:border-[#CE5C36]":""}
118
- `,style:{backgroundColor:m?"#102E50":d?s?"#F5C45E":"#E78B48":h,color:m?"#F5C45E":c},children:[_.jsxs("div",{className:`flex justify-between font-montserrat font-semibold border-b-2 ${u?g?"px-0.5 py-1.5":"py-1.5 lg:text-2xl px-3":"py-2 text-2xl px-3"}`,children:[_.jsx("h2",{children:t}),_.jsx("h4",{className:"font-bold",children:e})]}),_.jsxs("div",{className:`flex flex-col px-3 font-montserrat font-medium ${u?"py-3 gap-2 lg:text-xl":"py-1.5 gap-1.5 text-lg lg:text-xl"}`,style:{direction:A?"rtl":"ltr"},children:[_.jsxs("div",{className:`flex justify-between ${l?"opacity-40":""}`,children:[_.jsx("h2",{children:y("ADHAN")}),_.jsx("h4",{className:"font-bold",children:n})]}),_.jsxs("div",{className:`flex justify-between ${l?"opacity-40":""}`,children:[_.jsx("h2",{children:y("IQAMAH")}),_.jsx("h4",{className:"font-bold",children:r})]}),_.jsxs("div",{className:"flex justify-between",children:[_.jsx("h2",{children:y("TOMORROW")}),_.jsx("h4",{className:"font-bold",children:a})]})]})]})},au=270,bw=400,ww=180*Math.PI/180,oj=0*Math.PI/180,lj=Array.from({length:5},(t,e)=>ww+(oj-ww)*e/4),xw=t=>{const[e,n]=t.split(":").map(Number);return e*60+n},uj=({prayerTimes:t,prayerTimesColor:e,isDefault:n})=>{const{org_nr:r}=xr(),{iqamahDuration:a,currentPrayer:s}=g2(t),[l,u]=k.useState(null),c=new Date,h=c.getHours()*60+c.getMinutes(),d=t.findIndex(m=>xw(m.adhan)>h)-1,g=rg(t);k.useEffect(()=>{if(a&&s&&r){const m=new URLSearchParams({name:s.name,iqamah:s.iqamah??"",duration:String(a)});window.location.href=`/${r}/masjid/iqamah?${m.toString()}`}},[a,s,r]),k.useEffect(()=>{const m=setInterval(()=>{const x=new Date,E=x.getHours()*3600+x.getMinutes()*60+x.getSeconds();let A=1/0;for(const N of t){const O=N==null?void 0:N.iqamah;if(!O)continue;const[T,D]=O.split(":").map(Number);if(Number.isNaN(T)||Number.isNaN(D))continue;const Q=T*3600+D*60-E;Q>0&&Q<A&&(A=Q)}u(A===1/0?null:A)},1e3);return()=>clearInterval(m)},[t]);const y=l!==null&&l<=60&&l>0;return _.jsx("div",{className:"flex flex-col items-center text-[#102E50] dark:text-[#F5C45E]",children:y?_.jsx("div",{className:"flex items-center justify-center",style:{width:2*au,height:2*au,minHeight:2*au},children:_.jsx(m2,{})}):_.jsxs("div",{className:"relative flex items-center",style:{width:2*au,height:2*au,minHeight:2*au},children:[_.jsx("div",{className:"absolute left-1/2 top-1/2 rounded-full w-100 h-100 flex items-center justify-center bg-white",style:{transform:"translate(-50%, -80%)",zIndex:10},children:_.jsx(ag,{prayerTimes:g,theme:1})}),t.filter(m=>m.name!=="Fajr end").map((m,x)=>{const E=lj[x],A=au+bw*Math.cos(E),N=au+bw*Math.sin(E),O=xw(m.adhan),T=x===d,D=O<h;return _.jsx("div",{className:"absolute",style:{left:A,top:N,transform:"translate(-55%, -160%)",width:200,zIndex:20},children:_.jsx(j4,{name:m.name,arabic:m.arabic,adhan:m.adhan,iqamah:m.iqamah,tomorrow:m.tomorrow,isNext:T,isPast:D,color:e.text,bg:e.bg,isDefault:n})},x)})]})})},R4=({extraInfo:t,extraInfoColor:e,isLobby:n,isDefault:r,isPreview:a})=>{const{t:s}=kr(),{darkMode:l}=Ea(),{org_nr:u}=xr(),{language:c}=Sl(u||void 0),h=c==="ar",d=(g,y)=>{const m=Array.isArray(g.time)&&g.time.length>1,x=Array.isArray(g.time)?g.time:[g.time];return n&&m?_.jsxs("div",{className:"py-1 flex flex-col",children:[_.jsxs("div",{className:"flex justify-between gap-4",children:[_.jsxs("h4",{children:[s(g.label.toUpperCase())," :"]}),_.jsx("h4",{className:"font-bold",children:x[0]})]}),x.slice(1).map((E,A)=>_.jsx("div",{className:"flex justify-end",children:_.jsx("h4",{className:"font-bold",children:E})},A))]},y):_.jsxs("div",{className:"flex justify-between gap-6 py-1",children:[_.jsxs("h4",{className:"text-start w-32 font-semibold",children:[s(g.label.toUpperCase())," :"]}),_.jsxs("div",{className:"font-bold flex justify-between gap-6",children:[_.jsx("h4",{children:x[0]||""}),_.jsx("h4",{children:x[1]||""}),_.jsx("h4",{children:x[2]||""})]})]},y)};return _.jsx("div",{className:"w- flex flex-col gap-4",children:_.jsx("div",{className:`
119
- ${n?a?"w-40 py-4 px-0.5":"w-52 py-4 text-base md:text-lg lg:text-xl":"min-w-70 max-w-110 min-h-20 flex justify-center"}
120
- flex flex-col mx-auto py-1 px-4 rounded-lg shadow-md text-center transition
121
- font-montserrat font-medium text-lg md:text-xl lg:text-2xl
122
- `,style:{color:l?"#F5C45E":e.text,backgroundColor:l?"#03182D":r?"#DBDBDB":e.bg,direction:h?"rtl":"ltr"},children:t.filter(g=>g.label==="Eid"?Array.isArray(g.time)&&g.time.some(y=>y&&y.trim()!==""):!0).map((g,y)=>d(g,y))})})},cj=({prayerTimes:t,extraInfoColor:e})=>{const{t:n}=kr(),[r,a]=k.useState({label:"",hours:0,minutes:0,seconds:0}),{darkMode:s}=Ea();return k.useEffect(()=>{if(!t.length)return;function l(){a(ng(t))}l();const u=setInterval(l,1e3);return()=>clearInterval(u)},[t]),_.jsx("div",{className:`\r
123
- w-75 h-30 flex flex-col mx-auto\r
124
- p-2 px-6 rounded-lg shadow-md text-center transition\r
125
- font-montserrat justify-center\r
126
- `,style:{color:s?"#F5C45E":e.text,backgroundColor:s?"#03182D":e.bg},children:r&&r.label&&_.jsxs("div",{className:"",children:[_.jsxs("h2",{className:"font-semibold mb-2 text-base md:text-lg lg:text-2xl",children:[n(r.label)," In"]}),_.jsx("h4",{className:"font-bold text-xl md:text-2xl lg:text-4xl",children:`${String(r.hours).padStart(2,"0")}:${String(r.minutes).padStart(2,"0")}:${String(r.seconds).padStart(2,"0")}`})]})})},fj=({prayerTimes:t,color:e})=>{const[n,r]=k.useState({label:"",hours:0,minutes:0,seconds:0}),[a,s]=k.useState(0),{darkMode:l}=Ea();if(k.useEffect(()=>{if(!(t!=null&&t.length))return;function x(){var F,Q,P;const A=ng(t);r(A);const N=new Date,O=N.getHours()*60+N.getMinutes();let T=-1,D=0;for(let $=0;$<t.length;$++){const B=t[$],ne=Number((F=B.iqamah)==null?void 0:F.split(":")[0])*60+Number((Q=B.iqamah)==null?void 0:Q.split(":")[1]),I=Number(B.adhan.split(":")[0])*60+Number(B.adhan.split(":")[1]);ne?O>=ne&&(T=$,D=ne):O>=I&&(T=$,D=I)}if(T>=0){let $=0,B=-1;for(let ne=T+1;ne<t.length;ne++){const I=t[ne];if(I.adhan&&I.name!=="SUNRISE"){$=Number(I.adhan.split(":")[0])*60+Number(I.adhan.split(":")[1]),B=ne;break}}if(B===-1&&((P=t[0])!=null&&P.adhan)&&($=Number(t[0].adhan.split(":")[0])*60+Number(t[0].adhan.split(":")[1])+1440),$>0){const ne=$-D,I=O-D,z=Math.max(0,Math.min(100,I/ne*100));s(z)}}else s(0)}x();const E=setInterval(x,1e3);return()=>clearInterval(E)},[t]),!n.label)return null;const u=l?"#0C221F":"#67C090",c="#FFFFFF",h=500,d=280,g=220,y=40,m=40;return _.jsxs("div",{className:"flex flex-col items-center justify-center w-full text-white text-center font-ubuntu p-10",style:{color:l?"#DDF4E7":e},children:[_.jsxs("div",{className:"relative flex items-center justify-center",children:[_.jsxs("svg",{width:h,height:d,viewBox:`0 0 ${h} ${d}`,className:"absolute",style:{display:"block"},children:[_.jsx("path",{d:`M ${m} ${d-m} A ${g} ${g} 0 0 1 ${h-m} ${d-m}`,stroke:l?"#67C090":e,strokeWidth:y+2,fill:"none",strokeLinecap:"butt"}),_.jsx("path",{d:`M ${m} ${d-m} A ${g} ${g} 0 0 1 ${h-m} ${d-m}`,stroke:c,strokeWidth:y,fill:"none",strokeLinecap:"butt"}),_.jsx("path",{d:`M ${m} ${d-m} A ${g} ${g} 0 0 1 ${h-m} ${d-m}`,stroke:u,strokeWidth:y,fill:"none",strokeDasharray:Math.PI*g,strokeDashoffset:Math.PI*g-a/100*Math.PI*g,strokeLinecap:"butt",style:{transition:"stroke-dashoffset 1s linear"}})]}),_.jsx("div",{className:"mt-14 flex flex-col items-center z-10",children:_.jsxs("span",{className:"text-4xl font-bold",children:[n.label.includes("iqamah")?n.label:n.label.split(" ")[0],_.jsx("br",{})," in"]})})]}),_.jsx("div",{className:" text-6xl font-bold",children:`${String(n.hours).padStart(2,"0")}:${String(n.minutes).padStart(2,"0")}:${String(n.seconds).padStart(2,"0")}`})]})},sf=t=>t.toString().padStart(2,"0"),D4=({isLobby:t=!1,color:e="#0c1844"})=>{const{darkMode:n}=Ea(),[r,a]=k.useState(()=>{const s=new Date;return{hours:sf(s.getHours()),minutes:sf(s.getMinutes()),seconds:sf(s.getSeconds())}});return k.useEffect(()=>{const s=setInterval(()=>{const l=new Date;a({hours:sf(l.getHours()),minutes:sf(l.getMinutes()),seconds:sf(l.getSeconds())})},1e3);return()=>clearInterval(s)},[]),_.jsx("div",{className:`flex flex-col justify-center font-ubuntu ${t?"py-4 sm:py-6 2xl:py-8":""} w-full`,style:{color:n?"#DDF4E7":e},children:_.jsx("div",{className:"flex justify-center",children:_.jsxs("span",{className:`${t?"text-4xl sm:text-6xl lg:text-7xl":"text-5xl sm:text-7xl lg:text-[120px]"} font-extrabold leading-none`,children:[r.hours,":",r.minutes,":",r.seconds]})})})},hj=({prayerTimes:t,date:e,textColor:n,org_nr:r})=>_.jsxs("div",{className:"h-full flex flex-col px-4",children:[_.jsx(vd,{nr:3,textColor:n,orgNr:r}),_.jsx("div",{className:"flex-1 flex items-center justify-center",children:_.jsxs("div",{className:"flex flex-col h-full justify-between py-10",children:[_.jsx(O4,{date:e,color:n}),_.jsx(D4,{color:n}),_.jsx(fj,{prayerTimes:t,color:n})]})})]}),k4=t=>{if(!t)return 1/0;const[e,n]=t.split(":").map(Number);return e*60+n};function dj(t){const e=new Date,n=e.getHours()*60+e.getMinutes();return t.findIndex(r=>r.adhan&&k4(r.adhan)>n)}const M4=({prayerTimes:t,extraInfo:e,prayerTimesColor:n,extraInfoColor:r,isLobby:a,isDefault:s})=>{const{org_nr:l}=xr(),{iqamahDuration:u,currentPrayer:c}=g2(t),[h,d]=k.useState(null),{language:g}=Sl(l||void 0),y=g==="ar",{darkMode:m}=Ea(),{t:x}=kr(),E=dj(t),A=new Date,N=A.getHours()*60+A.getMinutes();k.useEffect(()=>{if(u&&c&&l){const D=new URLSearchParams({name:c.name,iqamah:c.iqamah??"",duration:String(u)});window.location.href=`/${l}/masjid/iqamah?${D.toString()}`}},[u,c,l]),k.useEffect(()=>{const D=setInterval(()=>{const F=new Date,Q=F.getHours()*3600+F.getMinutes()*60+F.getSeconds();let P=1/0;for(const $ of t){const B=$==null?void 0:$.iqamah;if(!B)continue;const[ne,I]=B.split(":").map(Number);if(Number.isNaN(ne)||Number.isNaN(I))continue;const J=ne*3600+I*60-Q;J>0&&J<P&&(P=J)}d(P===1/0?null:P)},1e3);return()=>clearInterval(D)},[t]);const O=h!==null&&h<=60&&h>0,T=m?"#3F5551":n.bg;return _.jsx("div",{className:"font-ubuntu h-full w-full",children:O?_.jsx(m2,{}):_.jsx("div",{className:`w-full h-full ${a?"":"border-l-3"}`,style:{borderColor:m?"#0C221F":n.text,direction:y?"rtl":"ltr"},children:_.jsxs("table",{className:"w-full h-full min-h-0 text-center",children:[!a&&_.jsx("thead",{style:{color:m?"#DDF4E7":n.text},children:_.jsxs("tr",{className:"border-b-2",style:{borderColor:m?"#DDF4E7":n.text},children:[_.jsx("th",{className:`${a?"py-3":"py-4"} ${y?"text-right pr-6":"text-left pl-6"} text-2xl font-light`,style:{backgroundColor:m?"#3F5551":n.bg},children:x("PRAYER")}),_.jsx("th",{className:`${a?"py-3":"py-4"} text-2xl font-light`,style:{backgroundColor:m?"#3F5551":n.bg},children:x("ADHAN")}),_.jsx("th",{className:`${a?"py-3":"py-4"} text-2xl font-light`,style:{backgroundColor:m?"#3F5551":n.bg},children:x("IQAMAH")}),_.jsx("th",{className:`${a?"py-3":"py-4"} text-2xl font-light`,style:{backgroundColor:m?"#3F5551":n.bg},children:x("TOMORROW")})]})}),_.jsxs("tbody",{children:[t.map((D,F)=>{const Q=F===E,P=k4(D.adhan)<N,$=Q?m?"#F30303":"#E01919":m?"#DDF4E7":n.text;return _.jsxs("tr",{children:[_.jsx("td",{className:`font-bold text-3xl ${a?"py-1":"py-3"} ${y?"text-right pr-6":"text-left pl-6"}`,style:{color:$,backgroundColor:T},children:D.name==="Fajr end"?_.jsx(dd,{color:"orange",size:28}):x(D.name.toUpperCase())}),_.jsx("td",{className:`font-bold text-3xl ${a?"py-1":"py-3"}`,style:{backgroundColor:T},children:_.jsx("span",{className:P?"opacity-40":"",style:{color:$},children:D.adhan})}),_.jsx("td",{className:`font-bold text-3xl ${a?"":"py-3"}`,style:{backgroundColor:T},children:D.iqamah&&_.jsx("span",{className:"p-3 w-[92px] h-full text-center rounded-lg",style:{backgroundColor:a?"":m?"#DDF4E7":s?"#124170":r.text,color:a?Q?m?"#F30303":"#DE0404":m?"#D6EBDF":n.text:m?"#0C221F":s?"white":r.bg,fontWeight:"bold"},children:_.jsx("span",{className:P?"opacity-40":"opacity-100",children:D.iqamah})})}),_.jsx("td",{className:`font-extrabold text-3xl ${a?"py-1":"py-3"}`,style:{backgroundColor:T},children:_.jsx("span",{style:{color:$},children:D.tomorrow})})]},D.name||F)}),_.jsxs("tr",{className:`${a?"":"border-t-2"}`,style:{borderColor:m?"#DDF4E733":n.text+"33",color:m?"#DDF4E7":n.text},children:[_.jsx("td",{className:"pt-6",style:{backgroundColor:m?"#0C221F":n.bg}}),[1,2,3].map(D=>a?_.jsx("td",{className:"pt-6",style:{backgroundColor:m?"#0C221F":n.bg}},D):_.jsxs("td",{className:"text-xl font-medium pt-2",style:{backgroundColor:m?"#0C221F":n.bg,color:m?"#DDF4E7":n.text},children:[x("JAMAAT")," ",D]},D))]}),e.filter(D=>D.label==="Eid"?Array.isArray(D.time)&&D.time.some(F=>F&&F.trim()!==""):!0).map((D,F)=>_.jsxs("tr",{children:[_.jsx("td",{className:`font-bold text-3xl ${a?"py-1":"py-3"} w-65 ${y?"text-right pr-6":"text-left pl-6"}`,style:{color:m?"#DDF4E7":r.text,backgroundColor:m?"#0C221F":r.bg},children:x(D.label.toUpperCase())}),[0,1,2].map(Q=>_.jsx("td",{className:"text-center",style:{backgroundColor:m?"#0C221F":r.bg},children:_.jsx("p",{className:"text-3xl font-bold",style:{color:m?"#DDF4E7":r.text,minWidth:"4rem"},children:Array.isArray(D.time)?D.time[Q]||"":D.time||""})},Q))]},D.label||F))]})]})})})},P4=k.createContext(null),Z0={didCatch:!1,error:null};let pj=class extends k.Component{constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=Z0}static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(...e){var r,a;const{error:n}=this.state;n!==null&&((a=(r=this.props).onReset)==null||a.call(r,{args:e,reason:"imperative-api"}),this.setState(Z0))}componentDidCatch(e,n){var r,a;(a=(r=this.props).onError)==null||a.call(r,e,n)}componentDidUpdate(e,n){var s,l;const{didCatch:r}=this.state,{resetKeys:a}=this.props;r&&n.error!==null&&mj(e.resetKeys,a)&&((l=(s=this.props).onReset)==null||l.call(s,{next:a,prev:e.resetKeys,reason:"keys"}),this.setState(Z0))}render(){const{children:e,fallbackRender:n,FallbackComponent:r,fallback:a}=this.props,{didCatch:s,error:l}=this.state;let u=e;if(s){const c={error:l,resetErrorBoundary:this.resetErrorBoundary};if(typeof n=="function")u=n(c);else if(r)u=k.createElement(r,c);else if(a!==void 0)u=a;else throw l}return k.createElement(P4.Provider,{value:{didCatch:s,error:l,resetErrorBoundary:this.resetErrorBoundary}},u)}};function mj(t=[],e=[]){return t.length!==e.length||t.some((n,r)=>!Object.is(n,e[r]))}function gj(t){return t!==null&&typeof t=="object"&&"didCatch"in t&&typeof t.didCatch=="boolean"&&"error"in t&&"resetErrorBoundary"in t&&typeof t.resetErrorBoundary=="function"}function vj(t){if(!gj(t))throw new Error("ErrorBoundaryContext not found")}function I4(){const t=k.useContext(P4);vj(t);const{error:e,resetErrorBoundary:n}=t,[r,a]=k.useState({error:null,hasError:!1}),s=k.useMemo(()=>({error:e,resetBoundary:()=>{n(),a({error:null,hasError:!1})},showBoundary:l=>a({error:l,hasError:!0})}),[e,n]);if(r.hasError)throw r.error;return s}const yj={BackgroundDiv:t=>{const{prayerTimes:e,prayerTimesWithSunrise:n,extraInfo:r,date:a,isDefault:s,textColor:l,prayerTimesColor:u,extraInfoColor:c,...h}=t;return _.jsx("div",{...h})},TimeTablePart:nj,ClockPart:ij,MasjidLogo:vd,TimeAndDate:sj,ClockAndPrayers:uj,ExtraInfo:R4,CountdownBox:cj,DigitalClockPart:hj,TimeTable:M4};function _v({components:t,componentProps:e}){const{darkMode:n}=Ea();return _.jsx(_.Fragment,{children:t.map((r,a)=>{var l,u,c,h,d,g,y,m;const s=yj[r.type];if(s){const x={...r.props||{},...e};let E={};return n?(l=r.style)!=null&&l.darkBackgroundImage?E={backgroundImage:`url(${"https://yhbphdjhoxovcxfoimdx.supabase.co/storage/v1/object/public"+r.style.darkBackgroundImage})`,backgroundSize:"cover",backgroundPosition:"center",backgroundRepeat:"no-repeat"}:(u=r.style)!=null&&u.backgroundColor?E={backgroundColor:r.style.backgroundColor}:(c=r.style)!=null&&c.darkBackground&&(E={backgroundColor:r.style.darkBackground}):(h=r.style)!=null&&h.backgroundColor?E={backgroundColor:r.style.backgroundColor}:(d=r.style)!=null&&d.background?E={backgroundColor:r.style.background}:(g=r.style)!=null&&g.backgroundImage?E={backgroundImage:`url(${"https://yhbphdjhoxovcxfoimdx.supabase.co/storage/v1/object/public"+r.style.backgroundImage})`,backgroundSize:"cover",backgroundPosition:"center",backgroundRepeat:"no-repeat",filter:(y=r.style)==null?void 0:y.backgroundBlur}:(m=r.style)!=null&&m.background&&(E={backgroundColor:r.style.background}),_.jsx("div",{className:r.className||"",style:E,children:_.jsx(s,{...x})},a)}else return r.components&&r.gridConfig?_.jsx("div",{className:r.gridConfig.className+" "+(r.className||""),children:_.jsx(_v,{components:r.components,componentProps:e})},a):r.components?_.jsx("div",{className:r.className||"",children:_.jsx(_v,{components:r.components,componentProps:e})},a):null})})}function bj({config:t,componentProps:e={}}){const[n,r]=k.useState("loading"),{error:a,showBoundary:s}=I4();return k.useEffect(()=>{if(!t)return;const l=setTimeout(()=>{n==="loading"&&(!t||!t.components||!t.gridConfig)&&s(new Error("No Prayer hall layout configuration Found"))},5e3);return()=>clearTimeout(l)},[t,s]),k.useEffect(()=>{t!=null&&t.components&&t.gridConfig&&r("ready")},[t]),a?null:n==="loading"?_.jsx("div",{className:"min-h-screen flex items-center justify-center p-8 bg-gradient-to-br from-emerald-50 to-teal-50",children:_.jsxs("div",{className:"text-center max-w-md",children:[_.jsx("div",{className:"w-16 h-16 border-4 border-emerald-200 border-t-emerald-600 rounded-full animate-spin mx-auto mb-4"}),_.jsx("h2",{className:"text-xl font-semibold text-gray-900 mb-2",children:"Loading prayer hall..."}),_.jsx("p",{className:"text-gray-600",children:"Preparing prayer space"})]})}):_.jsx("div",{className:t.gridConfig.className||"",style:t.gridConfig.style,children:_.jsx(_v,{components:t.components,componentProps:e})})}const Mf=({classNames:t="border-black"})=>_.jsx("div",{className:"flex items-center justify-center h-full",children:_.jsx("div",{className:`w-8 h-8 border-3 border-t-transparent rounded-full animate-spin ${t}`})}),F4="prayer-times-db",vm="prayerTimes";async function wj(t,e,n){await(await Gr(F4,1,{upgrade(a){a.createObjectStore(vm)}})).put(vm,n,`${t}_${e}`)}async function Q0(t,e){return(await Gr(F4,1,{upgrade(r){r.createObjectStore(vm)}})).get(vm,`${t}_${e}`)}const Ch={Fajr:"فجر",Dhuhr:"ظهر",Asr:"عصر",Maghrib:"مغرب",Isha:"عشاء",Sunrise:"شروق",Jumuah:"جمعة","Fajr end":""},Ev={Fajr:"fajr",Dhuhr:"duhr",Asr:t=>{switch(t){case 1:return"shadow_1x";case 2:return"shadow_2x";case 3:return"wusta_noon_sunset";default:return"asr"}},Maghrib:"maghrib",Isha:"isha",Sunrise:"shuruq_sunrise","Fajr end":"fajr_endtime"};async function U4(t,e,n,r){try{const{data:a,error:s}=await ft.from("mosque_t").select(`
127
- *,
128
- location_postnumber (
129
- location_iso,
130
- location_t (
131
- asr_method
132
- )
133
- )
134
- `).eq("organisasjonsnummer",t).single();if(s)throw s;if(!a)throw new Error("Mosque not found");const l=new Date(e);l.setDate(l.getDate()+1);const u=l.toISOString().split("T")[0],c=a.location_postnumber.location_iso,h=r||a.prayer_method,[{data:d},{data:g},{data:y},{data:m}]=await Promise.all([ft.from("prayertime").select("*").eq("location_iso",c).eq("date",e).eq("prayer_method",h).maybeSingle(),ft.from("prayertime").select("*").eq("location_iso",c).eq("date",u).eq("prayer_method",h).maybeSingle(),ft.from("mosque_jamatperiode").select("*").eq("mosque_id",t).lte("start_date",e).gte("end_date",e).maybeSingle(),ft.from("mosque_jamatperiode").select("*").eq("mosque_id",t).lte("start_date",u).gte("end_date",u).maybeSingle()]);if(!d)throw new Error(`No prayer times found: Location: ${c}, Prayer Method: ${h}`);const x=["Fajr","Fajr end","Dhuhr","Asr","Maghrib","Isha"].map(N=>{var ne,I,z,J,ae;const O=Ev[N],T=a.location_postnumber.location_t.asr_method,D=typeof O=="function"?O(n!==0?n:T):O,F=N==="Asr"?"asr":N==="Dhuhr"?"dhuhr":D,Q=((ne=d==null?void 0:d[D])==null?void 0:ne.slice(0,5))||"",P=((I=g==null?void 0:g[D])==null?void 0:I.slice(0,5))||"";let $=(z=y==null?void 0:y[F])==null?void 0:z.slice(0,5),B=N==="Fajr end"?(J=g==null?void 0:g.fajr_endtime)==null?void 0:J.slice(0,5):(ae=m==null?void 0:m[F])==null?void 0:ae.slice(0,5);if(!$&&Q){const me=`${N.toLowerCase()}_offset`,Z=y==null?void 0:y[me];if(typeof Z=="number"){const[ce,oe]=Q.split(":").map(Number),ge=ce*60+oe+Z,he=String(Math.floor(ge/60)%24).padStart(2,"0"),U=String(ge%60).padStart(2,"0");$=`${he}:${U}`}else $=""}if(!B&&P){const me=`${N.toLowerCase()}_offset`,Z=m==null?void 0:m[me];if(typeof Z=="number"){const[ce,oe]=P.split(":").map(Number),ge=ce*60+oe+Z,he=String(Math.floor(ge/60)%24).padStart(2,"0"),U=String(ge%60).padStart(2,"0");B=`${he}:${U}`}else B=""}return{name:N,arabic:Ch[N],adhan:Q,iqamah:$,tomorrow:B}});let E;if(!(y!=null&&y.id))console.warn("Today's Jamaat is missing, skipping jummah query"),E=[];else{const{data:N,error:O}=await ft.from("mosque_jummah").select("jummah").eq("mosque_id",t).eq("jamat_id",y==null?void 0:y.id);if(O)throw O;E=N||null}const A=await Promise.all(["Jumuah","Eid"].map(async N=>{var D,F,Q,P;const O=Ev[N],T=typeof O=="function"?O(a.asr_method):O;if(N==="Jumuah"){const $=E.map(B=>{var ne;return(ne=B.jummah)==null?void 0:ne.slice(0,5)}).filter(Boolean).sort((B,ne)=>{const[I,z]=B.split(":").map(Number),[J,ae]=ne.split(":").map(Number),me=(I===12?12:I+12)*60+z,Z=(J===12?12:J+12)*60+ae;return me-Z});return{label:N,arabic:Ch[N],time:$||""}}if(N==="Eid"){const{data:$,error:B}=await ft.from("mosque_t").select("show_eid").eq("organisasjonsnummer",t).single();if(B||!$)return console.error("Error fetching Eid show data:",B),{label:N,arabic:Ch[N],time:[]};const ne=[(D=a.eidprayer_time1)==null?void 0:D.slice(0,5),(F=a.eidprayer_time2)==null?void 0:F.slice(0,5),(Q=a.eidprayer_time3)==null?void 0:Q.slice(0,5)].filter(Boolean);return{label:N,arabic:Ch[N],time:ne}}return{label:N,arabic:Ch[N],time:((P=d==null?void 0:d[T])==null?void 0:P.slice(0,5))||""}}));return{prayerTimes:x,extraInfo:A}}catch(a){console.error("Error fetching prayer times: ",a);const s=[{name:"Fajr",arabic:"فجر",adhan:"",iqamah:"",tomorrow:""},{name:"Fajr end",arabic:"الشروق",adhan:"",iqamah:"",tomorrow:""},{name:"Dhuhr",arabic:"ظهر",adhan:"",iqamah:"",tomorrow:""},{name:"Asr",arabic:"عصر",adhan:"",iqamah:"",tomorrow:""},{name:"Maghrib",arabic:"مغرب",adhan:"",iqamah:"",tomorrow:""},{name:"Isha",arabic:"عشاء",adhan:"",iqamah:"",tomorrow:""}],l=[{label:"Jumuah",arabic:"جمعة",time:["",""]}];return await fa(a,{message:"Error fetching prayer times",function:"fetchPrayerTimesFromSupabase"}),Un("error","Failed to fetch prayer times"),{prayerTimes:s,extraInfo:l}}}const xj=async(t,e,n,r)=>{const{data:a}=await ft.from("prayertime").select(`
135
- *,
136
- location_t (
137
- asr_method
138
- )
139
- `).eq("location_iso",t).eq("date",e).eq("prayer_method",r).single();return{prayerTimes:["Fajr","Fajr end","Dhuhr","Asr","Maghrib","Isha"].map(l=>{var g;const u=Ev[l],c=a==null?void 0:a.location_t.asr_method,h=typeof u=="function"?u(n!==0?n:c):u,d=((g=a==null?void 0:a[h])==null?void 0:g.slice(0,5))||"";return{name:l,adhan:d,iqamah:"",tomorrow:""}})}},Sj=async(t,e,n,r,a)=>{try{const{data:s,error:l}=await ft.from("prayertime").select("*").eq("location_iso",t).eq("prayer_method",a).gte("date",e).lte("date",n).order("date");if(l)throw l;if(!s||s.length===0)return[];const c=(d=>{switch(d){case 1:return"shadow_1x";case 2:return"shadow_2x";case 3:return"wusta_noon_sunset";default:return"asr"}})(r);return s.map(d=>{var g,y,m,x,E,A;return{date:d.date,fajr:((g=d.fajr)==null?void 0:g.slice(0,5))||"",sunrise:((y=d.shuruq_sunrise)==null?void 0:y.slice(0,5))||"",dhuhr:((m=d.duhr)==null?void 0:m.slice(0,5))||"",asr:((x=d[c])==null?void 0:x.slice(0,5))||"",maghrib:((E=d.maghrib)==null?void 0:E.slice(0,5))||"",isha:((A=d.isha)==null?void 0:A.slice(0,5))||""}})}catch(s){throw console.error("Unexpected error in getPrayerTimesInADateRange:",s),s}};function B4(t,e){const[n,r]=k.useState([]),[a,s]=k.useState([]),[l,u]=k.useState(!0);return k.useEffect(()=>{if(!t)return;r([]),s([]),u(!0);const c=async()=>{if(!navigator.onLine){const g=await Q0(t,e);g?(r(g.prayerTimes),s(g.extraInfo)):(r([]),s([])),u(!1);return}try{const{prayerTimes:g,extraInfo:y}=await U4(t,e);if(r(g||[]),s(y||[]),(g==null?void 0:g.length)>0&&y)await wj(t,e,{prayerTimes:g,extraInfo:y});else{const m=await Q0(t,e);m&&(r(m.prayerTimes),s(m.extraInfo))}}catch(g){console.error("Failed to fetch prayer times:",g);const y=await Q0(t,e);y?(r(y.prayerTimes),s(y.extraInfo)):(r([]),s([]))}finally{u(!1)}};c();const h=ft.channel("prayer_times_changes").on("postgres_changes",{event:"*",schema:"public",table:"mosque_jamatperiode",filter:`mosque_id=eq.${t}`},()=>{c()}).subscribe(),d=ft.channel("mosque_t_changes").on("postgres_changes",{event:"*",schema:"public",table:"mosque_t",filter:`organisasjonsnummer=eq.${t}`},()=>{c()}).subscribe();return()=>{ft.removeChannel(h),ft.removeChannel(d)}},[t,e]),k.useEffect(()=>{const c=()=>{Un("success","Back online!")},h=()=>{Un("warning","You are offline!")};return window.addEventListener("online",c),window.addEventListener("offline",h),()=>{window.removeEventListener("online",c),window.removeEventListener("offline",h)}},[]),{prayerTimes:n,extraInfo:a,loading:l}}const _j="layout-db",ym="layoutConfig";async function $4(){return Gr(_j,2,{upgrade(t){t.objectStoreNames.contains(ym)||t.createObjectStore(ym)}})}async function ec(t,e){await(await $4()).put(ym,e,t)}async function Pf(t){return(await $4()).get(ym,t)}function Ej(t){const[e,n]=k.useState(null),[r,a]=k.useState(!0);return k.useEffect(()=>{let s=null;if(!t){n(null),a(!1);return}const l=async()=>{if(a(!0),!navigator.onLine){const u=await Pf(`${t}-prayerhall`);if(u){n(u),a(!1);return}}try{const{data:u}=await ft.from("layout").select("prayerhall_theme_id, prayerhall_layout").eq("mosque_id",t).single();if(u&&u.prayerhall_layout)n(u.prayerhall_layout),await ec(`${t}-prayerhall`,u.prayerhall_layout);else{const{data:c,error:h}=await ft.from("mosque_t").select("organisasjonsnummer").eq("organisasjonsnummer",t).single();if(!c||h){Un("error","Please enter a valid org_nr!");return}if(c){const{data:d,error:g}=await ft.from("layout").select("prayerhall_theme_id, prayerhall_layout").eq("mosque_id",982842840).single();if(g)throw g;const{error:y}=await ft.from("layout").upsert([{mosque_id:t,prayerhall_theme_id:d.prayerhall_theme_id,prayerhall_layout:d==null?void 0:d.prayerhall_layout}],{onConflict:"mosque_id"}).single();if(y)throw y;n(d==null?void 0:d.prayerhall_layout),await ec(`${t}-prayerhall`,d==null?void 0:d.prayerhall_layout)}}}catch(u){const c=await Pf(`${t}-prayerhall`);n(c||null),console.log("Error fetching or creating config: ",u),await fa(u,{mosqueId:t})}finally{a(!1)}};return l(),s=ft.channel(`prayerhall_layout_changes:${t}`).on("postgres_changes",{event:"*",schema:"public",table:"layout",filter:`mosque_id=eq.${t}`},()=>{l()}).subscribe(),()=>{s==null||s.unsubscribe()}},[t]),{config:e,loading:r}}function v2(t){return Aa({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M7 8h10c.29 0 .57.06.84.13.09-.33.16-.67.16-1.04 0-1.31-.65-2.53-1.74-3.25L12 1 7.74 3.84A3.887 3.887 0 0 0 6 7.09c0 .37.07.71.16 1.04.27-.07.55-.13.84-.13z"},child:[]},{tag:"path",attr:{d:"M24 7c0-1.1-2-3-2-3s-2 1.9-2 3c0 .74.4 1.38 1 1.72V13h-2v-2c0-1.1-.9-2-2-2H7c-1.1 0-2 .9-2 2v2H3V8.72c.6-.34 1-.98 1-1.72 0-1.1-2-3-2-3S0 5.9 0 7c0 .74.4 1.38 1 1.72V21h9v-4c0-1.1.9-2 2-2s2 .9 2 2v4h9V8.72c.6-.34 1-.98 1-1.72z"},child:[]}]})(t)}function Aj(t){return Aa({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z"},child:[]}]})(t)}function Nj(t){return Aa({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"},child:[]}]})(t)}const z4=({targetRef:t})=>{const[e,n]=k.useState(!1);k.useEffect(()=>{const a=()=>{n(!!document.fullscreenElement)};return document.addEventListener("fullscreenchange",a),()=>{document.removeEventListener("fullscreenchange",a)}},[]);const r=()=>{var a;document.fullscreenElement?document.exitFullscreen():(a=t.current)==null||a.requestFullscreen()};return _.jsx("button",{onClick:r,className:`absolute top-4 right-4 z-50 ${e?"bg-white/40 hover:bg-white/50":"bg-white/80 hover:bg-white/90"} rounded shadow hover:cursor-pointer`,title:e?"Exit Fullscreen":"Enter Fullscreen",children:e?_.jsx(Aj,{size:30}):_.jsx(Nj,{size:30})})};function q4(t){if(!t[1].adhan||!t[4].adhan)return"light";const e=new Date;function n(s){const[l,u]=s.split(":").map(Number),c=new Date(e);return c.setHours(l,u,0,0),c}const r=n(t[1].adhan),a=n(t[4].adhan);return e>=r&&e<a?"light":"dark"}function Cj(t){return Aa({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M223.7 239l136-136c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9L319.9 256l96.4 96.4c9.4 9.4 9.4 24.6 0 33.9L393.7 409c-9.4 9.4-24.6 9.4-33.9 0l-136-136c-9.5-9.4-9.5-24.6-.1-34zm-192 34l136 136c9.4 9.4 24.6 9.4 33.9 0l22.6-22.6c9.4-9.4 9.4-24.6 0-33.9L127.9 256l96.4-96.4c9.4-9.4 9.4-24.6 0-33.9L201.7 103c-9.4-9.4-24.6-9.4-33.9 0l-136 136c-9.5 9.4-9.5 24.6-.1 34z"},child:[]}]})(t)}function Tj(t){return Aa({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M224.3 273l-136 136c-9.4 9.4-24.6 9.4-33.9 0l-22.6-22.6c-9.4-9.4-9.4-24.6 0-33.9l96.4-96.4-96.4-96.4c-9.4-9.4-9.4-24.6 0-33.9L54.3 103c9.4-9.4 24.6-9.4 33.9 0l136 136c9.5 9.4 9.5 24.6.1 34zm192-34l-136-136c-9.4-9.4-24.6-9.4-33.9 0l-22.6 22.6c-9.4 9.4-9.4 24.6 0 33.9l96.4 96.4-96.4 96.4c-9.4 9.4-9.4 24.6 0 33.9l22.6 22.6c9.4 9.4 24.6 9.4 33.9 0l136-136c9.4-9.2 9.4-24.4 0-33.8z"},child:[]}]})(t)}function Lj(t){return Aa({attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M34.52 239.03L228.87 44.69c9.37-9.37 24.57-9.37 33.94 0l22.67 22.67c9.36 9.36 9.37 24.52.04 33.9L131.49 256l154.02 154.75c9.34 9.38 9.32 24.54-.04 33.9l-22.67 22.67c-9.37 9.37-24.57 9.37-33.94 0L34.52 272.97c-9.37-9.37-9.37-24.57 0-33.94z"},child:[]}]})(t)}function Oj(t){return Aa({attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M285.476 272.971L91.132 467.314c-9.373 9.373-24.569 9.373-33.941 0l-22.667-22.667c-9.357-9.357-9.375-24.522-.04-33.901L188.505 256 34.484 101.255c-9.335-9.379-9.317-24.544.04-33.901l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L285.475 239.03c9.373 9.372 9.373 24.568.001 33.941z"},child:[]}]})(t)}function H4(t){return Aa({attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M272 0H48C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h224c26.5 0 48-21.5 48-48V48c0-26.5-21.5-48-48-48zM160 480c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm112-108c0 6.6-5.4 12-12 12H60c-6.6 0-12-5.4-12-12V60c0-6.6 5.4-12 12-12h200c6.6 0 12 5.4 12 12v312z"},child:[]}]})(t)}function jj(t){return Aa({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M497.39 361.8l-112-48a24 24 0 0 0-28 6.9l-49.6 60.6A370.66 370.66 0 0 1 130.6 204.11l60.6-49.6a23.94 23.94 0 0 0 6.9-28l-48-112A24.16 24.16 0 0 0 122.6.61l-104 24A24 24 0 0 0 0 48c0 256.5 207.9 464 464 464a24 24 0 0 0 23.4-18.6l24-104a24.29 24.29 0 0 0-14.01-27.6z"},child:[]}]})(t)}function V4(t){return Aa({attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M256 128c35.35 0 64-28.65 64-64S291.35 0 256 0s-64 28.65-64 64 28.65 64 64 64zm-30.63 169.75c14.06 16.72 39 19.09 55.97 5.22l88-72.02c17.09-13.98 19.59-39.19 5.62-56.28-13.97-17.11-39.19-19.59-56.31-5.62l-57.44 47-38.91-46.31c-15.44-18.39-39.22-27.92-64-25.33-24.19 2.48-45.25 16.27-56.37 36.92l-49.37 92.03c-23.4 43.64-8.69 96.37 34.19 123.75L131.56 432H40c-22.09 0-40 17.91-40 40s17.91 40 40 40h208c34.08 0 53.77-42.79 28.28-68.28L166.42 333.86l34.8-64.87 24.15 28.76z"},child:[]}]})(t)}function e1(t){return Aa({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M148 288h-40c-6.6 0-12-5.4-12-12v-40c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12zm108-12v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12zm96 0v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12zm-96 96v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12zm-96 0v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12zm192 0v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12zm96-260v352c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V112c0-26.5 21.5-48 48-48h48V12c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v52h128V12c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v52h48c26.5 0 48 21.5 48 48zm-48 346V160H48v298c0 3.3 2.7 6 6 6h340c3.3 0 6-2.7 6-6z"},child:[]}]})(t)}const nn=t=>typeof t=="string",Th=()=>{let t,e;const n=new Promise((r,a)=>{t=r,e=a});return n.resolve=t,n.reject=e,n},Sw=t=>t==null?"":""+t,Rj=(t,e,n)=>{t.forEach(r=>{e[r]&&(n[r]=e[r])})},Dj=/###/g,_w=t=>t&&t.indexOf("###")>-1?t.replace(Dj,"."):t,Ew=t=>!t||nn(t),Bh=(t,e,n)=>{const r=nn(e)?e.split("."):e;let a=0;for(;a<r.length-1;){if(Ew(t))return{};const s=_w(r[a]);!t[s]&&n&&(t[s]=new n),Object.prototype.hasOwnProperty.call(t,s)?t=t[s]:t={},++a}return Ew(t)?{}:{obj:t,k:_w(r[a])}},Aw=(t,e,n)=>{const{obj:r,k:a}=Bh(t,e,Object);if(r!==void 0||e.length===1){r[a]=n;return}let s=e[e.length-1],l=e.slice(0,e.length-1),u=Bh(t,l,Object);for(;u.obj===void 0&&l.length;)s=`${l[l.length-1]}.${s}`,l=l.slice(0,l.length-1),u=Bh(t,l,Object),u!=null&&u.obj&&typeof u.obj[`${u.k}.${s}`]<"u"&&(u.obj=void 0);u.obj[`${u.k}.${s}`]=n},kj=(t,e,n,r)=>{const{obj:a,k:s}=Bh(t,e,Object);a[s]=a[s]||[],a[s].push(n)},bm=(t,e)=>{const{obj:n,k:r}=Bh(t,e);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},Mj=(t,e,n)=>{const r=bm(t,n);return r!==void 0?r:bm(e,n)},Y4=(t,e,n)=>{for(const r in e)r!=="__proto__"&&r!=="constructor"&&(r in t?nn(t[r])||t[r]instanceof String||nn(e[r])||e[r]instanceof String?n&&(t[r]=e[r]):Y4(t[r],e[r],n):t[r]=e[r]);return t},of=t=>t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var Pj={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const Ij=t=>nn(t)?t.replace(/[&<>"'\/]/g,e=>Pj[e]):t;class Fj{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const n=this.regExpMap.get(e);if(n!==void 0)return n;const r=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,r),this.regExpQueue.push(e),r}}const Uj=[" ",",","?","!",";"],Bj=new Fj(20),$j=(t,e,n)=>{e=e||"",n=n||"";const r=Uj.filter(l=>e.indexOf(l)<0&&n.indexOf(l)<0);if(r.length===0)return!0;const a=Bj.getRegExp(`(${r.map(l=>l==="?"?"\\?":l).join("|")})`);let s=!a.test(t);if(!s){const l=t.indexOf(n);l>0&&!a.test(t.substring(0,l))&&(s=!0)}return s},Av=(t,e,n=".")=>{if(!t)return;if(t[e])return Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0;const r=e.split(n);let a=t;for(let s=0;s<r.length;){if(!a||typeof a!="object")return;let l,u="";for(let c=s;c<r.length;++c)if(c!==s&&(u+=n),u+=r[c],l=a[u],l!==void 0){if(["string","number","boolean"].indexOf(typeof l)>-1&&c<r.length-1)continue;s+=c-s+1;break}a=l}return a},td=t=>t==null?void 0:t.replace("_","-"),zj={type:"logger",log(t){this.output("log",t)},warn(t){this.output("warn",t)},error(t){this.output("error",t)},output(t,e){var n,r;(r=(n=console==null?void 0:console[t])==null?void 0:n.apply)==null||r.call(n,console,e)}};class wm{constructor(e,n={}){this.init(e,n)}init(e,n={}){this.prefix=n.prefix||"i18next:",this.logger=e||zj,this.options=n,this.debug=n.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,n,r,a){return a&&!this.debug?null:(nn(e[0])&&(e[0]=`${r}${this.prefix} ${e[0]}`),this.logger[n](e))}create(e){return new wm(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new wm(this.logger,e)}}var Oo=new wm;class ig{constructor(){this.observers={}}on(e,n){return e.split(" ").forEach(r=>{this.observers[r]||(this.observers[r]=new Map);const a=this.observers[r].get(n)||0;this.observers[r].set(n,a+1)}),this}off(e,n){if(this.observers[e]){if(!n){delete this.observers[e];return}this.observers[e].delete(n)}}emit(e,...n){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([a,s])=>{for(let l=0;l<s;l++)a(...n)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([a,s])=>{for(let l=0;l<s;l++)a.apply(a,[e,...n])})}}class Nw extends ig{constructor(e,n={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const n=this.options.ns.indexOf(e);n>-1&&this.options.ns.splice(n,1)}getResource(e,n,r,a={}){var h,d;const s=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator,l=a.ignoreJSONStructure!==void 0?a.ignoreJSONStructure:this.options.ignoreJSONStructure;let u;e.indexOf(".")>-1?u=e.split("."):(u=[e,n],r&&(Array.isArray(r)?u.push(...r):nn(r)&&s?u.push(...r.split(s)):u.push(r)));const c=bm(this.data,u);return!c&&!n&&!r&&e.indexOf(".")>-1&&(e=u[0],n=u[1],r=u.slice(2).join(".")),c||!l||!nn(r)?c:Av((d=(h=this.data)==null?void 0:h[e])==null?void 0:d[n],r,s)}addResource(e,n,r,a,s={silent:!1}){const l=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator;let u=[e,n];r&&(u=u.concat(l?r.split(l):r)),e.indexOf(".")>-1&&(u=e.split("."),a=n,n=u[1]),this.addNamespaces(n),Aw(this.data,u,a),s.silent||this.emit("added",e,n,r,a)}addResources(e,n,r,a={silent:!1}){for(const s in r)(nn(r[s])||Array.isArray(r[s]))&&this.addResource(e,n,s,r[s],{silent:!0});a.silent||this.emit("added",e,n,r)}addResourceBundle(e,n,r,a,s,l={silent:!1,skipCopy:!1}){let u=[e,n];e.indexOf(".")>-1&&(u=e.split("."),a=r,r=n,n=u[1]),this.addNamespaces(n);let c=bm(this.data,u)||{};l.skipCopy||(r=JSON.parse(JSON.stringify(r))),a?Y4(c,r,s):c={...c,...r},Aw(this.data,u,c),l.silent||this.emit("added",e,n,r)}removeResourceBundle(e,n){this.hasResourceBundle(e,n)&&delete this.data[e][n],this.removeNamespaces(n),this.emit("removed",e,n)}hasResourceBundle(e,n){return this.getResource(e,n)!==void 0}getResourceBundle(e,n){return n||(n=this.options.defaultNS),this.getResource(e,n)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const n=this.getDataByLanguage(e);return!!(n&&Object.keys(n)||[]).find(a=>n[a]&&Object.keys(n[a]).length>0)}toJSON(){return this.data}}var G4={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,e,n,r,a){return t.forEach(s=>{var l;e=((l=this.processors[s])==null?void 0:l.process(e,n,r,a))??e}),e}};const W4=Symbol("i18next/PATH_KEY");function qj(){const t=[],e=Object.create(null);let n;return e.get=(r,a)=>{var s;return(s=n==null?void 0:n.revoke)==null||s.call(n),a===W4?t:(t.push(a),n=Proxy.revocable(r,e),n.proxy)},Proxy.revocable(Object.create(null),e).proxy}function Nv(t,e){const{[W4]:n}=t(qj());return n.join((e==null?void 0:e.keySeparator)??".")}const Cw={},t1=t=>!nn(t)&&typeof t!="boolean"&&typeof t!="number";class xm extends ig{constructor(e,n={}){super(),Rj(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Oo.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e,n={interpolation:{}}){const r={...n};if(e==null)return!1;const a=this.resolve(e,r);if((a==null?void 0:a.res)===void 0)return!1;const s=t1(a.res);return!(r.returnObjects===!1&&s)}extractFromKey(e,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const a=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let s=n.ns||this.options.defaultNS||[];const l=r&&e.indexOf(r)>-1,u=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!$j(e,r,a);if(l&&!u){const c=e.match(this.interpolator.nestingRegexp);if(c&&c.length>0)return{key:e,namespaces:nn(s)?[s]:s};const h=e.split(r);(r!==a||r===a&&this.options.ns.indexOf(h[0])>-1)&&(s=h.shift()),e=h.join(a)}return{key:e,namespaces:nn(s)?[s]:s}}translate(e,n,r){let a=typeof n=="object"?{...n}:n;if(typeof a!="object"&&this.options.overloadTranslationOptionHandler&&(a=this.options.overloadTranslationOptionHandler(arguments)),typeof a=="object"&&(a={...a}),a||(a={}),e==null)return"";typeof e=="function"&&(e=Nv(e,{...this.options,...a})),Array.isArray(e)||(e=[String(e)]);const s=a.returnDetails!==void 0?a.returnDetails:this.options.returnDetails,l=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator,{key:u,namespaces:c}=this.extractFromKey(e[e.length-1],a),h=c[c.length-1];let d=a.nsSeparator!==void 0?a.nsSeparator:this.options.nsSeparator;d===void 0&&(d=":");const g=a.lng||this.language,y=a.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((g==null?void 0:g.toLowerCase())==="cimode")return y?s?{res:`${h}${d}${u}`,usedKey:u,exactUsedKey:u,usedLng:g,usedNS:h,usedParams:this.getUsedParamsDetails(a)}:`${h}${d}${u}`:s?{res:u,usedKey:u,exactUsedKey:u,usedLng:g,usedNS:h,usedParams:this.getUsedParamsDetails(a)}:u;const m=this.resolve(e,a);let x=m==null?void 0:m.res;const E=(m==null?void 0:m.usedKey)||u,A=(m==null?void 0:m.exactUsedKey)||u,N=["[object Number]","[object Function]","[object RegExp]"],O=a.joinArrays!==void 0?a.joinArrays:this.options.joinArrays,T=!this.i18nFormat||this.i18nFormat.handleAsObject,D=a.count!==void 0&&!nn(a.count),F=xm.hasDefaultValue(a),Q=D?this.pluralResolver.getSuffix(g,a.count,a):"",P=a.ordinal&&D?this.pluralResolver.getSuffix(g,a.count,{ordinal:!1}):"",$=D&&!a.ordinal&&a.count===0,B=$&&a[`defaultValue${this.options.pluralSeparator}zero`]||a[`defaultValue${Q}`]||a[`defaultValue${P}`]||a.defaultValue;let ne=x;T&&!x&&F&&(ne=B);const I=t1(ne),z=Object.prototype.toString.apply(ne);if(T&&ne&&I&&N.indexOf(z)<0&&!(nn(O)&&Array.isArray(ne))){if(!a.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const J=this.options.returnedObjectHandler?this.options.returnedObjectHandler(E,ne,{...a,ns:c}):`key '${u} (${this.language})' returned an object instead of string.`;return s?(m.res=J,m.usedParams=this.getUsedParamsDetails(a),m):J}if(l){const J=Array.isArray(ne),ae=J?[]:{},me=J?A:E;for(const Z in ne)if(Object.prototype.hasOwnProperty.call(ne,Z)){const ce=`${me}${l}${Z}`;F&&!x?ae[Z]=this.translate(ce,{...a,defaultValue:t1(B)?B[Z]:void 0,joinArrays:!1,ns:c}):ae[Z]=this.translate(ce,{...a,joinArrays:!1,ns:c}),ae[Z]===ce&&(ae[Z]=ne[Z])}x=ae}}else if(T&&nn(O)&&Array.isArray(x))x=x.join(O),x&&(x=this.extendTranslation(x,e,a,r));else{let J=!1,ae=!1;!this.isValidLookup(x)&&F&&(J=!0,x=B),this.isValidLookup(x)||(ae=!0,x=u);const Z=(a.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&ae?void 0:x,ce=F&&B!==x&&this.options.updateMissing;if(ae||J||ce){if(this.logger.log(ce?"updateKey":"missingKey",g,h,u,ce?B:x),l){const U=this.resolve(u,{...a,keySeparator:!1});U&&U.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let oe=[];const ge=this.languageUtils.getFallbackCodes(this.options.fallbackLng,a.lng||this.language);if(this.options.saveMissingTo==="fallback"&&ge&&ge[0])for(let U=0;U<ge.length;U++)oe.push(ge[U]);else this.options.saveMissingTo==="all"?oe=this.languageUtils.toResolveHierarchy(a.lng||this.language):oe.push(a.lng||this.language);const he=(U,j,Y)=>{var ie;const K=F&&Y!==x?Y:Z;this.options.missingKeyHandler?this.options.missingKeyHandler(U,h,j,K,ce,a):(ie=this.backendConnector)!=null&&ie.saveMissing&&this.backendConnector.saveMissing(U,h,j,K,ce,a),this.emit("missingKey",U,h,j,x)};this.options.saveMissing&&(this.options.saveMissingPlurals&&D?oe.forEach(U=>{const j=this.pluralResolver.getSuffixes(U,a);$&&a[`defaultValue${this.options.pluralSeparator}zero`]&&j.indexOf(`${this.options.pluralSeparator}zero`)<0&&j.push(`${this.options.pluralSeparator}zero`),j.forEach(Y=>{he([U],u+Y,a[`defaultValue${Y}`]||B)})}):he(oe,u,B))}x=this.extendTranslation(x,e,a,m,r),ae&&x===u&&this.options.appendNamespaceToMissingKey&&(x=`${h}${d}${u}`),(ae||J)&&this.options.parseMissingKeyHandler&&(x=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${h}${d}${u}`:u,J?x:void 0,a))}return s?(m.res=x,m.usedParams=this.getUsedParamsDetails(a),m):x}extendTranslation(e,n,r,a,s){var c,h;if((c=this.i18nFormat)!=null&&c.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||a.usedLng,a.usedNS,a.usedKey,{resolved:a});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const d=nn(e)&&(((h=r==null?void 0:r.interpolation)==null?void 0:h.skipOnVariables)!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let g;if(d){const m=e.match(this.interpolator.nestingRegexp);g=m&&m.length}let y=r.replace&&!nn(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(y={...this.options.interpolation.defaultVariables,...y}),e=this.interpolator.interpolate(e,y,r.lng||this.language||a.usedLng,r),d){const m=e.match(this.interpolator.nestingRegexp),x=m&&m.length;g<x&&(r.nest=!1)}!r.lng&&a&&a.res&&(r.lng=this.language||a.usedLng),r.nest!==!1&&(e=this.interpolator.nest(e,(...m)=>(s==null?void 0:s[0])===m[0]&&!r.context?(this.logger.warn(`It seems you are nesting recursively key: ${m[0]} in key: ${n[0]}`),null):this.translate(...m,n),r)),r.interpolation&&this.interpolator.reset()}const l=r.postProcess||this.options.postProcess,u=nn(l)?[l]:l;return e!=null&&(u!=null&&u.length)&&r.applyPostProcessor!==!1&&(e=G4.handle(u,e,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...a,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),e}resolve(e,n={}){let r,a,s,l,u;return nn(e)&&(e=[e]),e.forEach(c=>{if(this.isValidLookup(r))return;const h=this.extractFromKey(c,n),d=h.key;a=d;let g=h.namespaces;this.options.fallbackNS&&(g=g.concat(this.options.fallbackNS));const y=n.count!==void 0&&!nn(n.count),m=y&&!n.ordinal&&n.count===0,x=n.context!==void 0&&(nn(n.context)||typeof n.context=="number")&&n.context!=="",E=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);g.forEach(A=>{var N,O;this.isValidLookup(r)||(u=A,!Cw[`${E[0]}-${A}`]&&((N=this.utils)!=null&&N.hasLoadedNamespace)&&!((O=this.utils)!=null&&O.hasLoadedNamespace(u))&&(Cw[`${E[0]}-${A}`]=!0,this.logger.warn(`key "${a}" for languages "${E.join(", ")}" won't get resolved as namespace "${u}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),E.forEach(T=>{var Q;if(this.isValidLookup(r))return;l=T;const D=[d];if((Q=this.i18nFormat)!=null&&Q.addLookupKeys)this.i18nFormat.addLookupKeys(D,d,T,A,n);else{let P;y&&(P=this.pluralResolver.getSuffix(T,n.count,n));const $=`${this.options.pluralSeparator}zero`,B=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(y&&(n.ordinal&&P.indexOf(B)===0&&D.push(d+P.replace(B,this.options.pluralSeparator)),D.push(d+P),m&&D.push(d+$)),x){const ne=`${d}${this.options.contextSeparator||"_"}${n.context}`;D.push(ne),y&&(n.ordinal&&P.indexOf(B)===0&&D.push(ne+P.replace(B,this.options.pluralSeparator)),D.push(ne+P),m&&D.push(ne+$))}}let F;for(;F=D.pop();)this.isValidLookup(r)||(s=F,r=this.getResource(T,A,F,n))}))})}),{res:r,usedKey:a,exactUsedKey:s,usedLng:l,usedNS:u}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,n,r,a={}){var s;return(s=this.i18nFormat)!=null&&s.getResource?this.i18nFormat.getResource(e,n,r,a):this.resourceStore.getResource(e,n,r,a)}getUsedParamsDetails(e={}){const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=e.replace&&!nn(e.replace);let a=r?e.replace:e;if(r&&typeof e.count<"u"&&(a.count=e.count),this.options.interpolation.defaultVariables&&(a={...this.options.interpolation.defaultVariables,...a}),!r){a={...a};for(const s of n)delete a[s]}return a}static hasDefaultValue(e){const n="defaultValue";for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&n===r.substring(0,n.length)&&e[r]!==void 0)return!0;return!1}}class Tw{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Oo.create("languageUtils")}getScriptPartFromCode(e){if(e=td(e),!e||e.indexOf("-")<0)return null;const n=e.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(e){if(e=td(e),!e||e.indexOf("-")<0)return e;const n=e.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(e){if(nn(e)&&e.indexOf("-")>-1){let n;try{n=Intl.getCanonicalLocales(e)[0]}catch{}return n&&this.options.lowerCaseLng&&(n=n.toLowerCase()),n||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let n;return e.forEach(r=>{if(n)return;const a=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(a))&&(n=a)}),!n&&this.options.supportedLngs&&e.forEach(r=>{if(n)return;const a=this.getScriptPartFromCode(r);if(this.isSupportedCode(a))return n=a;const s=this.getLanguagePartFromCode(r);if(this.isSupportedCode(s))return n=s;n=this.options.supportedLngs.find(l=>{if(l===s)return l;if(!(l.indexOf("-")<0&&s.indexOf("-")<0)&&(l.indexOf("-")>0&&s.indexOf("-")<0&&l.substring(0,l.indexOf("-"))===s||l.indexOf(s)===0&&s.length>1))return l})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(e,n){if(!e)return[];if(typeof e=="function"&&(e=e(n)),nn(e)&&(e=[e]),Array.isArray(e))return e;if(!n)return e.default||[];let r=e[n];return r||(r=e[this.getScriptPartFromCode(n)]),r||(r=e[this.formatLanguageCode(n)]),r||(r=e[this.getLanguagePartFromCode(n)]),r||(r=e.default),r||[]}toResolveHierarchy(e,n){const r=this.getFallbackCodes((n===!1?[]:n)||this.options.fallbackLng||[],e),a=[],s=l=>{l&&(this.isSupportedCode(l)?a.push(l):this.logger.warn(`rejecting language code not found in supportedLngs: ${l}`))};return nn(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&s(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&s(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&s(this.getLanguagePartFromCode(e))):nn(e)&&s(this.formatLanguageCode(e)),r.forEach(l=>{a.indexOf(l)<0&&s(this.formatLanguageCode(l))}),a}}const Lw={zero:0,one:1,two:2,few:3,many:4,other:5},Ow={select:t=>t===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class Hj{constructor(e,n={}){this.languageUtils=e,this.options=n,this.logger=Oo.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,n={}){const r=td(e==="dev"?"en":e),a=n.ordinal?"ordinal":"cardinal",s=JSON.stringify({cleanedCode:r,type:a});if(s in this.pluralRulesCache)return this.pluralRulesCache[s];let l;try{l=new Intl.PluralRules(r,{type:a})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),Ow;if(!e.match(/-|_/))return Ow;const c=this.languageUtils.getLanguagePartFromCode(e);l=this.getRule(c,n)}return this.pluralRulesCache[s]=l,l}needsPlural(e,n={}){let r=this.getRule(e,n);return r||(r=this.getRule("dev",n)),(r==null?void 0:r.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(e,n,r={}){return this.getSuffixes(e,r).map(a=>`${n}${a}`)}getSuffixes(e,n={}){let r=this.getRule(e,n);return r||(r=this.getRule("dev",n)),r?r.resolvedOptions().pluralCategories.sort((a,s)=>Lw[a]-Lw[s]).map(a=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${a}`):[]}getSuffix(e,n,r={}){const a=this.getRule(e,r);return a?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${a.select(n)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",n,r))}}const jw=(t,e,n,r=".",a=!0)=>{let s=Mj(t,e,n);return!s&&a&&nn(n)&&(s=Av(t,n,r),s===void 0&&(s=Av(e,n,r))),s},n1=t=>t.replace(/\$/g,"$$$$");class Rw{constructor(e={}){var n;this.logger=Oo.create("interpolator"),this.options=e,this.format=((n=e==null?void 0:e.interpolation)==null?void 0:n.format)||(r=>r),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:a,prefix:s,prefixEscaped:l,suffix:u,suffixEscaped:c,formatSeparator:h,unescapeSuffix:d,unescapePrefix:g,nestingPrefix:y,nestingPrefixEscaped:m,nestingSuffix:x,nestingSuffixEscaped:E,nestingOptionsSeparator:A,maxReplaces:N,alwaysFormat:O}=e.interpolation;this.escape=n!==void 0?n:Ij,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=a!==void 0?a:!1,this.prefix=s?of(s):l||"{{",this.suffix=u?of(u):c||"}}",this.formatSeparator=h||",",this.unescapePrefix=d?"":g||"-",this.unescapeSuffix=this.unescapePrefix?"":d||"",this.nestingPrefix=y?of(y):m||of("$t("),this.nestingSuffix=x?of(x):E||of(")"),this.nestingOptionsSeparator=A||",",this.maxReplaces=N||1e3,this.alwaysFormat=O!==void 0?O:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(n,r)=>(n==null?void 0:n.source)===r?(n.lastIndex=0,n):new RegExp(r,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,n,r,a){var m;let s,l,u;const c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},h=x=>{if(x.indexOf(this.formatSeparator)<0){const O=jw(n,c,x,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(O,void 0,r,{...a,...n,interpolationkey:x}):O}const E=x.split(this.formatSeparator),A=E.shift().trim(),N=E.join(this.formatSeparator).trim();return this.format(jw(n,c,A,this.options.keySeparator,this.options.ignoreJSONStructure),N,r,{...a,...n,interpolationkey:A})};this.resetRegExp();const d=(a==null?void 0:a.missingInterpolationHandler)||this.options.missingInterpolationHandler,g=((m=a==null?void 0:a.interpolation)==null?void 0:m.skipOnVariables)!==void 0?a.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:x=>n1(x)},{regex:this.regexp,safeValue:x=>this.escapeValue?n1(this.escape(x)):n1(x)}].forEach(x=>{for(u=0;s=x.regex.exec(e);){const E=s[1].trim();if(l=h(E),l===void 0)if(typeof d=="function"){const N=d(e,s,a);l=nn(N)?N:""}else if(a&&Object.prototype.hasOwnProperty.call(a,E))l="";else if(g){l=s[0];continue}else this.logger.warn(`missed to pass in variable ${E} for interpolating ${e}`),l="";else!nn(l)&&!this.useRawValueToEscape&&(l=Sw(l));const A=x.safeValue(l);if(e=e.replace(s[0],A),g?(x.regex.lastIndex+=l.length,x.regex.lastIndex-=s[0].length):x.regex.lastIndex=0,u++,u>=this.maxReplaces)break}}),e}nest(e,n,r={}){let a,s,l;const u=(c,h)=>{const d=this.nestingOptionsSeparator;if(c.indexOf(d)<0)return c;const g=c.split(new RegExp(`${d}[ ]*{`));let y=`{${g[1]}`;c=g[0],y=this.interpolate(y,l);const m=y.match(/'/g),x=y.match(/"/g);(((m==null?void 0:m.length)??0)%2===0&&!x||x.length%2!==0)&&(y=y.replace(/'/g,'"'));try{l=JSON.parse(y),h&&(l={...h,...l})}catch(E){return this.logger.warn(`failed parsing options string in nesting for key ${c}`,E),`${c}${d}${y}`}return l.defaultValue&&l.defaultValue.indexOf(this.prefix)>-1&&delete l.defaultValue,c};for(;a=this.nestingRegexp.exec(e);){let c=[];l={...r},l=l.replace&&!nn(l.replace)?l.replace:l,l.applyPostProcessor=!1,delete l.defaultValue;const h=/{.*}/.test(a[1])?a[1].lastIndexOf("}")+1:a[1].indexOf(this.formatSeparator);if(h!==-1&&(c=a[1].slice(h).split(this.formatSeparator).map(d=>d.trim()).filter(Boolean),a[1]=a[1].slice(0,h)),s=n(u.call(this,a[1].trim(),l),l),s&&a[0]===e&&!nn(s))return s;nn(s)||(s=Sw(s)),s||(this.logger.warn(`missed to resolve ${a[1]} for nesting ${e}`),s=""),c.length&&(s=c.reduce((d,g)=>this.format(d,g,r.lng,{...r,interpolationkey:a[1].trim()}),s.trim())),e=e.replace(a[0],s),this.regexp.lastIndex=0}return e}}const Vj=t=>{let e=t.toLowerCase().trim();const n={};if(t.indexOf("(")>-1){const r=t.split("(");e=r[0].toLowerCase().trim();const a=r[1].substring(0,r[1].length-1);e==="currency"&&a.indexOf(":")<0?n.currency||(n.currency=a.trim()):e==="relativetime"&&a.indexOf(":")<0?n.range||(n.range=a.trim()):a.split(";").forEach(l=>{if(l){const[u,...c]=l.split(":"),h=c.join(":").trim().replace(/^'+|'+$/g,""),d=u.trim();n[d]||(n[d]=h),h==="false"&&(n[d]=!1),h==="true"&&(n[d]=!0),isNaN(h)||(n[d]=parseInt(h,10))}})}return{formatName:e,formatOptions:n}},Dw=t=>{const e={};return(n,r,a)=>{let s=a;a&&a.interpolationkey&&a.formatParams&&a.formatParams[a.interpolationkey]&&a[a.interpolationkey]&&(s={...s,[a.interpolationkey]:void 0});const l=r+JSON.stringify(s);let u=e[l];return u||(u=t(td(r),a),e[l]=u),u(n)}},Yj=t=>(e,n,r)=>t(td(n),r)(e);class Gj{constructor(e={}){this.logger=Oo.create("formatter"),this.options=e,this.init(e)}init(e,n={interpolation:{}}){this.formatSeparator=n.interpolation.formatSeparator||",";const r=n.cacheInBuiltFormats?Dw:Yj;this.formats={number:r((a,s)=>{const l=new Intl.NumberFormat(a,{...s});return u=>l.format(u)}),currency:r((a,s)=>{const l=new Intl.NumberFormat(a,{...s,style:"currency"});return u=>l.format(u)}),datetime:r((a,s)=>{const l=new Intl.DateTimeFormat(a,{...s});return u=>l.format(u)}),relativetime:r((a,s)=>{const l=new Intl.RelativeTimeFormat(a,{...s});return u=>l.format(u,s.range||"day")}),list:r((a,s)=>{const l=new Intl.ListFormat(a,{...s});return u=>l.format(u)})}}add(e,n){this.formats[e.toLowerCase().trim()]=n}addCached(e,n){this.formats[e.toLowerCase().trim()]=Dw(n)}format(e,n,r,a={}){const s=n.split(this.formatSeparator);if(s.length>1&&s[0].indexOf("(")>1&&s[0].indexOf(")")<0&&s.find(u=>u.indexOf(")")>-1)){const u=s.findIndex(c=>c.indexOf(")")>-1);s[0]=[s[0],...s.splice(1,u)].join(this.formatSeparator)}return s.reduce((u,c)=>{var g;const{formatName:h,formatOptions:d}=Vj(c);if(this.formats[h]){let y=u;try{const m=((g=a==null?void 0:a.formatParams)==null?void 0:g[a.interpolationkey])||{},x=m.locale||m.lng||a.locale||a.lng||r;y=this.formats[h](u,x,{...d,...a,...m})}catch(m){this.logger.warn(m)}return y}else this.logger.warn(`there was no format function for ${h}`);return u},e)}}const Wj=(t,e)=>{t.pending[e]!==void 0&&(delete t.pending[e],t.pendingCount--)};class Kj extends ig{constructor(e,n,r,a={}){var s,l;super(),this.backend=e,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=a,this.logger=Oo.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=a.maxParallelReads||10,this.readingCalls=0,this.maxRetries=a.maxRetries>=0?a.maxRetries:5,this.retryTimeout=a.retryTimeout>=1?a.retryTimeout:350,this.state={},this.queue=[],(l=(s=this.backend)==null?void 0:s.init)==null||l.call(s,r,a.backend,a)}queueLoad(e,n,r,a){const s={},l={},u={},c={};return e.forEach(h=>{let d=!0;n.forEach(g=>{const y=`${h}|${g}`;!r.reload&&this.store.hasResourceBundle(h,g)?this.state[y]=2:this.state[y]<0||(this.state[y]===1?l[y]===void 0&&(l[y]=!0):(this.state[y]=1,d=!1,l[y]===void 0&&(l[y]=!0),s[y]===void 0&&(s[y]=!0),c[g]===void 0&&(c[g]=!0)))}),d||(u[h]=!0)}),(Object.keys(s).length||Object.keys(l).length)&&this.queue.push({pending:l,pendingCount:Object.keys(l).length,loaded:{},errors:[],callback:a}),{toLoad:Object.keys(s),pending:Object.keys(l),toLoadLanguages:Object.keys(u),toLoadNamespaces:Object.keys(c)}}loaded(e,n,r){const a=e.split("|"),s=a[0],l=a[1];n&&this.emit("failedLoading",s,l,n),!n&&r&&this.store.addResourceBundle(s,l,r,void 0,void 0,{skipCopy:!0}),this.state[e]=n?-1:2,n&&r&&(this.state[e]=0);const u={};this.queue.forEach(c=>{kj(c.loaded,[s],l),Wj(c,e),n&&c.errors.push(n),c.pendingCount===0&&!c.done&&(Object.keys(c.loaded).forEach(h=>{u[h]||(u[h]={});const d=c.loaded[h];d.length&&d.forEach(g=>{u[h][g]===void 0&&(u[h][g]=!0)})}),c.done=!0,c.errors.length?c.callback(c.errors):c.callback())}),this.emit("loaded",u),this.queue=this.queue.filter(c=>!c.done)}read(e,n,r,a=0,s=this.retryTimeout,l){if(!e.length)return l(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:n,fcName:r,tried:a,wait:s,callback:l});return}this.readingCalls++;const u=(h,d)=>{if(this.readingCalls--,this.waitingReads.length>0){const g=this.waitingReads.shift();this.read(g.lng,g.ns,g.fcName,g.tried,g.wait,g.callback)}if(h&&d&&a<this.maxRetries){setTimeout(()=>{this.read.call(this,e,n,r,a+1,s*2,l)},s);return}l(h,d)},c=this.backend[r].bind(this.backend);if(c.length===2){try{const h=c(e,n);h&&typeof h.then=="function"?h.then(d=>u(null,d)).catch(u):u(null,h)}catch(h){u(h)}return}return c(e,n,u)}prepareLoading(e,n,r={},a){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),a&&a();nn(e)&&(e=this.languageUtils.toResolveHierarchy(e)),nn(n)&&(n=[n]);const s=this.queueLoad(e,n,r,a);if(!s.toLoad.length)return s.pending.length||a(),null;s.toLoad.forEach(l=>{this.loadOne(l)})}load(e,n,r){this.prepareLoading(e,n,{},r)}reload(e,n,r){this.prepareLoading(e,n,{reload:!0},r)}loadOne(e,n=""){const r=e.split("|"),a=r[0],s=r[1];this.read(a,s,"read",void 0,void 0,(l,u)=>{l&&this.logger.warn(`${n}loading namespace ${s} for language ${a} failed`,l),!l&&u&&this.logger.log(`${n}loaded namespace ${s} for language ${a}`,u),this.loaded(e,l,u)})}saveMissing(e,n,r,a,s,l={},u=()=>{}){var c,h,d,g,y;if((h=(c=this.services)==null?void 0:c.utils)!=null&&h.hasLoadedNamespace&&!((g=(d=this.services)==null?void 0:d.utils)!=null&&g.hasLoadedNamespace(n))){this.logger.warn(`did not save key "${r}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if((y=this.backend)!=null&&y.create){const m={...l,isUpdate:s},x=this.backend.create.bind(this.backend);if(x.length<6)try{let E;x.length===5?E=x(e,n,r,a,m):E=x(e,n,r,a),E&&typeof E.then=="function"?E.then(A=>u(null,A)).catch(u):u(null,E)}catch(E){u(E)}else x(e,n,r,a,u,m)}!e||!e[0]||this.store.addResource(e[0],n,r,a)}}}const r1=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:t=>{let e={};if(typeof t[1]=="object"&&(e=t[1]),nn(t[1])&&(e.defaultValue=t[1]),nn(t[2])&&(e.tDescription=t[2]),typeof t[2]=="object"||typeof t[3]=="object"){const n=t[3]||t[2];Object.keys(n).forEach(r=>{e[r]=n[r]})}return e},interpolation:{escapeValue:!0,format:t=>t,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),kw=t=>{var e,n;return nn(t.ns)&&(t.ns=[t.ns]),nn(t.fallbackLng)&&(t.fallbackLng=[t.fallbackLng]),nn(t.fallbackNS)&&(t.fallbackNS=[t.fallbackNS]),((n=(e=t.supportedLngs)==null?void 0:e.indexOf)==null?void 0:n.call(e,"cimode"))<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),typeof t.initImmediate=="boolean"&&(t.initAsync=t.initImmediate),t},Sp=()=>{},Jj=t=>{Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(n=>{typeof t[n]=="function"&&(t[n]=t[n].bind(t))})};class $h extends ig{constructor(e={},n){if(super(),this.options=kw(e),this.services={},this.logger=Oo,this.modules={external:[]},Jj(this),n&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,n),this;setTimeout(()=>{this.init(e,n)},0)}}init(e={},n){this.isInitializing=!0,typeof e=="function"&&(n=e,e={}),e.defaultNS==null&&e.ns&&(nn(e.ns)?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));const r=r1();this.options={...r,...this.options,...kw(e)},this.options.interpolation={...r.interpolation,...this.options.interpolation},e.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=e.keySeparator),e.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=e.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=r.overloadTranslationOptionHandler);const a=h=>h?typeof h=="function"?new h:h:null;if(!this.options.isClone){this.modules.logger?Oo.init(a(this.modules.logger),this.options):Oo.init(null,this.options);let h;this.modules.formatter?h=this.modules.formatter:h=Gj;const d=new Tw(this.options);this.store=new Nw(this.options.resources,this.options);const g=this.services;g.logger=Oo,g.resourceStore=this.store,g.languageUtils=d,g.pluralResolver=new Hj(d,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==r.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),h&&(!this.options.interpolation.format||this.options.interpolation.format===r.interpolation.format)&&(g.formatter=a(h),g.formatter.init&&g.formatter.init(g,this.options),this.options.interpolation.format=g.formatter.format.bind(g.formatter)),g.interpolator=new Rw(this.options),g.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},g.backendConnector=new Kj(a(this.modules.backend),g.resourceStore,g,this.options),g.backendConnector.on("*",(m,...x)=>{this.emit(m,...x)}),this.modules.languageDetector&&(g.languageDetector=a(this.modules.languageDetector),g.languageDetector.init&&g.languageDetector.init(g,this.options.detection,this.options)),this.modules.i18nFormat&&(g.i18nFormat=a(this.modules.i18nFormat),g.i18nFormat.init&&g.i18nFormat.init(this)),this.translator=new xm(this.services,this.options),this.translator.on("*",(m,...x)=>{this.emit(m,...x)}),this.modules.external.forEach(m=>{m.init&&m.init(this)})}if(this.format=this.options.interpolation.format,n||(n=Sp),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const h=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);h.length>0&&h[0]!=="dev"&&(this.options.lng=h[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(h=>{this[h]=(...d)=>this.store[h](...d)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(h=>{this[h]=(...d)=>(this.store[h](...d),this)});const u=Th(),c=()=>{const h=(d,g)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),u.resolve(g),n(d,g)};if(this.languages&&!this.isInitialized)return h(null,this.t.bind(this));this.changeLanguage(this.options.lng,h)};return this.options.resources||!this.options.initAsync?c():setTimeout(c,0),u}loadResources(e,n=Sp){var s,l;let r=n;const a=nn(e)?e:this.language;if(typeof e=="function"&&(r=e),!this.options.resources||this.options.partialBundledLanguages){if((a==null?void 0:a.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const u=[],c=h=>{if(!h||h==="cimode")return;this.services.languageUtils.toResolveHierarchy(h).forEach(g=>{g!=="cimode"&&u.indexOf(g)<0&&u.push(g)})};a?c(a):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(d=>c(d)),(l=(s=this.options.preload)==null?void 0:s.forEach)==null||l.call(s,h=>c(h)),this.services.backendConnector.load(u,this.options.ns,h=>{!h&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(h)})}else r(null)}reloadResources(e,n,r){const a=Th();return typeof e=="function"&&(r=e,e=void 0),typeof n=="function"&&(r=n,n=void 0),e||(e=this.languages),n||(n=this.options.ns),r||(r=Sp),this.services.backendConnector.reload(e,n,s=>{a.resolve(),r(s)}),a}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&G4.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!(["cimode","dev"].indexOf(e)>-1)){for(let n=0;n<this.languages.length;n++){const r=this.languages[n];if(!(["cimode","dev"].indexOf(r)>-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}!this.resolvedLanguage&&this.languages.indexOf(e)<0&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,n){this.isLanguageChangingTo=e;const r=Th();this.emit("languageChanging",e);const a=u=>{this.language=u,this.languages=this.services.languageUtils.toResolveHierarchy(u),this.resolvedLanguage=void 0,this.setResolvedLanguage(u)},s=(u,c)=>{c?this.isLanguageChangingTo===e&&(a(c),this.translator.changeLanguage(c),this.isLanguageChangingTo=void 0,this.emit("languageChanged",c),this.logger.log("languageChanged",c)):this.isLanguageChangingTo=void 0,r.resolve((...h)=>this.t(...h)),n&&n(u,(...h)=>this.t(...h))},l=u=>{var d,g;!e&&!u&&this.services.languageDetector&&(u=[]);const c=nn(u)?u:u&&u[0],h=this.store.hasLanguageSomeTranslations(c)?c:this.services.languageUtils.getBestMatchFromCodes(nn(u)?[u]:u);h&&(this.language||a(h),this.translator.language||this.translator.changeLanguage(h),(g=(d=this.services.languageDetector)==null?void 0:d.cacheUserLanguage)==null||g.call(d,h)),this.loadResources(h,y=>{s(y,h)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?l(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(l):this.services.languageDetector.detect(l):l(e),r}getFixedT(e,n,r){const a=(s,l,...u)=>{let c;typeof l!="object"?c=this.options.overloadTranslationOptionHandler([s,l].concat(u)):c={...l},c.lng=c.lng||a.lng,c.lngs=c.lngs||a.lngs,c.ns=c.ns||a.ns,c.keyPrefix!==""&&(c.keyPrefix=c.keyPrefix||r||a.keyPrefix);const h=this.options.keySeparator||".";let d;return c.keyPrefix&&Array.isArray(s)?d=s.map(g=>(typeof g=="function"&&(g=Nv(g,{...this.options,...l})),`${c.keyPrefix}${h}${g}`)):(typeof s=="function"&&(s=Nv(s,{...this.options,...l})),d=c.keyPrefix?`${c.keyPrefix}${h}${s}`:s),this.t(d,c)};return nn(e)?a.lng=e:a.lngs=e,a.ns=n,a.keyPrefix=r,a}t(...e){var n;return(n=this.translator)==null?void 0:n.translate(...e)}exists(...e){var n;return(n=this.translator)==null?void 0:n.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,n={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=n.lng||this.resolvedLanguage||this.languages[0],a=this.options?this.options.fallbackLng:!1,s=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const l=(u,c)=>{const h=this.services.backendConnector.state[`${u}|${c}`];return h===-1||h===0||h===2};if(n.precheck){const u=n.precheck(this,l);if(u!==void 0)return u}return!!(this.hasResourceBundle(r,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||l(r,e)&&(!a||l(s,e)))}loadNamespaces(e,n){const r=Th();return this.options.ns?(nn(e)&&(e=[e]),e.forEach(a=>{this.options.ns.indexOf(a)<0&&this.options.ns.push(a)}),this.loadResources(a=>{r.resolve(),n&&n(a)}),r):(n&&n(),Promise.resolve())}loadLanguages(e,n){const r=Th();nn(e)&&(e=[e]);const a=this.options.preload||[],s=e.filter(l=>a.indexOf(l)<0&&this.services.languageUtils.isSupportedCode(l));return s.length?(this.options.preload=a.concat(s),this.loadResources(l=>{r.resolve(),n&&n(l)}),r):(n&&n(),Promise.resolve())}dir(e){var a,s;if(e||(e=this.resolvedLanguage||(((a=this.languages)==null?void 0:a.length)>0?this.languages[0]:this.language)),!e)return"rtl";try{const l=new Intl.Locale(e);if(l&&l.getTextInfo){const u=l.getTextInfo();if(u&&u.direction)return u.direction}}catch{}const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=((s=this.services)==null?void 0:s.languageUtils)||new Tw(r1());return e.toLowerCase().indexOf("-latn")>1?"ltr":n.indexOf(r.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},n){const r=new $h(e,n);return r.createInstance=$h.createInstance,r}cloneInstance(e={},n=Sp){const r=e.forkResourceStore;r&&delete e.forkResourceStore;const a={...this.options,...e,isClone:!0},s=new $h(a);if((e.debug!==void 0||e.prefix!==void 0)&&(s.logger=s.logger.clone(e)),["store","services","language"].forEach(u=>{s[u]=this[u]}),s.services={...this.services},s.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},r){const u=Object.keys(this.store.data).reduce((c,h)=>(c[h]={...this.store.data[h]},c[h]=Object.keys(c[h]).reduce((d,g)=>(d[g]={...c[h][g]},d),c[h]),c),{});s.store=new Nw(u,a),s.services.resourceStore=s.store}if(e.interpolation){const c={...r1().interpolation,...this.options.interpolation,...e.interpolation},h={...a,interpolation:c};s.services.interpolator=new Rw(h)}return s.translator=new xm(s.services,a),s.translator.on("*",(u,...c)=>{s.emit(u,...c)}),s.init(a,n),s.translator.options=a,s.translator.backendConnector.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},s}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const _a=$h.createInstance();_a.createInstance;_a.dir;_a.init;_a.loadResources;_a.reloadResources;_a.use;_a.changeLanguage;_a.getFixedT;_a.t;_a.exists;_a.setDefaultNamespace;_a.hasLoadedNamespace;_a.loadNamespaces;_a.loadLanguages;const Xj="Prayer",Zj="Salah",Qj="Adhan",eR="Jamaat",tR="Iqamah",nR="Tomorrow",rR="Tmrw",aR="Sunrise",iR="Fajr",sR="Dhuhr",oR="Asr",lR="Maghrib",uR="Isha",cR="Jumuah",fR="Eid",hR="In",dR="Select",pR="Language",mR="English",gR="Norwegian",vR="Arabic",yR="Method",bR="North",wR="South",xR="Settings",SR="Daily",_R="Weekly",ER="Monthly",AR="Custom",NR="From",CR="To",TR="Cancel",LR="Contact",OR="Sun",jR="Mon",RR="Tue",DR="Wed",kR="Thu",MR="Fri",PR="Sat",IR="Today",FR="Date",UR="January",BR="February",$R="March",zR="April",qR="May",HR="June",VR="July",YR="August",GR="September",WR="October",KR="November",JR="December",XR={PRAYER:Xj,SALAH:Zj,ADHAN:Qj,JAMAAT:eR,IQAMAH:tR,TOMORROW:nR,TMRW:rR,SUNRISE:aR,FAJR:iR,DHUHR:sR,ASR:oR,MAGHRIB:lR,ISHA:uR,"FAJR END TIME":"Fajr End Time","FAJR END":"Fajr End",JUMUAH:cR,EID:fR,IN:hR,"SELECT MASJID":"Select Masjid",SELECT:dR,LANGUAGE:pR,ENGLISH:mR,NORWEGIAN:gR,ARABIC:vR,"ASR METHOD":"Asr Method","PRAYER METHOD":"Prayer Method","IRN DEFAULT":"IRN default",METHOD:yR,"1X METHOD":"1x method","2X METHOD":"2x method","50% METHOD":"50% method",NORTH:bR,SOUTH:wR,"EVENTS & CALENDAR":"Events & Calendar","SEE ALL":"See All","LOOK OUT FOR IMPORTANT DATES AND EVENTS":"Look Out for Important Dates and Events","CREATE YOUR PRAYER TIMETABLE":"Create Your Prayer Timetable","VIEW AND DOWNLOAD YOUR CUSTOM PRAYER TIMETABLE":"View and Download Your Custom Prayer Timetable","VIEW FULL CALENDAR":"View Full Calendar","HIJRI CALENDAR":"Hijri Calendar",SETTINGS:xR,DAILY:SR,WEEKLY:_R,MONTHLY:ER,CUSTOM:AR,FROM:NR,TO:CR,"PRAYER TIMETABLE":"Prayer Timetable","DOWNLOAD TIMETABLE":"Download Timetable","DOWNLOAD (CSV/PDF)":"Download (Csv/Pdf)","SAVE AS CSV":"Save as Csv","SAVE AS PDF":"Save as Pdf",CANCEL:TR,CONTACT:LR,SUN:OR,MON:jR,TUE:RR,WED:DR,THU:kR,FRI:MR,SAT:PR,TODAY:IR,DATE:FR,JANUARY:UR,FEBRUARY:BR,MARCH:$R,APRIL:zR,MAY:qR,JUNE:HR,JULY:VR,AUGUST:YR,SEPTEMBER:GR,OCTOBER:WR,NOVEMBER:KR,DECEMBER:JR},ZR="Bønn",QR="Salah",e7="Adhan",t7="Jamaat",n7="Iqamah",r7="I Morgen",a7="I Mrgn",i7="Soloppgang",s7="Fajr",o7="Dhuhr",l7="Asr",u7="Maghrib",c7="Isha",f7="Jummah",h7="Eid",d7="i",p7="Velg",m7="Språk",g7="Engelsk",v7="Norsk",y7="Arabisk",b7="metode",w7="Nord",x7="Sør",S7="Innstillinger",_7="Daglig",E7="Ukentlig",A7="Månedlig",N7="Tilpasset",C7="Fra",T7="Til",L7="Avbryt",O7="Kontakt",j7="Søn",R7="Man",D7="Tir",k7="Ons",M7="Tor",P7="Fre",I7="Lør",F7="I Dag",U7="Dato",B7="Januar",$7="Februar",z7="Mars",q7="April",H7="Mai",V7="Juni",Y7="Juli",G7="August",W7="September",K7="Oktober",J7="November",X7="Desember",Z7={PRAYER:ZR,SALAH:QR,ADHAN:e7,JAMAAT:t7,IQAMAH:n7,TOMORROW:r7,TMRW:a7,SUNRISE:i7,FAJR:s7,DHUHR:o7,ASR:l7,MAGHRIB:u7,ISHA:c7,"FAJR END TIME":"Fajr Sluttidspunkt","FAJR END":"Fajr Slutt",JUMMAH:f7,EID:h7,IN:d7,"SELECT MASJID":"Velg Masjid",SELECT:p7,LANGUAGE:m7,ENGLISH:g7,NORWEGIAN:v7,ARABIC:y7,"ASR METHOD":"Asr-metode","PRAYER METHOD":"Bønnemetode","IRN DEFAULT":"IRN standard",METHOD:b7,"1X METHOD":"1x metode","2X METHOD":"2x metode","50% METHOD":"50% metode",NORTH:w7,SOUTH:x7,"EVENTS & CALENDAR":"Arrangementer & Kalender","SEE ALL":"Se Alle","LOOK OUT FOR IMPORTANT DATES AND EVENTS":"Følg Med På Viktige Datoer Og Hendelser","CREATE YOUR PRAYER TIMETABLE":"Lag Din Bønnetidtabell","VIEW AND DOWNLOAD YOUR CUSTOM PRAYER TIMETABLE":"Vis Og Last Ned Din Egendefinerte Bønnetidtabell","VIEW FULL CALENDAR":"Se Full Kalender","HIJRI CALENDAR":"Hijri-kalender",SETTINGS:S7,DAILY:_7,WEEKLY:E7,MONTHLY:A7,CUSTOM:N7,FROM:C7,TO:T7,"PRAYER TIMETABLE":"Bønnetidtabell","DOWNLOAD TIMETABLE":"Last Ned Tidtabell","DOWNLOAD (CSV/PDF)":"Last Ned (Csv/Pdf)","SAVE AS CSV":"Lagre Som Csv","SAVE AS PDF":"Lagre Som Pdf",CANCEL:L7,CONTACT:O7,SUN:j7,MON:R7,TUE:D7,WED:k7,THU:M7,FRI:P7,SAT:I7,TODAY:F7,DATE:U7,JANUARY:B7,FEBRUARY:$7,MARCH:z7,APRIL:q7,MAY:H7,JUNE:V7,JULY:Y7,AUGUST:G7,SEPTEMBER:W7,OCTOBER:K7,NOVEMBER:J7,DECEMBER:X7},Q7="الصلاة",eD="الصلاة",tD="الأذان",nD="الجماعة",rD="الإقامة",aD="غدًا",iD="غدًا",sD="شروق الشمس",oD="الفجر",lD="الظهر",uD="العصر",cD="المغرب",fD="العشاء",hD="جمعة",dD="العيد",pD="في",mD="اختر",gD="اللغة",vD="الإنجليزية",yD="النرويجية",bD="العربية",wD="الطريقة",xD="الشمالية",SD="الجنوبية",_D="الإعدادات",ED="يومي",AD="أسبوعي",ND="شهري",CD="مخصص",TD="من",LD="إلى",OD="إلغاء",jD="اتصال",RD="أحد",DD="إثنين",kD="ثلاثاء",MD="أربعاء",PD="خميس",ID="جمعة",FD="سبت",UD="اليوم",BD="التاريخ",$D="January",zD="February",qD="March",HD="April",VD="May",YD="June",GD="July",WD="August",KD="September",JD="October",XD="November",ZD="December",QD={PRAYER:Q7,SALAH:eD,ADHAN:tD,JAMAAT:nD,IQAMAH:rD,TOMORROW:aD,TMRW:iD,SUNRISE:sD,FAJR:oD,DHUHR:lD,ASR:uD,MAGHRIB:cD,ISHA:fD,"FAJR END TIME":"نهاية وقت الفجر","FAJR END":"نهاية الفجر",JUMUAH:hD,EID:dD,IN:pD,"SELECT MASJID":"اختر المسجد",SELECT:mD,LANGUAGE:gD,ENGLISH:vD,NORWEGIAN:yD,ARABIC:bD,"ASR METHOD":"طريقة العصر","PRAYER METHOD":"طريقة الصلاة","IRN DEFAULT":"الإعداد الافتراضي ل IRN",METHOD:wD,"1X METHOD":"طريقة 1 x","2X METHOD":"طريقة 2 x","50% METHOD":"طريقة 50 %",NORTH:xD,SOUTH:SD,"EVENTS & CALENDAR":"الأحداث والتقويم","SEE ALL":"عرض الكل","LOOK OUT FOR IMPORTANT DATES AND EVENTS":"ترقب التواريخ الهامة والأحداث","CREATE YOUR PRAYER TIMETABLE":"أنشئ جدول صلواتك","VIEW AND DOWNLOAD YOUR CUSTOM PRAYER TIMETABLE":"عرض وتحميل جدول صلاتك المخصص","VIEW FULL CALENDAR":"عرض التقويم الكامل","HIJRI CALENDAR":"التقويم الهجري",SETTINGS:_D,DAILY:ED,WEEKLY:AD,MONTHLY:ND,CUSTOM:CD,FROM:TD,TO:LD,"PRAYER TIMETABLE":"جدول الصلاة","DOWNLOAD TIMETABLE":"تحميل الجدول","DOWNLOAD (CSV/PDF)":"تحميل (CSV/PDF)","SAVE AS CSV":"حفظ كـ CSV","SAVE AS PDF":"حفظ كـ PDF",CANCEL:OD,CONTACT:jD,SUN:RD,MON:DD,TUE:kD,WED:MD,THU:PD,FRI:ID,SAT:FD,TODAY:UD,DATE:BD,JANUARY:$D,FEBRUARY:zD,MARCH:qD,APRIL:HD,MAY:VD,JUNE:YD,JULY:GD,AUGUST:WD,SEPTEMBER:KD,OCTOBER:JD,NOVEMBER:XD,DECEMBER:ZD};_a.use(f8).init({resources:{en:{translation:XR},no:{translation:Z7},ar:{translation:QD}},lng:"en",fallbackLng:"en",interpolation:{escapeValue:!1}});function ek(){const{org_nr:t}=xr(),e=Pi(),n=new Date().toISOString().split("T")[0],{config:r}=Ej(t),{isDefault:a,textColor:s,prayerTimesColor:l,extraInfoColor:u,...c}=r||{},{prayerTimes:h,extraInfo:d,loading:g}=B4(t,n),{setDarkMode:y}=Ea();k.useEffect(()=>{if(!h||h.length===0)return;const N=()=>{const T=q4(h);T==="dark"?y(!0):T==="light"&&y(!1)};N();const O=setInterval(N,60*1e3);return()=>clearInterval(O)},[h,y]);const{language:m}=Sl(t);k.useEffect(()=>{m&&_a.changeLanguage(m)},[m]);const x=k.useRef(null),[E,A]=k.useState(!1);return k.useEffect(()=>{const N=()=>{A(!!document.fullscreenElement)};return document.addEventListener("fullscreenchange",N),()=>document.removeEventListener("fullscreenchange",N)},[]),g?_.jsx("div",{className:"h-screen",children:_.jsx(Mf,{})}):h?_.jsxs("div",{ref:x,className:"relative",children:[!E&&_.jsxs(_.Fragment,{children:[_.jsx("button",{onClick:()=>e(`/${t||"982842840"}`),className:"absolute top-4 right-26 z-50 px-3 py-1 text-sm text-white font-semibold rounded-lg shadow-md hover:opacity-90 hover:cursor-pointer transition",style:{backgroundColor:s||"#4F46E5"},children:_.jsx(H4,{size:24,className:"cursor-pointer"})}),_.jsx("button",{onClick:()=>e(`/${t||"982842840"}/lobby`),className:"absolute top-4 right-13 z-50 px-3 py-1 text-sm text-white font-semibold rounded-lg shadow-md hover:opacity-90 hover:cursor-pointer transition",style:{backgroundColor:s||"#4F46E5"},children:_.jsx(v2,{size:24,className:"cursor-pointer"})})]}),_.jsx(z4,{targetRef:x}),_.jsx(bj,{config:c,componentProps:{date:n,prayerTimes:h,extraInfo:d,textColor:s,prayerTimesColor:l,extraInfoColor:u,isDefault:a}})]}):_.jsx("div",{children:"Prayer times not found."})}const K4=({nr:t,prayerTimes:e,date:n,color:r,reverse:a=!1})=>{const{i18n:s,t:l}=kr(),u=s.language||"en",{org_nr:c}=xr(),h=tg(),{darkMode:d}=Ea(),[g,y]=k.useState(()=>new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})),[m,x]=k.useState(()=>new Date(n).toLocaleDateString(u==="no"?"nb-NO":"en-IN",{year:"numeric",month:"long",day:"numeric"}));k.useEffect(()=>{const O=setInterval(()=>{y(new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}))},1e3);return()=>clearInterval(O)},[]),k.useEffect(()=>{const O=new Date(n);x(O.toLocaleDateString(u==="no"?"nb-NO":"en-IN",{year:"numeric",month:"long",day:"numeric"}))},[n,u]);const[E,A]=k.useState(null);k.useEffect(()=>{(async()=>{if(n){if(!navigator.onLine){const T=await gl(n);if(T){A(T);return}}try{const{data:T,error:D}=await ft.from("hijri_dates").select("hijri_date_day, hijri_date_month, hijri_date_year").eq("gregorian_date",n).single();if(D)throw new Error(D.message);if(!T)throw new Error("No corresponding hijri day found!");A(T),await Qm(n,T)}catch(T){const D=await gl(n);D&&A(D),console.log(T)}}})()},[n]);const N=rg(e);return _.jsxs("div",{className:`w-full h-full flex flex-col sm:flex-row ${a?"sm:flex-row-reverse ml-4":"-ml-2 2xl:-ml-4"}`,children:[_.jsxs("div",{className:`w-full sm:w-[55%] flex flex-col ${a?"pl-10":"pl-4"} justify-between py-2 2xl:py-4 font-chakra dark:text-[#F2E7D5]`,style:{color:d?t===1?"#F2E7D5":"#F5C45E":r},children:[_.jsx(vd,{nr:t,orgNr:c,textColor:r,isLobby:!0}),_.jsxs("div",{children:[_.jsx("h2",{className:"font-bold text-3xl sm:text-4xl md:text-7xl mb-2 sm:mb-3",children:g}),_.jsx("h4",{className:"font-bold text-base lg:text-2xl",children:E&&h.length>0?Mo({hijriDayObj:E,language:u,t:l,hijriMonthNames:h}):"-"}),_.jsx("h4",{className:"font-bold text-base lg:text-2xl",children:m})]})]}),_.jsx("div",{className:"w-full h-full sm:w-[45%] flex items-center justify-center",children:_.jsx("div",{className:"w-full max-w-[100%] scale-110",children:_.jsx(ag,{prayerTimes:N,theme:1})})})]})},Mw=t=>{const[e,n]=t.split(":").map(Number);return e*60+n},tk=({prayerTimes:t,extraInfo:e,prayerTimesColor:n,extraInfoColor:r,isDefault:a})=>{const{darkMode:s}=Ea(),{org_nr:l}=xr(),{language:u}=Sl(l||void 0),{t:c}=kr(),h=new Date,d=h.getHours()*60+h.getMinutes(),g=t.findIndex(m=>Mw(m.adhan)>d),y=u==="ar";return _.jsx("div",{className:"font-chakra w-full mt-auto",style:{color:s?"#F2E7D5":n.text},children:_.jsxs("div",{className:" dark:text-[#F2E7D5] backdrop-blur-md rounded-2xl 2xl:rounded-3xl shadow-sm min-w-0 dark:bg-gradient-to-r dark:from-[#1C1B1BBF] dark:to-[#13121299]",style:{backgroundColor:s?"":a?K_(n.bg,.75):n.bg},dir:y?"rtl":"ltr",children:[_.jsxs("div",{className:"table w-full border-b-2 border-[#00000026] dark:border-[#F2E7D530] p-2 2xl:px-4 py-3",children:[_.jsx("div",{className:"table-header-group w-full text-sm sm:text-base 2xl:text-xl font-bold",style:{color:s?"#F2E7D5":a?"#53452E":n.text},children:_.jsxs("div",{className:"table-row",children:[_.jsx("div",{className:`table-cell py-1 pl-2 ${y?"text-right":"text-left"} border-b-2 border-[#00000026] dark:border-[#F2E7D530]`,children:c("SALAH")}),!y&&_.jsx("div",{className:"table-cell text-right border-b-2 border-[#00000026] dark:border-[#F2E7D530]"}),_.jsx("div",{className:"table-cell text-center border-b-2 border-[#00000026] dark:border-[#F2E7D530]",children:c("ADHAN")}),_.jsx("div",{className:"table-cell text-center border-b-2 border-[#00000026] dark:border-[#F2E7D530]",children:c("IQAMAH")}),_.jsx("div",{className:"table-cell text-center border-b-2 border-[#00000026] dark:border-[#F2E7D530]",children:c("TMRW")})]})}),_.jsx("div",{className:"table-row-group w-full text-base sm:text-lg 2xl:text-2xl",children:t.map((m,x)=>{const E=Mw(m.adhan),A=x===g,O=E<d&&!A?"dark:text-[#F2E7D5] opacity-40":"",T={backgroundColor:s?"#54462E":a?"#CFB78F":r.bg,color:a?"":r.text,borderBlockColor:s?"#F2E7DF":a?"#53452E":r.text};return _.jsxs("div",{className:"table-row",children:[_.jsx("div",{className:`table-cell py-1 pl-2 ${y?"text-right":"text-left"} font-bold ${A?y?"border-r-2 border-y-2 rounded-r-xl":"border-l-2 border-y-2 rounded-l-xl":""}`,style:A?T:{},children:m.name==="Fajr end"?_.jsx(dd,{color:"orange",size:28}):c(m.name.toUpperCase())}),!y&&_.jsx("div",{className:`table-cell py-1 text-right ${A&&"border-y-2"}`,style:A?T:{},children:m.arabic}),_.jsx("div",{className:`table-cell py-1 text-center font-bold ${O} ${A&&"border-y-2"}`,style:A?T:{},children:m.adhan}),_.jsx("div",{className:`table-cell py-1 text-center font-semibold ${O} ${A?y?"border-l-2 border-y-2 rounded-l-xl":"border-r-2 border-y-2 rounded-r-xl":""}`,style:A?T:{},children:m.iqamah}),_.jsx("div",{className:"table-cell py-1 text-center font-semibold",children:m.tomorrow})]},x)})})]}),_.jsx("div",{className:"px-6 py-4 text-sm sm:text-base 2xl:text-xl font-bold rounded-b-3xl",style:{color:s?"#F2E7D5":r.text,backgroundColor:s?"#54462E":a?"#CFB78F":r.bg},children:_.jsx("div",{className:y?"w-[60%]":"",children:e.filter(m=>m.label==="Eid"?Array.isArray(m.time)&&m.time.some(x=>x&&x.trim()!==""):!0).map((m,x)=>_.jsxs("div",{className:"flex justify-between py-2",children:[_.jsx("div",{className:"w-2/5",children:c(m==null?void 0:m.label.toUpperCase())}),Array.isArray(m.time)?(y?[2,1,0]:[0,1,2]).map(E=>_.jsx("div",{className:"w-1/4 md:w-1/5 text-center ",children:m.time[E]},E)):_.jsxs(_.Fragment,{children:[_.jsx("div",{className:"w-1/5 text-center ",children:m.time}),_.jsx("div",{className:"w-1/5"}),_.jsx("div",{className:"w-1/5"})]})]},x))})})]})})},nk=({prayerTimes:t,extraInfo:e,date:n,textColor:r,prayerTimesColor:a,extraInfoColor:s,isDefault:l})=>_.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[_.jsx("div",{className:"overflow-hidden flex flex-col bg-red- flex-2 p-1 2xl:p-2 justify-center h-full",children:_.jsx(K4,{nr:1,color:r,prayerTimes:t,date:n})}),_.jsx("div",{className:"overflow-hidden min-h-0 flex flex-col flex-3 justify-center h-full",children:_.jsx(tk,{prayerTimes:t,extraInfo:e,prayerTimesColor:a,extraInfoColor:s,isDefault:l})})]}),rk=({date:t,prayerTimes:e,extraInfo:n,textColor:r,prayerTimesColor:a,extraInfoColor:s,isDefault:l})=>{const{org_nr:u}=xr();return _.jsxs("div",{className:"w-full h-full flex flex-col dark:bg-[#0C221F]",children:[_.jsxs("div",{className:"px-2 sm:px-4",children:[_.jsx(vd,{nr:3,textColor:r,orgNr:u,isLobby:!0,date:t}),_.jsx(D4,{isLobby:!0,color:r})]}),_.jsx("div",{className:"flex-1 flex justify-center 2xl:pb-4 overflow-hidden",children:_.jsx(M4,{prayerTimes:e,extraInfo:n,prayerTimesColor:a,extraInfoColor:s,isLobby:!0,isDefault:l})})]})},Pw=t=>{const[e,n]=t.split(":").map(Number);return e*60+n},ak=({prayerTimes:t,extraInfo:e,prayerTimesColor:n,extraInfoColor:r,isDefault:a,isPreview:s})=>{const l=new Date,u=l.getHours()*60+l.getMinutes(),c=t.findIndex(h=>Pw(h.adhan)>u)-1;return _.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[t.filter(h=>h.name!=="Fajr end").map((h,d)=>{const g=Pw(h.adhan),y=d===c,m=g<u;return _.jsx("div",{children:_.jsx(j4,{name:h.name,arabic:h.arabic,adhan:h.adhan,iqamah:h.iqamah,tomorrow:h.tomorrow,isNext:y,isPast:m,isSmall:!0,color:n.text,bg:n.bg,isDefault:a,isPreview:s})},h.name)}),_.jsx("div",{className:"col-span-1 row-span-2 flex",children:_.jsx(R4,{extraInfo:e,extraInfoColor:r,isLobby:!0,isDefault:a,isPreview:s})})]})},ik=({date:t,prayerTimes:e,extraInfo:n,textColor:r,prayerTimesColor:a,extraInfoColor:s,isDefault:l,isPreview:u})=>_.jsxs("div",{className:"flex flex-col justify-center h-full min-h-0",children:[_.jsx("div",{className:"flex mb-10 mt-8",children:_.jsx(K4,{nr:2,prayerTimes:e,date:t,color:r,reverse:!0})}),_.jsx("div",{className:"flex h-full w-full",children:_.jsx(ak,{prayerTimes:e,extraInfo:n,prayerTimesColor:a,extraInfoColor:s,isDefault:l,isPreview:u})})]}),J4="mosque-media-db",Sm="media";async function sk(t,e){await(await Gr(J4,1,{upgrade(r){r.createObjectStore(Sm)}})).put(Sm,e,t)}async function Iw(t){return await(await Gr(J4,1,{upgrade(n){n.createObjectStore(Sm)}})).get(Sm,t)}function ok(t){const[e,n]=k.useState([]),[r,a]=k.useState(3e3),[s,l]=k.useState(!0),u="https://yhbphdjhoxovcxfoimdx.supabase.co/storage/v1/object/public/mosques/982842840/multimedia/982842840_4.png";return k.useEffect(()=>{let c=null;if(!t){n([]),l(!1);return}const h=async()=>{if(l(!0),!navigator.onLine){const d=await Iw(t);if(d){n(d),l(!1);return}}try{const{data:d,error:g}=await ft.from("multimedia").select("path, type, enabled").eq("mosque_id",t).order("order");if(g)throw g;let y=(d||[]).filter(E=>E.enabled===!0).map(E=>({type:E.type,path:E.path}));if(d.length===0){const E={created_at:new Date().toISOString(),mosque_id:t,path:u,type:"image",enabled:!0,order:1},{data:A}=await ft.from("multimedia").select("id").eq("mosque_id",t).eq("path",E.path);if(!A||A.length===0){const{error:N}=await ft.from("multimedia").upsert(E,{onConflict:"mosque_id, path"});if(N&&!N.message.includes("duplicate key"))throw N;y=[{type:E.type,path:E.path}]}}n(y),await sk(t,y);const{data:m,error:x}=await ft.from("mosque_t").select("multimedia_duration").eq("organisasjonsnummer",t).single();if(x)throw x;a(m.multimedia_duration*1e3||5e3)}catch(d){const g=await Iw(t);g&&n(g),console.log("Error fetching media: ",d)}finally{l(!1)}};return h(),c=ft.channel("multimedia-changes").on("postgres_changes",{event:"*",schema:"public",table:"multimedia"},d=>{var g,y;(((g=d.new)==null?void 0:g.mosque_id)===t||((y=d.old)==null?void 0:y.mosque_id)===t)&&h()}),c.subscribe(),()=>{c==null||c.unsubscribe()}},[t]),{mediaItems:e,duration:r,loading:s}}var a1={exports:{}},i1,Fw;function lk(){if(Fw)return i1;Fw=1;var t="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return i1=t,i1}var s1,Uw;function uk(){if(Uw)return s1;Uw=1;var t=lk();function e(){}function n(){}return n.resetWarningCache=e,s1=function(){function r(l,u,c,h,d,g){if(g!==t){var y=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw y.name="Invariant Violation",y}}r.isRequired=r;function a(){return r}var s={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:a,element:r,elementType:r,instanceOf:a,node:r,objectOf:a,oneOf:a,oneOfType:a,shape:a,exact:a,checkPropTypes:n,resetWarningCache:e};return s.PropTypes=s,s},s1}var Bw;function ck(){return Bw||(Bw=1,a1.exports=uk()()),a1.exports}var fk=ck();const Ya=Bm(fk);var o1,$w;function hk(){return $w||($w=1,o1=function t(e,n){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;var r,a,s;if(Array.isArray(e)){if(r=e.length,r!=n.length)return!1;for(a=r;a--!==0;)if(!t(e[a],n[a]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if(s=Object.keys(e),r=s.length,r!==Object.keys(n).length)return!1;for(a=r;a--!==0;)if(!Object.prototype.hasOwnProperty.call(n,s[a]))return!1;for(a=r;a--!==0;){var l=s[a];if(!t(e[l],n[l]))return!1}return!0}return e!==e&&n!==n}),o1}var dk=hk();const pk=Bm(dk);var _p={exports:{}},l1,zw;function mk(){if(zw)return l1;zw=1;var t;/**
140
- * @link https://github.com/gajus/sister for the canonical source repository
141
- * @license https://github.com/gajus/sister/blob/master/LICENSE BSD 3-Clause
142
- */return t=function(){var e={},n={};return e.on=function(r,a){var s={name:r,handler:a};return n[r]=n[r]||[],n[r].unshift(s),s},e.off=function(r){var a=n[r.name].indexOf(r);a!==-1&&n[r.name].splice(a,1)},e.trigger=function(r,a){var s=n[r],l;if(s)for(l=s.length;l--;)s[l].handler(a)},e},l1=t,l1}var Ep={exports:{}},u1,qw;function gk(){if(qw)return u1;qw=1,u1=function(a,s,l){var u=document.head||document.getElementsByTagName("head")[0],c=document.createElement("script");typeof s=="function"&&(l=s,s={}),s=s||{},l=l||function(){},c.type=s.type||"text/javascript",c.charset=s.charset||"utf8",c.async="async"in s?!!s.async:!0,c.src=a,s.attrs&&t(c,s.attrs),s.text&&(c.text=""+s.text);var h="onload"in c?e:n;h(c,l),c.onload||e(c,l),u.appendChild(c)};function t(r,a){for(var s in a)r.setAttribute(s,a[s])}function e(r,a){r.onload=function(){this.onerror=this.onload=null,a(null,r)},r.onerror=function(){this.onerror=this.onload=null,a(new Error("Failed to load "+this.src),r)}}function n(r,a){r.onreadystatechange=function(){this.readyState!="complete"&&this.readyState!="loaded"||(this.onreadystatechange=null,a(null,r))}}return u1}var Hw;function vk(){return Hw||(Hw=1,(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n=gk(),r=a(n);function a(s){return s&&s.__esModule?s:{default:s}}e.default=function(s){var l=new Promise(function(u){if(window.YT&&window.YT.Player&&window.YT.Player instanceof Function){u(window.YT);return}else{var c=window.location.protocol==="http:"?"http:":"https:";(0,r.default)(c+"//www.youtube.com/iframe_api",function(d){d&&s.trigger("error",d)})}var h=window.onYouTubeIframeAPIReady;window.onYouTubeIframeAPIReady=function(){h&&h(),u(window.YT)}});return l},t.exports=e.default})(Ep,Ep.exports)),Ep.exports}var Ap={exports:{}},Np={exports:{}},Cp={exports:{}},c1,Vw;function yk(){if(Vw)return c1;Vw=1;var t=1e3,e=t*60,n=e*60,r=n*24,a=r*365.25;c1=function(h,d){d=d||{};var g=typeof h;if(g==="string"&&h.length>0)return s(h);if(g==="number"&&isNaN(h)===!1)return d.long?u(h):l(h);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(h))};function s(h){if(h=String(h),!(h.length>100)){var d=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(h);if(d){var g=parseFloat(d[1]),y=(d[2]||"ms").toLowerCase();switch(y){case"years":case"year":case"yrs":case"yr":case"y":return g*a;case"days":case"day":case"d":return g*r;case"hours":case"hour":case"hrs":case"hr":case"h":return g*n;case"minutes":case"minute":case"mins":case"min":case"m":return g*e;case"seconds":case"second":case"secs":case"sec":case"s":return g*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return g;default:return}}}}function l(h){return h>=r?Math.round(h/r)+"d":h>=n?Math.round(h/n)+"h":h>=e?Math.round(h/e)+"m":h>=t?Math.round(h/t)+"s":h+"ms"}function u(h){return c(h,r,"day")||c(h,n,"hour")||c(h,e,"minute")||c(h,t,"second")||h+" ms"}function c(h,d,g){if(!(h<d))return h<d*1.5?Math.floor(h/d)+" "+g:Math.ceil(h/d)+" "+g+"s"}return c1}var Yw;function bk(){return Yw||(Yw=1,(function(t,e){e=t.exports=a.debug=a.default=a,e.coerce=c,e.disable=l,e.enable=s,e.enabled=u,e.humanize=yk(),e.names=[],e.skips=[],e.formatters={};var n;function r(h){var d=0,g;for(g in h)d=(d<<5)-d+h.charCodeAt(g),d|=0;return e.colors[Math.abs(d)%e.colors.length]}function a(h){function d(){if(d.enabled){var g=d,y=+new Date,m=y-(n||y);g.diff=m,g.prev=n,g.curr=y,n=y;for(var x=new Array(arguments.length),E=0;E<x.length;E++)x[E]=arguments[E];x[0]=e.coerce(x[0]),typeof x[0]!="string"&&x.unshift("%O");var A=0;x[0]=x[0].replace(/%([a-zA-Z%])/g,function(O,T){if(O==="%%")return O;A++;var D=e.formatters[T];if(typeof D=="function"){var F=x[A];O=D.call(g,F),x.splice(A,1),A--}return O}),e.formatArgs.call(g,x);var N=d.log||e.log||console.log.bind(console);N.apply(g,x)}}return d.namespace=h,d.enabled=e.enabled(h),d.useColors=e.useColors(),d.color=r(h),typeof e.init=="function"&&e.init(d),d}function s(h){e.save(h),e.names=[],e.skips=[];for(var d=(typeof h=="string"?h:"").split(/[\s,]+/),g=d.length,y=0;y<g;y++)d[y]&&(h=d[y].replace(/\*/g,".*?"),h[0]==="-"?e.skips.push(new RegExp("^"+h.substr(1)+"$")):e.names.push(new RegExp("^"+h+"$")))}function l(){e.enable("")}function u(h){var d,g;for(d=0,g=e.skips.length;d<g;d++)if(e.skips[d].test(h))return!1;for(d=0,g=e.names.length;d<g;d++)if(e.names[d].test(h))return!0;return!1}function c(h){return h instanceof Error?h.stack||h.message:h}})(Cp,Cp.exports)),Cp.exports}var Gw;function wk(){return Gw||(Gw=1,(function(t,e){var n={};e=t.exports=bk(),e.log=s,e.formatArgs=a,e.save=l,e.load=u,e.useColors=r,e.storage=typeof chrome<"u"&&typeof chrome.storage<"u"?chrome.storage.local:c(),e.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"];function r(){return typeof window<"u"&&window.process&&window.process.type==="renderer"?!0:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}e.formatters.j=function(h){try{return JSON.stringify(h)}catch(d){return"[UnexpectedJSONParseError]: "+d.message}};function a(h){var d=this.useColors;if(h[0]=(d?"%c":"")+this.namespace+(d?" %c":" ")+h[0]+(d?"%c ":" ")+"+"+e.humanize(this.diff),!!d){var g="color: "+this.color;h.splice(1,0,g,"color: inherit");var y=0,m=0;h[0].replace(/%[a-zA-Z%]/g,function(x){x!=="%%"&&(y++,x==="%c"&&(m=y))}),h.splice(m,0,g)}}function s(){return typeof console=="object"&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function l(h){try{h==null?e.storage.removeItem("debug"):e.storage.debug=h}catch{}}function u(){var h;try{h=e.storage.debug}catch{}return!h&&typeof process<"u"&&"env"in process&&(h=n.DEBUG),h}e.enable(u());function c(){try{return window.localStorage}catch{}}})(Np,Np.exports)),Np.exports}var Tp={exports:{}},Ww;function xk(){return Ww||(Ww=1,(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=["cueVideoById","loadVideoById","cueVideoByUrl","loadVideoByUrl","playVideo","pauseVideo","stopVideo","getVideoLoadedFraction","cuePlaylist","loadPlaylist","nextVideo","previousVideo","playVideoAt","setShuffle","setLoop","getPlaylist","getPlaylistIndex","setOption","mute","unMute","isMuted","setVolume","getVolume","seekTo","getPlayerState","getPlaybackRate","setPlaybackRate","getAvailablePlaybackRates","getPlaybackQuality","setPlaybackQuality","getAvailableQualityLevels","getCurrentTime","getDuration","removeEventListener","getVideoUrl","getVideoEmbedCode","getOptions","getOption","addEventListener","destroy","setSize","getIframe"],t.exports=e.default})(Tp,Tp.exports)),Tp.exports}var Lp={exports:{}},Kw;function Sk(){return Kw||(Kw=1,(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=["ready","stateChange","playbackQualityChange","playbackRateChange","error","apiChange","volumeChange"],t.exports=e.default})(Lp,Lp.exports)),Lp.exports}var Op={exports:{}},jp={exports:{}},Jw;function _k(){return Jw||(Jw=1,(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={BUFFERING:3,ENDED:0,PAUSED:2,PLAYING:1,UNSTARTED:-1,VIDEO_CUED:5},t.exports=e.default})(jp,jp.exports)),jp.exports}var Xw;function Ek(){return Xw||(Xw=1,(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n=_k(),r=a(n);function a(s){return s&&s.__esModule?s:{default:s}}e.default={pauseVideo:{acceptableStates:[r.default.ENDED,r.default.PAUSED],stateChangeRequired:!1},playVideo:{acceptableStates:[r.default.ENDED,r.default.PLAYING],stateChangeRequired:!1},seekTo:{acceptableStates:[r.default.ENDED,r.default.PLAYING,r.default.PAUSED],stateChangeRequired:!0,timeout:3e3}},t.exports=e.default})(Op,Op.exports)),Op.exports}var Zw;function Ak(){return Zw||(Zw=1,(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n=wk(),r=d(n),a=xk(),s=d(a),l=Sk(),u=d(l),c=Ek(),h=d(c);function d(m){return m&&m.__esModule?m:{default:m}}var g=(0,r.default)("youtube-player"),y={};y.proxyEvents=function(m){var x={},E=function(P){var $="on"+P.slice(0,1).toUpperCase()+P.slice(1);x[$]=function(B){g('event "%s"',$,B),m.trigger(P,B)}},A=!0,N=!1,O=void 0;try{for(var T=u.default[Symbol.iterator](),D;!(A=(D=T.next()).done);A=!0){var F=D.value;E(F)}}catch(Q){N=!0,O=Q}finally{try{!A&&T.return&&T.return()}finally{if(N)throw O}}return x},y.promisifyPlayer=function(m){var x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,E={},A=function($){x&&h.default[$]?E[$]=function(){for(var B=arguments.length,ne=Array(B),I=0;I<B;I++)ne[I]=arguments[I];return m.then(function(z){var J=h.default[$],ae=z.getPlayerState(),me=z[$].apply(z,ne);return J.stateChangeRequired||Array.isArray(J.acceptableStates)&&J.acceptableStates.indexOf(ae)===-1?new Promise(function(Z){var ce=function oe(){var ge=z.getPlayerState(),he=void 0;typeof J.timeout=="number"&&(he=setTimeout(function(){z.removeEventListener("onStateChange",oe),Z()},J.timeout)),Array.isArray(J.acceptableStates)&&J.acceptableStates.indexOf(ge)!==-1&&(z.removeEventListener("onStateChange",oe),clearTimeout(he),Z())};z.addEventListener("onStateChange",ce)}).then(function(){return me}):me})}:E[$]=function(){for(var B=arguments.length,ne=Array(B),I=0;I<B;I++)ne[I]=arguments[I];return m.then(function(z){return z[$].apply(z,ne)})}},N=!0,O=!1,T=void 0;try{for(var D=s.default[Symbol.iterator](),F;!(N=(F=D.next()).done);N=!0){var Q=F.value;A(Q)}}catch(P){O=!0,T=P}finally{try{!N&&D.return&&D.return()}finally{if(O)throw T}}return E},e.default=y,t.exports=e.default})(Ap,Ap.exports)),Ap.exports}var Qw;function Nk(){return Qw||(Qw=1,(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(g){return typeof g}:function(g){return g&&typeof Symbol=="function"&&g.constructor===Symbol&&g!==Symbol.prototype?"symbol":typeof g},r=mk(),a=h(r),s=vk(),l=h(s),u=Ak(),c=h(u);function h(g){return g&&g.__esModule?g:{default:g}}var d=void 0;e.default=function(g){var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},m=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,x=(0,a.default)();if(d||(d=(0,l.default)(x)),y.events)throw new Error("Event handlers cannot be overwritten.");if(typeof g=="string"&&!document.getElementById(g))throw new Error('Element "'+g+'" does not exist.');y.events=c.default.proxyEvents(x);var E=new Promise(function(N){if((typeof g>"u"?"undefined":n(g))==="object"&&g.playVideo instanceof Function){var O=g;N(O)}else d.then(function(T){var D=new T.Player(g,y);return x.on("ready",function(){N(D)}),null})}),A=c.default.promisifyPlayer(E,m);return A.on=x.on,A.off=x.off,A},t.exports=e.default})(_p,_p.exports)),_p.exports}var Ck=Nk();const Tk=Bm(Ck);var Lk=Object.defineProperty,Ok=Object.defineProperties,jk=Object.getOwnPropertyDescriptors,ex=Object.getOwnPropertySymbols,Rk=Object.prototype.hasOwnProperty,Dk=Object.prototype.propertyIsEnumerable,tx=(t,e,n)=>e in t?Lk(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Cv=(t,e)=>{for(var n in e||(e={}))Rk.call(e,n)&&tx(t,n,e[n]);if(ex)for(var n of ex(e))Dk.call(e,n)&&tx(t,n,e[n]);return t},Tv=(t,e)=>Ok(t,jk(e)),kk=(t,e,n)=>new Promise((r,a)=>{var s=c=>{try{u(n.next(c))}catch(h){a(h)}},l=c=>{try{u(n.throw(c))}catch(h){a(h)}},u=c=>c.done?r(c.value):Promise.resolve(c.value).then(s,l);u((n=n.apply(t,e)).next())});function Mk(t,e){var n,r;if(t.videoId!==e.videoId)return!0;const a=((n=t.opts)==null?void 0:n.playerVars)||{},s=((r=e.opts)==null?void 0:r.playerVars)||{};return a.start!==s.start||a.end!==s.end}function nx(t={}){return Tv(Cv({},t),{height:0,width:0,playerVars:Tv(Cv({},t.playerVars),{autoplay:0,start:0,end:0})})}function Pk(t,e){return t.videoId!==e.videoId||!pk(nx(t.opts),nx(e.opts))}function Ik(t,e){var n,r,a,s;return t.id!==e.id||t.className!==e.className||((n=t.opts)==null?void 0:n.width)!==((r=e.opts)==null?void 0:r.width)||((a=t.opts)==null?void 0:a.height)!==((s=e.opts)==null?void 0:s.height)||t.iframeClassName!==e.iframeClassName||t.title!==e.title}var Fk={videoId:"",id:"",className:"",iframeClassName:"",style:{},title:"",loading:void 0,opts:{},onReady:()=>{},onError:()=>{},onPlay:()=>{},onPause:()=>{},onEnd:()=>{},onStateChange:()=>{},onPlaybackRateChange:()=>{},onPlaybackQualityChange:()=>{}},Uk={videoId:Ya.string,id:Ya.string,className:Ya.string,iframeClassName:Ya.string,style:Ya.object,title:Ya.string,loading:Ya.oneOf(["lazy","eager"]),opts:Ya.objectOf(Ya.any),onReady:Ya.func,onError:Ya.func,onPlay:Ya.func,onPause:Ya.func,onEnd:Ya.func,onStateChange:Ya.func,onPlaybackRateChange:Ya.func,onPlaybackQualityChange:Ya.func},Xp=class extends yn.Component{constructor(t){super(t),this.destroyPlayerPromise=void 0,this.onPlayerReady=e=>{var n,r;return(r=(n=this.props).onReady)==null?void 0:r.call(n,e)},this.onPlayerError=e=>{var n,r;return(r=(n=this.props).onError)==null?void 0:r.call(n,e)},this.onPlayerStateChange=e=>{var n,r,a,s,l,u,c,h;switch((r=(n=this.props).onStateChange)==null||r.call(n,e),e.data){case Xp.PlayerState.ENDED:(s=(a=this.props).onEnd)==null||s.call(a,e);break;case Xp.PlayerState.PLAYING:(u=(l=this.props).onPlay)==null||u.call(l,e);break;case Xp.PlayerState.PAUSED:(h=(c=this.props).onPause)==null||h.call(c,e);break}},this.onPlayerPlaybackRateChange=e=>{var n,r;return(r=(n=this.props).onPlaybackRateChange)==null?void 0:r.call(n,e)},this.onPlayerPlaybackQualityChange=e=>{var n,r;return(r=(n=this.props).onPlaybackQualityChange)==null?void 0:r.call(n,e)},this.destroyPlayer=()=>this.internalPlayer?(this.destroyPlayerPromise=this.internalPlayer.destroy().then(()=>this.destroyPlayerPromise=void 0),this.destroyPlayerPromise):Promise.resolve(),this.createPlayer=()=>{if(typeof document>"u")return;if(this.destroyPlayerPromise){this.destroyPlayerPromise.then(this.createPlayer);return}const e=Tv(Cv({},this.props.opts),{videoId:this.props.videoId});this.internalPlayer=Tk(this.container,e),this.internalPlayer.on("ready",this.onPlayerReady),this.internalPlayer.on("error",this.onPlayerError),this.internalPlayer.on("stateChange",this.onPlayerStateChange),this.internalPlayer.on("playbackRateChange",this.onPlayerPlaybackRateChange),this.internalPlayer.on("playbackQualityChange",this.onPlayerPlaybackQualityChange),(this.props.title||this.props.loading)&&this.internalPlayer.getIframe().then(n=>{this.props.title&&n.setAttribute("title",this.props.title),this.props.loading&&n.setAttribute("loading",this.props.loading)})},this.resetPlayer=()=>this.destroyPlayer().then(this.createPlayer),this.updatePlayer=()=>{var e;(e=this.internalPlayer)==null||e.getIframe().then(n=>{this.props.id?n.setAttribute("id",this.props.id):n.removeAttribute("id"),this.props.iframeClassName?n.setAttribute("class",this.props.iframeClassName):n.removeAttribute("class"),this.props.opts&&this.props.opts.width?n.setAttribute("width",this.props.opts.width.toString()):n.removeAttribute("width"),this.props.opts&&this.props.opts.height?n.setAttribute("height",this.props.opts.height.toString()):n.removeAttribute("height"),this.props.title?n.setAttribute("title",this.props.title):n.setAttribute("title","YouTube video player"),this.props.loading?n.setAttribute("loading",this.props.loading):n.removeAttribute("loading")})},this.getInternalPlayer=()=>this.internalPlayer,this.updateVideo=()=>{var e,n,r,a;if(typeof this.props.videoId>"u"||this.props.videoId===null){(e=this.internalPlayer)==null||e.stopVideo();return}let s=!1;const l={videoId:this.props.videoId};if((n=this.props.opts)!=null&&n.playerVars&&(s=this.props.opts.playerVars.autoplay===1,"start"in this.props.opts.playerVars&&(l.startSeconds=this.props.opts.playerVars.start),"end"in this.props.opts.playerVars&&(l.endSeconds=this.props.opts.playerVars.end)),s){(r=this.internalPlayer)==null||r.loadVideoById(l);return}(a=this.internalPlayer)==null||a.cueVideoById(l)},this.refContainer=e=>{this.container=e},this.container=null,this.internalPlayer=null}componentDidMount(){this.createPlayer()}componentDidUpdate(t){return kk(this,null,function*(){Ik(t,this.props)&&this.updatePlayer(),Pk(t,this.props)&&(yield this.resetPlayer()),Mk(t,this.props)&&this.updateVideo()})}componentWillUnmount(){this.destroyPlayer()}render(){return yn.createElement("div",{className:this.props.className,style:this.props.style},yn.createElement("div",{id:this.props.id,className:this.props.iframeClassName,ref:this.refContainer}))}},sg=Xp;sg.propTypes=Uk;sg.defaultProps=Fk;sg.PlayerState={UNSTARTED:-1,ENDED:0,PLAYING:1,PAUSED:2,BUFFERING:3,CUED:5};var Bk=sg;function $k({orgNr:t,color1:e}){var O,T,D,F,Q,P,$,B;const[n,r]=k.useState(0),a=k.useRef(null),s=k.useRef(null),{org_nr:l}=xr(),{mediaItems:u,duration:c,loading:h}=ok(l||t),{darkMode:d}=Ea(),g=((O=u[n])==null?void 0:O.type)==="video",y=((T=u[n])==null?void 0:T.type)==="youtube",m=((D=u[n])==null?void 0:D.type)==="webpage";function x(ne){if(!ne)return null;const I=/(?:youtube\.com\/(?:[^\/\n\s]+\/\S+\/|(?:v|embed|shorts)\/|\S*?[?&]v=)|youtu\.be\/)([a-zA-Z0-9_-]{11})/,z=ne.match(I);return z?z[1]:null}const E=()=>{r(ne=>(ne+1)%u.length)},A={height:"100%",width:"100%",playerVars:{autoplay:1,mute:1,controls:1,playlist:x((F=u[n])==null?void 0:F.path)||"",origin:window.location.origin}};k.useEffect(()=>(s.current&&clearInterval(s.current),!g&&!y&&u.length>0&&(s.current=setInterval(()=>{r(ne=>(ne+1)%u.length)},c)),()=>{s.current&&clearInterval(s.current)}),[n,g,y,u.length,c]),k.useEffect(()=>{if(g&&a.current){const ne=a.current,I=()=>{r(z=>(z+1)%u.length)};return ne.addEventListener("ended",I),()=>{ne.removeEventListener("ended",I)}}},[n,g,u.length]);const N=ne=>r(ne);if(!h)return u.length===0?_.jsx("div",{className:"text-2xl font-semibold",style:{color:d?"#F5C45E":e},children:"No media found"}):_.jsxs("div",{className:"relative w-full h-full flex flex-col",children:[_.jsx("div",{className:"overflow-hidden w-full h-full flex items-center justify-center",children:m?_.jsx("iframe",{src:(Q=u[n])==null?void 0:Q.path,className:"w-full h-full object-contain",style:{border:"none"},sandbox:"allow-scripts allow-same-origin allow-forms allow-popups"}):y?_.jsx(Bk,{videoId:x((P=u[n])==null?void 0:P.path)||"",opts:A,onEnd:E,className:"w-full h-full object-contain"}):g?_.jsx("video",{ref:a,src:($=u[n])==null?void 0:$.path,autoPlay:!0,muted:!0,playsInline:!0,className:"w-full h-full object-contain"}):_.jsx("img",{src:(B=u[n])==null?void 0:B.path,alt:"carousel item",className:"w-full h-full object-contain"})}),_.jsx("div",{className:"absolute bottom-4 left-1/2 -translate-x-1/2 flex gap-2 z-50",children:u.map((ne,I)=>_.jsx("button",{type:"button",onClick:()=>N(I),className:`w-3 h-3 rounded-full ${I===n?"bg-white":"bg-gray-500"} transition duration-300`,"aria-label":`Go to slide ${I+1}`,tabIndex:0},I))})]})}const X4="mosque-announcements",_m="announcements";async function rx(t){return await(await Gr(X4,1,{upgrade(n){n.createObjectStore(_m)}})).get(_m,t)??null}async function zk(t,e){return(await Gr(X4,1,{upgrade(r){r.createObjectStore(_m)}})).put(_m,e,t)}function qk(t){const[e,n]=k.useState(null),[r,a]=k.useState(!0);return k.useEffect(()=>{let s=null;const l=async()=>{if(a(!0),!navigator.onLine){const u=await rx(t);if(u!==null){n(u),a(!1);return}}try{const{data:u,error:c}=await ft.from("mosque_t").select("announcement").eq("organisasjonsnummer",t).single();if(c)throw c;n(u.announcement??""),await zk(t,u.announcement??"")}catch(u){const c=await rx(t);c!==null&&n(c),console.log("error fetching announcement: ",u)}finally{a(!1)}};return l(),s=ft.channel(`announcement-changes-${t}`).on("postgres_changes",{event:"*",schema:"public",table:"mosque_t",filter:`organisasjonsnummer=eq.${t}`},()=>{l()}).subscribe(),()=>{s==null||s.unsubscribe()}},[t]),{announcement:e,loading:r}}const Z4=()=>{const{org_nr:t}=xr(),{announcement:e,loading:n}=qk(t||"982842840"),r=n?"Loading...":e!=null&&e.trim()?e:"No announcements at the moment";return _.jsx("div",{className:"relative w-full overflow-hidden text-black bg-white py-0.5 lg:py-1.5 text-xl lg:text-2xl",children:_.jsx("div",{className:"ticker-text font-semibold",children:r})})},Hk=({nr:t,prayerTimes:e,color:n,bg:r,isDefault:a})=>{const{darkMode:s}=Ea(),[l,u]=k.useState({label:"",hours:0,minutes:0,seconds:0});return k.useEffect(()=>{if(!e.length)return;function c(){u(ng(e))}c();const h=setInterval(c,1e3);return()=>clearInterval(h)},[e]),l.label?_.jsxs("div",{className:"text-center font-bold text-lg sm:text-xl lg:text-2xl h-full flex justify-center items-center",style:{color:s?t===1?"#F2E7D5":t===2?"#F5C35E":"#0C221F":a?t===3?"#124170":"#000000":n,backgroundColor:s?t===1?"#53452D":t===2?"#102E50":"#67C090":a?t===1?"#C7B08A":t===2?"#F5C45E":"#67C090":r},children:[_.jsxs("span",{className:"",children:[l.label.includes("iqamah")?l.label:l.label.split(" ")[0]," in "]}),_.jsx("span",{className:"",children:`${String(l.hours).padStart(2,"0")}:${String(l.minutes).padStart(2,"0")}:${String(l.seconds).padStart(2,"0")}`})]}):null},Vk=({nr:t,prayerTimes:e,prayerTimesColor:n,isDefault:r})=>_.jsxs("div",{className:"flex",children:[_.jsx("div",{className:"w-[30%]",children:_.jsx(Hk,{nr:t,prayerTimes:e,color:n.text,bg:n.bg,isDefault:r})}),_.jsx(Z4,{})]}),Yk={BackgroundDiv:t=>{const{prayerTimes:e,prayerTimesWithSunrise:n,extraInfo:r,date:a,isDefault:s,textColor:l,prayerTimesColor:u,extraInfoColor:c,isPreview:h,announcement:d,...g}=t;return _.jsx("div",{...g})},TablePart:nk,AnnouncementPart:Vk,PrayerPart:ik,TimePart:rk,Carousel:$k};function Lv({components:t,componentProps:e}){const{darkMode:n}=Ea();return _.jsx(_.Fragment,{children:t.map((r,a)=>{var l,u,c,h,d,g,y,m,x,E,A,N;const s=Yk[r.type];if(s){const O={...r.props||{},...e};let T={};return n?(l=r.style)!=null&&l.darkBackgroundImage?T={backgroundImage:`url(${"https://yhbphdjhoxovcxfoimdx.supabase.co/storage/v1/object/public"+r.style.darkBackgroundImage})`,backgroundSize:"cover",backgroundPosition:"center",backgroundRepeat:"no-repeat"}:(u=r.style)!=null&&u.backgroundColor?T={backgroundColor:r.style.backgroundColor}:(c=r.style)!=null&&c.darkBackground&&(T={backgroundColor:r.style.darkBackground}):(h=r.style)!=null&&h.backgroundColor?T={backgroundColor:r.style.backgroundColor,backgroundImage:"none"}:(d=r.style)!=null&&d.backgroundImage?T={backgroundImage:`url(${"https://yhbphdjhoxovcxfoimdx.supabase.co/storage/v1/object/public"+r.style.backgroundImage})`,backgroundSize:"cover",backgroundPosition:"center",backgroundRepeat:"no-repeat",filter:(g=r.style)==null?void 0:g.backgroundBlur}:(y=r.style)!=null&&y.background&&(T={backgroundColor:r.style.background}),_.jsx("div",{className:r.className||"",style:T,children:_.jsx(s,{...O})},a)}else if(r.components&&r.gridConfig){let O={};if((m=r.gridConfig.style)!=null&&m.backgroundImage){const T=n?(x=r.gridConfig.style)==null?void 0:x.darkBackgroundImage:(E=r.gridConfig.style)==null?void 0:E.backgroundImage;O=T?{backgroundImage:`url(${T})`,backgroundSize:"cover",backgroundPosition:"center",backgroundRepeat:"no-repeat",backgroundColor:n?"#1a1a1a":"#ffffff"}:{backgroundColor:((A=r.gridConfig.style)==null?void 0:A.backgroundColor)||(n?"#1a1a1a":"#ffffff")}}else(N=r.gridConfig.style)!=null&&N.backgroundColor&&(O=r.gridConfig.style);return _.jsx("div",{className:r.gridConfig.className+" "+(r.className||""),style:O,children:_.jsx(Lv,{components:r.components,componentProps:e})},a)}else return r.components?_.jsx("div",{className:r.className||"",children:_.jsx(Lv,{components:r.components,componentProps:e})},a):null})})}function Gk({config:t,componentProps:e={}}){var l;const[n,r]=k.useState("loading"),{error:a,showBoundary:s}=I4();return k.useEffect(()=>{const u=setTimeout(()=>{n==="loading"&&(!t||!t.components)&&s(new Error("No Lobby layout configuration Found"))},5e3);return()=>clearTimeout(u)},[t,n]),k.useEffect(()=>{t!=null&&t.components&&t.gridConfig&&r("ready")},[t]),a?null:n==="loading"?_.jsx("div",{className:"min-h-screen flex items-center justify-center p-8 bg-gradient-to-br from-indigo-50 to-purple-50",children:_.jsxs("div",{className:"text-center max-w-md",children:[_.jsx("div",{className:"w-16 h-16 border-4 border-indigo-200 border-t-indigo-600 rounded-full animate-spin mx-auto mb-4"}),_.jsx("h2",{className:"text-xl font-semibold text-gray-900 mb-2",children:"Loading lobby..."}),_.jsx("p",{className:"text-gray-600",children:"Setting up your space"})]})}):_.jsx("div",{className:((l=t.gridConfig)==null?void 0:l.className)||"",children:_.jsx(Lv,{components:t.components,componentProps:e})})}function Wk(t){const[e,n]=k.useState(null),[r,a]=k.useState(!0);return k.useEffect(()=>{let s=null;if(!t){n(null),a(!1);return}const l=async()=>{if(a(!0),!navigator.onLine){const u=await Pf(`${t}-lobby`);if(u){n(u),a(!1);return}}try{const{data:u}=await ft.from("layout").select("lobby_theme_id, lobby_layout").eq("mosque_id",t).single();if(u&&u.lobby_layout)n(u.lobby_layout),await ec(`${t}-lobby`,u.lobby_layout);else{const{data:c,error:h}=await ft.from("mosque_t").select("organisasjonsnummer").eq("organisasjonsnummer",t).single();if(!c||h){Un("error","Please enter a valid org_nr!");return}const{data:d,error:g}=await ft.from("layout").select("lobby_theme_id, lobby_layout").eq("mosque_id",982842840).single();if(g)throw g;const{error:y}=await ft.from("layout").upsert([{mosque_id:t,lobby_theme_id:d.lobby_theme_id,lobby_layout:d==null?void 0:d.lobby_layout}],{onConflict:"mosque_id"}).single();if(y)throw y;n(d==null?void 0:d.lobby_layout),await ec(`${t}-lobby`,d==null?void 0:d.lobby_layout)}}catch(u){const c=await Pf(`${t}-lobby`);c&&n(c),console.log("Error fetching config: ",u)}finally{a(!1)}};return l(),s=ft.channel(`lobby_layout_changes: ${t}`).on("postgres_changes",{event:"*",schema:"public",table:"layout",filter:`mosque_id=eq.${t}`},()=>{l()}),s.subscribe(),()=>{s==null||s.unsubscribe()}},[t]),{config:e,loading:r}}function Kk(){const{org_nr:t}=xr(),e=Pi(),n=new Date().toISOString().split("T")[0],{config:r}=Wk(t),{isDefault:a,textColor:s,prayerTimesColor:l,extraInfoColor:u,...c}=r||{},{prayerTimes:h,extraInfo:d,loading:g}=B4(t,n),{setDarkMode:y}=Ea();k.useEffect(()=>{if(!h||h.length===0)return;const N=()=>{const T=q4(h);T==="dark"?y(!0):T==="light"&&y(!1)};N();const O=setInterval(N,60*1e3);return()=>clearInterval(O)},[h,y]);const{language:m}=Sl(t);k.useEffect(()=>{m&&_a.changeLanguage(m)},[m]);const x=k.useRef(null),[E,A]=k.useState(!1);return k.useEffect(()=>{const N=()=>{A(!!document.fullscreenElement)};return document.addEventListener("fullscreenchange",N),()=>document.removeEventListener("fullscreenchange",N)},[]),g?_.jsx("div",{className:"h-screen",children:_.jsx(Mf,{})}):h?_.jsxs("div",{ref:x,className:"relative",children:[!E&&_.jsxs(_.Fragment,{children:[_.jsx("button",{onClick:()=>e(`/${t||"982842840"}`),className:"absolute top-4 right-26 z-50 px-3 py-1 text-sm text-white font-semibold rounded-lg shadow-md hover:opacity-90 hover:cursor-pointer transition",style:{backgroundColor:s||"#4F46E5"},children:_.jsx(H4,{size:24,className:"cursor-pointer"})}),_.jsx("button",{onClick:()=>e(`/${t}/masjid`),className:"absolute top-4 right-13 z-50 px-3 py-1 text-sm text-white font-semibold rounded-lg shadow-md hover:opacity-90 hover:cursor-pointer transition",style:{backgroundColor:s||"#4F46E5"},children:_.jsx(V4,{size:24,className:"cursor-pointer"})})]}),_.jsx(z4,{targetRef:x}),_.jsx(Gk,{config:c,componentProps:{date:n,prayerTimes:h,extraInfo:d,textColor:s,prayerTimesColor:l,extraInfoColor:u,isDefault:a,isPreview:!1}})]}):_.jsx("div",{children:"Prayer times not found."})}function Jk(t){return Aa({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M261.56 101.28a8 8 0 0 0-11.06 0L66.4 277.15a8 8 0 0 0-2.47 5.79L63.9 448a32 32 0 0 0 32 32H192a16 16 0 0 0 16-16V328a8 8 0 0 1 8-8h80a8 8 0 0 1 8 8v136a16 16 0 0 0 16 16h96.06a32 32 0 0 0 32-32V282.94a8 8 0 0 0-2.47-5.79z"},child:[]},{tag:"path",attr:{d:"m490.91 244.15-74.8-71.56V64a16 16 0 0 0-16-16h-48a16 16 0 0 0-16 16v32l-57.92-55.38C272.77 35.14 264.71 32 256 32c-8.68 0-16.72 3.14-22.14 8.63l-212.7 203.5c-6.22 6-7 15.87-1.34 22.37A16 16 0 0 0 43 267.56L250.5 69.28a8 8 0 0 1 11.06 0l207.52 198.28a16 16 0 0 0 22.59-.44c6.14-6.36 5.63-16.86-.76-22.97z"},child:[]}]})(t)}function Xk(t){return Aa({attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M215.7 499.2C267 435 384 279.4 384 192C384 86 298 0 192 0S0 86 0 192c0 87.4 117 243 168.3 307.2c12.3 15.3 35.1 15.3 47.4 0zM192 128a64 64 0 1 1 0 128 64 64 0 1 1 0-128z"},child:[]}]})(t)}const Q4="prayer-times-db",Af="prayerTimes";async function ax(t,e){await(await Gr(Q4,1,{upgrade(r){r.objectStoreNames.contains(Af)||r.createObjectStore(Af)}})).put(Af,e,t)}async function ix(t){return(await Gr(Q4,1,{upgrade(n){n.objectStoreNames.contains(Af)||n.createObjectStore(Af)}})).get(Af,t)}function Zk(t,e,n,r){return t?`mosque_${t}_${n}`:`location_${e}_${n}_${r}`}function Qk({locationId:t,org_nr:e,date:n,asrMethod:r,prayerMethod:a}){const[s,l]=k.useState([]),[u,c]=k.useState([]),[h,d]=k.useState(!1),[g]=k.useState(navigator.onLine);return k.useEffect(()=>{let m=null,x=null;l([]),c([]),d(!1);const E=n.toISOString().split("T")[0],A=Zk(e,t,E,r),N=async()=>{if(!g){const O=await ix(A);O&&(l(O.prayerTimes),c(O.extraInfo)),d(!0);return}try{if(e){const{prayerTimes:O,extraInfo:T}=await U4(e,E,r,a);l(O||[]),c(T||[]),(O==null?void 0:O.length)>0&&await ax(A,{prayerTimes:O,extraInfo:T||[]})}else{const{prayerTimes:O}=await xj(t,E,r,a);l(O||[]),(O==null?void 0:O.length)>0&&await ax(A,{prayerTimes:O,extraInfo:[]})}}catch(O){console.error("Failed to fetch prayer times:",O);const T=[{name:"Fajr",adhan:"",iqamah:"",tomorrow:""},{name:"Fajr end",adhan:"",iqamah:"",tomorrow:""},{name:"Dhuhr",adhan:"",iqamah:"",tomorrow:""},{name:"Asr",adhan:"",iqamah:"",tomorrow:""},{name:"Maghrib",adhan:"",iqamah:"",tomorrow:""},{name:"Isha",adhan:"",iqamah:"",tomorrow:""}],D=[{label:"Jumuah",arabic:"جمعة",time:["",""]}],F=await ix(A);F?(l(F.prayerTimes),c(F.extraInfo)):(l(T),c(D))}d(!0)};return N(),e&&g&&(m=ft.channel("prayer_times_changes").on("postgres_changes",{event:"*",schema:"public",table:"mosque_jamatperiode",filter:`mosque_id=eq.${e}`},N).subscribe(),x=ft.channel("mosque_t_changes").on("postgres_changes",{event:"*",schema:"public",table:"mosque_t",filter:`organisasjonsnummer=eq.${e}`},N).subscribe()),()=>{m&&ft.removeChannel(m),x&&ft.removeChannel(x)}},[t,e,n,r,a,g]),{prayerTimes:rg(s),prayerTimesWithSunrise:s,extraInfo:u,ready:h,isOnline:g}}const eM=async()=>{try{const{data:t,error:e}=await ft.from("location_t").select("location_name, location_iso");if(e){console.error("Error fetching locations: ",e),await fa(e,{message:"Error fetching locations",function:"fetchAllLocations"}),Un("error","Error fetching locations");return}if(!t||t.length===0){console.error("No data fetched"),Un("error","No data fetched");return}const n=new Intl.Collator("nb-NO");return t.map(({location_name:a,location_iso:s})=>({name:a,id:s})).sort((a,s)=>n.compare(a.name,s.name))}catch(t){console.error("Error fetching locations: ",t),await fa(t,{message:"Error fetching locations",function:"fetchAllLocations"}),Un("error","Error fetching locations");return}},tM=async t=>{try{const{data:e,error:n}=await ft.from("mosque_t").select(`
143
- reg_postnummer,
144
- post_no,
145
- lat,
146
- lon,
147
- location_postnumber (
148
- location_iso,
149
- location_t (
150
- lat_n_s,
151
- long_e_w
152
- )
153
- )
154
- `).eq("organisasjonsnummer",t).single();if(n)throw n;if(!e)return;const r=Array.isArray(e.location_postnumber)?e.location_postnumber[0]:e.location_postnumber,a=Array.isArray(r==null?void 0:r.location_t)?r.location_t[0]:r==null?void 0:r.location_t;return{location_iso:(r==null?void 0:r.location_iso)||null,lat:e.lat||(a==null?void 0:a.lat_n_s)||null,lon:e.lon||(a==null?void 0:a.long_e_w)||null}}catch(e){console.error(`Error fetching location for mosque ${t}: `,e),await fa(e,{message:`Error fetching location for mosque ${t}`,function:"fetchLocationOfMosque"}),Un("error","Error fetching location of selected mosque!");return}},nM=async t=>{try{const{data:e,error:n}=await ft.from("location_t").select("lat_n_s, long_e_w").eq("location_iso",t).single();if(n||!e)throw n||new Error("No locTation data found");return{lat:e.lat_n_s,lon:e.long_e_w}}catch(e){console.error(`Error fetching coordinates of location ${t}: `,e),await fa(e,{message:`Error fetching coordinates for location ${t}`,function:"fetchCoordsOfLocation"}),Un("error","Error fetching coordinates for selected location");return}};function rM(t){const[e,n]=k.useState([]),[r,a]=k.useState(!0);return k.useEffect(()=>{n([]),a(!0),(async()=>{try{const s=await tj(t);n(s)}catch(s){console.error("Error fetching special dates: ",s),await fa(s,{message:"Error fetching special dates",function:"useEvents"}),Un("error","Failed to load special dates"),n([])}finally{a(!1)}})()},[t]),{events:e,loading:r}}const aM="layoutDB",Em="colorSchemeStore",iM=1;async function e3(){return Gr(aM,iM,{upgrade(t){t.objectStoreNames.contains(Em)||t.createObjectStore(Em)}})}async function sM(t,e){await(await e3()).put(Em,e,t)}async function sx(t){return await(await e3()).get(Em,t)}function oM(t="982842840",e){const[n,r]=k.useState({isDefault:!0,bgImage:"",bgOpacity:1,bgRepeat:"",bgColor:"",textColor:"",prayerTimesColor:{bg:"",text:""}}),[a,s]=k.useState(!0);return k.useEffect(()=>{if(!t&&!e)return;const l=t||e||"982842840",u=async()=>{var h,d,g,y,m,x;try{if(!navigator.onLine){const F=await sx(l);if(F){r(F),s(!1);return}}const{data:E,error:A}=await ft.from("layout").select("ud_layout").eq("mosque_id",l).single();if(A)throw A;const N=E.ud_layout,O=(h=N==null?void 0:N.components)==null?void 0:h.find(F=>F.type==="BackgroundDiv"),T=(d=N==null?void 0:N.components)==null?void 0:d.find(F=>F.type==="Main"),D={isDefault:(N==null?void 0:N.isDefault)??!0,bgImage:((g=O==null?void 0:O.style)==null?void 0:g.backgroundImage)??"",bgOpacity:((y=O==null?void 0:O.style)==null?void 0:y.backgroundOpacity)??1,bgRepeat:((m=O==null?void 0:O.style)==null?void 0:m.backgroundRepeat)??"",bgColor:((x=T==null?void 0:T.style)==null?void 0:x.backgroundColor)??"",textColor:(N==null?void 0:N.textColor)??"",prayerTimesColor:(N==null?void 0:N.prayerTimesColor)??{}};r(D),await sM(l,D)}catch(E){console.error("Error fetching color scheme:",E);const A=await sx(l);r(A||{isDefault:!0,bgImage:"",bgOpacity:1,bgRepeat:"",bgColor:"",textColor:"",prayerTimesColor:{bg:"",text:""}})}finally{s(!1)}};u();const c=ft.channel("color_scheme_changes").on("postgres_changes",{event:"*",schema:"public",table:"layout",filter:`mosque_id=eq.${l}`},()=>{console.log("Realtime update detected for color scheme"),u()}).subscribe();return()=>{ft.removeChannel(c)}},[t,e]),{colorScheme:n,loading:a}}const t3=k.createContext(null),Ii=()=>{const t=k.useContext(t3);if(!t)throw new Error("useUDContext must be used within a <UDProvider>");return t},n3=({children:t,org_nr:e,loc_id:n})=>{const[r,a]=k.useState("NO0301"),[s,l]=k.useState({value:"",label:""}),u=new Date,[c,h]=k.useState(u),[d,g]=k.useState(null),[y,m]=k.useState(null),[x,E]=k.useState(null),[A,N]=k.useState(0),[O,T]=k.useState(1),[D,F]=k.useState("Monthly"),[Q,P]=k.useState(new Date(u.getFullYear(),u.getMonth(),1)),[$,B]=k.useState(new Date(u.getFullYear(),u.getMonth()+1,0)),[ne,I]=k.useState(null),[z,J]=k.useState(null),[ae,me]=k.useState([]),{language:Z}=Sl(e||(s==null?void 0:s.value)),ce="ud_language";k.useEffect(()=>{const be=localStorage.getItem(ce);be&&E(be)},[]),k.useEffect(()=>{!x&&Z&&E(Z)},[Z,x]),k.useEffect(()=>{x&&(_a.changeLanguage(x),localStorage.setItem(ce,x))},[x]);const{masjidLogo:oe}=gd(e||(s==null?void 0:s.value)||"982842840"),ge=_a.language||"en",{events:he,loading:U}=rM(ge),{colorScheme:j}=oM(e,s==null?void 0:s.value);k.useEffect(()=>{(async()=>{const xe=await L4();me(xe)})()},[]),k.useEffect(()=>{if(n)a(n),(async()=>{const xe=await nM(n);xe&&(I(xe.lat),J(xe.lon))})();else if(e){const be=async()=>{const Oe=await tM(e);Oe&&(a(Oe.location_iso),I(Oe.lat),J(Oe.lon))},xe=async()=>{const Oe=await ej(e);Oe&&l(Oe)};be(),xe()}},[n,e]),k.useEffect(()=>{(async()=>{const xe=await C4(e||(s==null?void 0:s.value)||"982842840");xe&&xe.asr_method!==void 0&&N(xe.asr_method),xe&&xe.prayer_method!==void 0&&T(xe.prayer_method)})()},[e,s==null?void 0:s.value]);const{prayerTimes:Y,prayerTimesWithSunrise:K,extraInfo:ie,ready:V}=Qk(n?{org_nr:e||(s==null?void 0:s.value)||null,locationId:n,date:c,asrMethod:A,prayerMethod:O}:{org_nr:e||(s==null?void 0:s.value)||"982842840",locationId:r||"NO0301",date:c,asrMethod:A,prayerMethod:O}),se=yn.useMemo(()=>({locationId:r,setLocationId:a,selectedMosque:s,setSelectedMosque:l,date:c,setDate:h,hijriDay:d,setHijriDay:g,nextHijriDay:y,setNextHijriDay:m,asrMethod:A,setAsrMethod:N,prayerMethod:O,setPrayerMethod:T,language:x,setLanguage:E,org_nr:(s==null?void 0:s.value)||e||null,prayerTimes:Y,prayerTimesWithSunrise:K,extraInfo:ie,prayerTimesReady:V,periodType:D,setPeriodType:F,periodFrom:Q,periodTo:$,setPeriodFrom:P,setPeriodTo:B,events:he,eventsLoading:U,colorScheme:j,mosqueLogo:oe,lat:ne,lon:z,hijriMonthNames:ae}),[r,s,c,d,y,A,O,x,e,Y,K,ie,D,Q,$,he,U,j,oe,ne,z,ae]);return _.jsx(t3.Provider,{value:se,children:t})};function Rn(t){"@babel/helpers - typeof";return Rn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Rn(t)}function lM(t,e){if(Rn(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(Rn(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function r3(t){var e=lM(t,"string");return Rn(e)=="symbol"?e:e+""}function Ph(t,e,n){return(e=r3(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ox(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),n.push.apply(n,r)}return n}function $t(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?ox(Object(n),!0).forEach(function(r){Ph(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ox(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function uM(t){if(Array.isArray(t))return t}function cM(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,a,s,l,u=[],c=!0,h=!1;try{if(s=(n=n.call(t)).next,e===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=s.call(n)).done)&&(u.push(r.value),u.length!==e);c=!0);}catch(d){h=!0,a=d}finally{try{if(!c&&n.return!=null&&(l=n.return(),Object(l)!==l))return}finally{if(h)throw a}}return u}}function Ov(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function a3(t,e){if(t){if(typeof t=="string")return Ov(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ov(t,e):void 0}}function fM(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
155
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ro(t,e){return uM(t)||cM(t,e)||a3(t,e)||fM()}function hM(t,e){if(t==null)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)!==-1)continue;n[r]=t[r]}return n}function _l(t,e){if(t==null)return{};var n,r,a=hM(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(r=0;r<s.length;r++)n=s[r],e.indexOf(n)===-1&&{}.propertyIsEnumerable.call(t,n)&&(a[n]=t[n])}return a}var dM=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function pM(t){var e=t.defaultInputValue,n=e===void 0?"":e,r=t.defaultMenuIsOpen,a=r===void 0?!1:r,s=t.defaultValue,l=s===void 0?null:s,u=t.inputValue,c=t.menuIsOpen,h=t.onChange,d=t.onInputChange,g=t.onMenuClose,y=t.onMenuOpen,m=t.value,x=_l(t,dM),E=k.useState(u!==void 0?u:n),A=ro(E,2),N=A[0],O=A[1],T=k.useState(c!==void 0?c:a),D=ro(T,2),F=D[0],Q=D[1],P=k.useState(m!==void 0?m:l),$=ro(P,2),B=$[0],ne=$[1],I=k.useCallback(function(oe,ge){typeof h=="function"&&h(oe,ge),ne(oe)},[h]),z=k.useCallback(function(oe,ge){var he;typeof d=="function"&&(he=d(oe,ge)),O(he!==void 0?he:oe)},[d]),J=k.useCallback(function(){typeof y=="function"&&y(),Q(!0)},[y]),ae=k.useCallback(function(){typeof g=="function"&&g(),Q(!1)},[g]),me=u!==void 0?u:N,Z=c!==void 0?c:F,ce=m!==void 0?m:B;return $t($t({},x),{},{inputValue:me,menuIsOpen:Z,onChange:I,onInputChange:z,onMenuClose:ae,onMenuOpen:J,value:ce})}function Wt(){return Wt=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Wt.apply(null,arguments)}function mM(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function lx(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r3(r.key),r)}}function gM(t,e,n){return e&&lx(t.prototype,e),n&&lx(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function jv(t,e){return jv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},jv(t,e)}function vM(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&jv(t,e)}function Am(t){return Am=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Am(t)}function i3(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(i3=function(){return!!t})()}function yM(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function bM(t,e){if(e&&(Rn(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return yM(t)}function wM(t){var e=i3();return function(){var n,r=Am(t);if(e){var a=Am(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return bM(this,n)}}function xM(t){if(Array.isArray(t))return Ov(t)}function SM(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function _M(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
156
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function y2(t){return xM(t)||SM(t)||a3(t)||_M()}function EM(t){if(t.sheet)return t.sheet;for(var e=0;e<document.styleSheets.length;e++)if(document.styleSheets[e].ownerNode===t)return document.styleSheets[e]}function AM(t){var e=document.createElement("style");return e.setAttribute("data-emotion",t.key),t.nonce!==void 0&&e.setAttribute("nonce",t.nonce),e.appendChild(document.createTextNode("")),e.setAttribute("data-s",""),e}var NM=(function(){function t(n){var r=this;this._insertTag=function(a){var s;r.tags.length===0?r.insertionPoint?s=r.insertionPoint.nextSibling:r.prepend?s=r.container.firstChild:s=r.before:s=r.tags[r.tags.length-1].nextSibling,r.container.insertBefore(a,s),r.tags.push(a)},this.isSpeedy=n.speedy===void 0?!0:n.speedy,this.tags=[],this.ctr=0,this.nonce=n.nonce,this.key=n.key,this.container=n.container,this.prepend=n.prepend,this.insertionPoint=n.insertionPoint,this.before=null}var e=t.prototype;return e.hydrate=function(r){r.forEach(this._insertTag)},e.insert=function(r){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(AM(this));var a=this.tags[this.tags.length-1];if(this.isSpeedy){var s=EM(a);try{s.insertRule(r,s.cssRules.length)}catch{}}else a.appendChild(document.createTextNode(r));this.ctr++},e.flush=function(){this.tags.forEach(function(r){var a;return(a=r.parentNode)==null?void 0:a.removeChild(r)}),this.tags=[],this.ctr=0},t})(),ai="-ms-",Nm="-moz-",Hn="-webkit-",s3="comm",b2="rule",w2="decl",CM="@import",o3="@keyframes",TM="@layer",LM=Math.abs,og=String.fromCharCode,OM=Object.assign;function jM(t,e){return Wa(t,0)^45?(((e<<2^Wa(t,0))<<2^Wa(t,1))<<2^Wa(t,2))<<2^Wa(t,3):0}function l3(t){return t.trim()}function RM(t,e){return(t=e.exec(t))?t[0]:t}function Vn(t,e,n){return t.replace(e,n)}function Rv(t,e){return t.indexOf(e)}function Wa(t,e){return t.charCodeAt(e)|0}function nd(t,e,n){return t.slice(e,n)}function To(t){return t.length}function x2(t){return t.length}function Rp(t,e){return e.push(t),t}function DM(t,e){return t.map(e).join("")}var lg=1,If=1,u3=0,Mi=0,ca=0,Uf="";function ug(t,e,n,r,a,s,l){return{value:t,root:e,parent:n,type:r,props:a,children:s,line:lg,column:If,length:l,return:""}}function Lh(t,e){return OM(ug("",null,null,"",null,null,0),t,{length:-t.length},e)}function kM(){return ca}function MM(){return ca=Mi>0?Wa(Uf,--Mi):0,If--,ca===10&&(If=1,lg--),ca}function rs(){return ca=Mi<u3?Wa(Uf,Mi++):0,If++,ca===10&&(If=1,lg++),ca}function Do(){return Wa(Uf,Mi)}function Zp(){return Mi}function yd(t,e){return nd(Uf,t,e)}function rd(t){switch(t){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function c3(t){return lg=If=1,u3=To(Uf=t),Mi=0,[]}function f3(t){return Uf="",t}function Qp(t){return l3(yd(Mi-1,Dv(t===91?t+2:t===40?t+1:t)))}function PM(t){for(;(ca=Do())&&ca<33;)rs();return rd(t)>2||rd(ca)>3?"":" "}function IM(t,e){for(;--e&&rs()&&!(ca<48||ca>102||ca>57&&ca<65||ca>70&&ca<97););return yd(t,Zp()+(e<6&&Do()==32&&rs()==32))}function Dv(t){for(;rs();)switch(ca){case t:return Mi;case 34:case 39:t!==34&&t!==39&&Dv(ca);break;case 40:t===41&&Dv(t);break;case 92:rs();break}return Mi}function FM(t,e){for(;rs()&&t+ca!==57;)if(t+ca===84&&Do()===47)break;return"/*"+yd(e,Mi-1)+"*"+og(t===47?t:rs())}function UM(t){for(;!rd(Do());)rs();return yd(t,Mi)}function BM(t){return f3(em("",null,null,null,[""],t=c3(t),0,[0],t))}function em(t,e,n,r,a,s,l,u,c){for(var h=0,d=0,g=l,y=0,m=0,x=0,E=1,A=1,N=1,O=0,T="",D=a,F=s,Q=r,P=T;A;)switch(x=O,O=rs()){case 40:if(x!=108&&Wa(P,g-1)==58){Rv(P+=Vn(Qp(O),"&","&\f"),"&\f")!=-1&&(N=-1);break}case 34:case 39:case 91:P+=Qp(O);break;case 9:case 10:case 13:case 32:P+=PM(x);break;case 92:P+=IM(Zp()-1,7);continue;case 47:switch(Do()){case 42:case 47:Rp($M(FM(rs(),Zp()),e,n),c);break;default:P+="/"}break;case 123*E:u[h++]=To(P)*N;case 125*E:case 59:case 0:switch(O){case 0:case 125:A=0;case 59+d:N==-1&&(P=Vn(P,/\f/g,"")),m>0&&To(P)-g&&Rp(m>32?cx(P+";",r,n,g-1):cx(Vn(P," ","")+";",r,n,g-2),c);break;case 59:P+=";";default:if(Rp(Q=ux(P,e,n,h,d,a,u,T,D=[],F=[],g),s),O===123)if(d===0)em(P,e,Q,Q,D,s,g,u,F);else switch(y===99&&Wa(P,3)===110?100:y){case 100:case 108:case 109:case 115:em(t,Q,Q,r&&Rp(ux(t,Q,Q,0,0,a,u,T,a,D=[],g),F),a,F,g,u,r?D:F);break;default:em(P,Q,Q,Q,[""],F,0,u,F)}}h=d=m=0,E=N=1,T=P="",g=l;break;case 58:g=1+To(P),m=x;default:if(E<1){if(O==123)--E;else if(O==125&&E++==0&&MM()==125)continue}switch(P+=og(O),O*E){case 38:N=d>0?1:(P+="\f",-1);break;case 44:u[h++]=(To(P)-1)*N,N=1;break;case 64:Do()===45&&(P+=Qp(rs())),y=Do(),d=g=To(T=P+=UM(Zp())),O++;break;case 45:x===45&&To(P)==2&&(E=0)}}return s}function ux(t,e,n,r,a,s,l,u,c,h,d){for(var g=a-1,y=a===0?s:[""],m=x2(y),x=0,E=0,A=0;x<r;++x)for(var N=0,O=nd(t,g+1,g=LM(E=l[x])),T=t;N<m;++N)(T=l3(E>0?y[N]+" "+O:Vn(O,/&\f/g,y[N])))&&(c[A++]=T);return ug(t,e,n,a===0?b2:u,c,h,d)}function $M(t,e,n){return ug(t,e,n,s3,og(kM()),nd(t,2,-2),0)}function cx(t,e,n,r){return ug(t,e,n,w2,nd(t,0,r),nd(t,r+1,-1),r)}function Nf(t,e){for(var n="",r=x2(t),a=0;a<r;a++)n+=e(t[a],a,t,e)||"";return n}function zM(t,e,n,r){switch(t.type){case TM:if(t.children.length)break;case CM:case w2:return t.return=t.return||t.value;case s3:return"";case o3:return t.return=t.value+"{"+Nf(t.children,r)+"}";case b2:t.value=t.props.join(",")}return To(n=Nf(t.children,r))?t.return=t.value+"{"+n+"}":""}function qM(t){var e=x2(t);return function(n,r,a,s){for(var l="",u=0;u<e;u++)l+=t[u](n,r,a,s)||"";return l}}function HM(t){return function(e){e.root||(e=e.return)&&t(e)}}function VM(t){var e=Object.create(null);return function(n){return e[n]===void 0&&(e[n]=t(n)),e[n]}}var YM=function(e,n,r){for(var a=0,s=0;a=s,s=Do(),a===38&&s===12&&(n[r]=1),!rd(s);)rs();return yd(e,Mi)},GM=function(e,n){var r=-1,a=44;do switch(rd(a)){case 0:a===38&&Do()===12&&(n[r]=1),e[r]+=YM(Mi-1,n,r);break;case 2:e[r]+=Qp(a);break;case 4:if(a===44){e[++r]=Do()===58?"&\f":"",n[r]=e[r].length;break}default:e[r]+=og(a)}while(a=rs());return e},WM=function(e,n){return f3(GM(c3(e),n))},fx=new WeakMap,KM=function(e){if(!(e.type!=="rule"||!e.parent||e.length<1)){for(var n=e.value,r=e.parent,a=e.column===r.column&&e.line===r.line;r.type!=="rule";)if(r=r.parent,!r)return;if(!(e.props.length===1&&n.charCodeAt(0)!==58&&!fx.get(r))&&!a){fx.set(e,!0);for(var s=[],l=WM(n,s),u=r.props,c=0,h=0;c<l.length;c++)for(var d=0;d<u.length;d++,h++)e.props[h]=s[c]?l[c].replace(/&\f/g,u[d]):u[d]+" "+l[c]}}},JM=function(e){if(e.type==="decl"){var n=e.value;n.charCodeAt(0)===108&&n.charCodeAt(2)===98&&(e.return="",e.value="")}};function h3(t,e){switch(jM(t,e)){case 5103:return Hn+"print-"+t+t;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return Hn+t+t;case 5349:case 4246:case 4810:case 6968:case 2756:return Hn+t+Nm+t+ai+t+t;case 6828:case 4268:return Hn+t+ai+t+t;case 6165:return Hn+t+ai+"flex-"+t+t;case 5187:return Hn+t+Vn(t,/(\w+).+(:[^]+)/,Hn+"box-$1$2"+ai+"flex-$1$2")+t;case 5443:return Hn+t+ai+"flex-item-"+Vn(t,/flex-|-self/,"")+t;case 4675:return Hn+t+ai+"flex-line-pack"+Vn(t,/align-content|flex-|-self/,"")+t;case 5548:return Hn+t+ai+Vn(t,"shrink","negative")+t;case 5292:return Hn+t+ai+Vn(t,"basis","preferred-size")+t;case 6060:return Hn+"box-"+Vn(t,"-grow","")+Hn+t+ai+Vn(t,"grow","positive")+t;case 4554:return Hn+Vn(t,/([^-])(transform)/g,"$1"+Hn+"$2")+t;case 6187:return Vn(Vn(Vn(t,/(zoom-|grab)/,Hn+"$1"),/(image-set)/,Hn+"$1"),t,"")+t;case 5495:case 3959:return Vn(t,/(image-set\([^]*)/,Hn+"$1$`$1");case 4968:return Vn(Vn(t,/(.+:)(flex-)?(.*)/,Hn+"box-pack:$3"+ai+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Hn+t+t;case 4095:case 3583:case 4068:case 2532:return Vn(t,/(.+)-inline(.+)/,Hn+"$1$2")+t;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(To(t)-1-e>6)switch(Wa(t,e+1)){case 109:if(Wa(t,e+4)!==45)break;case 102:return Vn(t,/(.+:)(.+)-([^]+)/,"$1"+Hn+"$2-$3$1"+Nm+(Wa(t,e+3)==108?"$3":"$2-$3"))+t;case 115:return~Rv(t,"stretch")?h3(Vn(t,"stretch","fill-available"),e)+t:t}break;case 4949:if(Wa(t,e+1)!==115)break;case 6444:switch(Wa(t,To(t)-3-(~Rv(t,"!important")&&10))){case 107:return Vn(t,":",":"+Hn)+t;case 101:return Vn(t,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Hn+(Wa(t,14)===45?"inline-":"")+"box$3$1"+Hn+"$2$3$1"+ai+"$2box$3")+t}break;case 5936:switch(Wa(t,e+11)){case 114:return Hn+t+ai+Vn(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return Hn+t+ai+Vn(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return Hn+t+ai+Vn(t,/[svh]\w+-[tblr]{2}/,"lr")+t}return Hn+t+ai+t+t}return t}var XM=function(e,n,r,a){if(e.length>-1&&!e.return)switch(e.type){case w2:e.return=h3(e.value,e.length);break;case o3:return Nf([Lh(e,{value:Vn(e.value,"@","@"+Hn)})],a);case b2:if(e.length)return DM(e.props,function(s){switch(RM(s,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Nf([Lh(e,{props:[Vn(s,/:(read-\w+)/,":"+Nm+"$1")]})],a);case"::placeholder":return Nf([Lh(e,{props:[Vn(s,/:(plac\w+)/,":"+Hn+"input-$1")]}),Lh(e,{props:[Vn(s,/:(plac\w+)/,":"+Nm+"$1")]}),Lh(e,{props:[Vn(s,/:(plac\w+)/,ai+"input-$1")]})],a)}return""})}},ZM=[XM],QM=function(e){var n=e.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(E){var A=E.getAttribute("data-emotion");A.indexOf(" ")!==-1&&(document.head.appendChild(E),E.setAttribute("data-s",""))})}var a=e.stylisPlugins||ZM,s={},l,u=[];l=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(E){for(var A=E.getAttribute("data-emotion").split(" "),N=1;N<A.length;N++)s[A[N]]=!0;u.push(E)});var c,h=[KM,JM];{var d,g=[zM,HM(function(E){d.insert(E)})],y=qM(h.concat(a,g)),m=function(A){return Nf(BM(A),y)};c=function(A,N,O,T){d=O,m(A?A+"{"+N.styles+"}":N.styles),T&&(x.inserted[N.name]=!0)}}var x={key:n,sheet:new NM({key:n,container:l,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:s,registered:{},insert:c};return x.sheet.hydrate(u),x},f1={exports:{}},Wn={};/** @license React v16.13.1
157
- * react-is.production.min.js
158
- *
159
- * Copyright (c) Facebook, Inc. and its affiliates.
160
- *
161
- * This source code is licensed under the MIT license found in the
162
- * LICENSE file in the root directory of this source tree.
163
- */var hx;function eP(){if(hx)return Wn;hx=1;var t=typeof Symbol=="function"&&Symbol.for,e=t?Symbol.for("react.element"):60103,n=t?Symbol.for("react.portal"):60106,r=t?Symbol.for("react.fragment"):60107,a=t?Symbol.for("react.strict_mode"):60108,s=t?Symbol.for("react.profiler"):60114,l=t?Symbol.for("react.provider"):60109,u=t?Symbol.for("react.context"):60110,c=t?Symbol.for("react.async_mode"):60111,h=t?Symbol.for("react.concurrent_mode"):60111,d=t?Symbol.for("react.forward_ref"):60112,g=t?Symbol.for("react.suspense"):60113,y=t?Symbol.for("react.suspense_list"):60120,m=t?Symbol.for("react.memo"):60115,x=t?Symbol.for("react.lazy"):60116,E=t?Symbol.for("react.block"):60121,A=t?Symbol.for("react.fundamental"):60117,N=t?Symbol.for("react.responder"):60118,O=t?Symbol.for("react.scope"):60119;function T(F){if(typeof F=="object"&&F!==null){var Q=F.$$typeof;switch(Q){case e:switch(F=F.type,F){case c:case h:case r:case s:case a:case g:return F;default:switch(F=F&&F.$$typeof,F){case u:case d:case x:case m:case l:return F;default:return Q}}case n:return Q}}}function D(F){return T(F)===h}return Wn.AsyncMode=c,Wn.ConcurrentMode=h,Wn.ContextConsumer=u,Wn.ContextProvider=l,Wn.Element=e,Wn.ForwardRef=d,Wn.Fragment=r,Wn.Lazy=x,Wn.Memo=m,Wn.Portal=n,Wn.Profiler=s,Wn.StrictMode=a,Wn.Suspense=g,Wn.isAsyncMode=function(F){return D(F)||T(F)===c},Wn.isConcurrentMode=D,Wn.isContextConsumer=function(F){return T(F)===u},Wn.isContextProvider=function(F){return T(F)===l},Wn.isElement=function(F){return typeof F=="object"&&F!==null&&F.$$typeof===e},Wn.isForwardRef=function(F){return T(F)===d},Wn.isFragment=function(F){return T(F)===r},Wn.isLazy=function(F){return T(F)===x},Wn.isMemo=function(F){return T(F)===m},Wn.isPortal=function(F){return T(F)===n},Wn.isProfiler=function(F){return T(F)===s},Wn.isStrictMode=function(F){return T(F)===a},Wn.isSuspense=function(F){return T(F)===g},Wn.isValidElementType=function(F){return typeof F=="string"||typeof F=="function"||F===r||F===h||F===s||F===a||F===g||F===y||typeof F=="object"&&F!==null&&(F.$$typeof===x||F.$$typeof===m||F.$$typeof===l||F.$$typeof===u||F.$$typeof===d||F.$$typeof===A||F.$$typeof===N||F.$$typeof===O||F.$$typeof===E)},Wn.typeOf=T,Wn}var dx;function tP(){return dx||(dx=1,f1.exports=eP()),f1.exports}var h1,px;function nP(){if(px)return h1;px=1;var t=tP(),e={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},n={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},r={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};s[t.ForwardRef]=r,s[t.Memo]=a;function l(x){return t.isMemo(x)?a:s[x.$$typeof]||e}var u=Object.defineProperty,c=Object.getOwnPropertyNames,h=Object.getOwnPropertySymbols,d=Object.getOwnPropertyDescriptor,g=Object.getPrototypeOf,y=Object.prototype;function m(x,E,A){if(typeof E!="string"){if(y){var N=g(E);N&&N!==y&&m(x,N,A)}var O=c(E);h&&(O=O.concat(h(E)));for(var T=l(x),D=l(E),F=0;F<O.length;++F){var Q=O[F];if(!n[Q]&&!(A&&A[Q])&&!(D&&D[Q])&&!(T&&T[Q])){var P=d(E,Q);try{u(x,Q,P)}catch{}}}}return x}return h1=m,h1}nP();var rP=!0;function aP(t,e,n){var r="";return n.split(" ").forEach(function(a){t[a]!==void 0?e.push(t[a]+";"):a&&(r+=a+" ")}),r}var d3=function(e,n,r){var a=e.key+"-"+n.name;(r===!1||rP===!1)&&e.registered[a]===void 0&&(e.registered[a]=n.styles)},iP=function(e,n,r){d3(e,n,r);var a=e.key+"-"+n.name;if(e.inserted[n.name]===void 0){var s=n;do e.insert(n===s?"."+a:"",s,e.sheet,!0),s=s.next;while(s!==void 0)}};function sP(t){for(var e=0,n,r=0,a=t.length;a>=4;++r,a-=4)n=t.charCodeAt(r)&255|(t.charCodeAt(++r)&255)<<8|(t.charCodeAt(++r)&255)<<16|(t.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,e=(n&65535)*1540483477+((n>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(a){case 3:e^=(t.charCodeAt(r+2)&255)<<16;case 2:e^=(t.charCodeAt(r+1)&255)<<8;case 1:e^=t.charCodeAt(r)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}var oP={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},lP=/[A-Z]|^ms/g,uP=/_EMO_([^_]+?)_([^]*?)_EMO_/g,p3=function(e){return e.charCodeAt(1)===45},mx=function(e){return e!=null&&typeof e!="boolean"},d1=VM(function(t){return p3(t)?t:t.replace(lP,"-$&").toLowerCase()}),gx=function(e,n){switch(e){case"animation":case"animationName":if(typeof n=="string")return n.replace(uP,function(r,a,s){return Lo={name:a,styles:s,next:Lo},a})}return oP[e]!==1&&!p3(e)&&typeof n=="number"&&n!==0?n+"px":n};function ad(t,e,n){if(n==null)return"";var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case"boolean":return"";case"object":{var a=n;if(a.anim===1)return Lo={name:a.name,styles:a.styles,next:Lo},a.name;var s=n;if(s.styles!==void 0){var l=s.next;if(l!==void 0)for(;l!==void 0;)Lo={name:l.name,styles:l.styles,next:Lo},l=l.next;var u=s.styles+";";return u}return cP(t,e,n)}case"function":{if(t!==void 0){var c=Lo,h=n(t);return Lo=c,ad(t,e,h)}break}}var d=n;return d}function cP(t,e,n){var r="";if(Array.isArray(n))for(var a=0;a<n.length;a++)r+=ad(t,e,n[a])+";";else for(var s in n){var l=n[s];if(typeof l!="object"){var u=l;mx(u)&&(r+=d1(s)+":"+gx(s,u)+";")}else if(Array.isArray(l)&&typeof l[0]=="string"&&e==null)for(var c=0;c<l.length;c++)mx(l[c])&&(r+=d1(s)+":"+gx(s,l[c])+";");else{var h=ad(t,e,l);switch(s){case"animation":case"animationName":{r+=d1(s)+":"+h+";";break}default:r+=s+"{"+h+"}"}}}return r}var vx=/label:\s*([^\s;{]+)\s*(;|$)/g,Lo;function m3(t,e,n){if(t.length===1&&typeof t[0]=="object"&&t[0]!==null&&t[0].styles!==void 0)return t[0];var r=!0,a="";Lo=void 0;var s=t[0];if(s==null||s.raw===void 0)r=!1,a+=ad(n,e,s);else{var l=s;a+=l[0]}for(var u=1;u<t.length;u++)if(a+=ad(n,e,t[u]),r){var c=s;a+=c[u]}vx.lastIndex=0;for(var h="",d;(d=vx.exec(a))!==null;)h+="-"+d[1];var g=sP(a)+h;return{name:g,styles:a,next:Lo}}var fP=function(e){return e()},hP=Y1.useInsertionEffect?Y1.useInsertionEffect:!1,dP=hP||fP,g3=k.createContext(typeof HTMLElement<"u"?QM({key:"css"}):null);g3.Provider;var pP=function(e){return k.forwardRef(function(n,r){var a=k.useContext(g3);return e(n,a,r)})},mP=k.createContext({}),S2={}.hasOwnProperty,kv="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",gP=function(e,n){var r={};for(var a in n)S2.call(n,a)&&(r[a]=n[a]);return r[kv]=e,r},vP=function(e){var n=e.cache,r=e.serialized,a=e.isStringTag;return d3(n,r,a),dP(function(){return iP(n,r,a)}),null},yP=pP(function(t,e,n){var r=t.css;typeof r=="string"&&e.registered[r]!==void 0&&(r=e.registered[r]);var a=t[kv],s=[r],l="";typeof t.className=="string"?l=aP(e.registered,s,t.className):t.className!=null&&(l=t.className+" ");var u=m3(s,void 0,k.useContext(mP));l+=e.key+"-"+u.name;var c={};for(var h in t)S2.call(t,h)&&h!=="css"&&h!==kv&&(c[h]=t[h]);return c.className=l,n&&(c.ref=n),k.createElement(k.Fragment,null,k.createElement(vP,{cache:e,serialized:u,isStringTag:typeof a=="string"}),k.createElement(a,c))}),bP=yP,Mt=function(e,n){var r=arguments;if(n==null||!S2.call(n,"css"))return k.createElement.apply(void 0,r);var a=r.length,s=new Array(a);s[0]=bP,s[1]=gP(e,n);for(var l=2;l<a;l++)s[l]=r[l];return k.createElement.apply(null,s)};(function(t){var e;e||(e=t.JSX||(t.JSX={}))})(Mt||(Mt={}));function _2(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return m3(e)}function wP(){var t=_2.apply(void 0,arguments),e="animation-"+t.name;return{name:e,styles:"@keyframes "+e+"{"+t.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}function xP(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}const SP=Math.min,_P=Math.max,Cm=Math.round,Dp=Math.floor,Tm=t=>({x:t,y:t});function EP(t){const{x:e,y:n,width:r,height:a}=t;return{width:r,height:a,top:n,left:e,right:e+r,bottom:n+a,x:e,y:n}}function cg(){return typeof window<"u"}function v3(t){return b3(t)?(t.nodeName||"").toLowerCase():"#document"}function yl(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function y3(t){var e;return(e=(b3(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function b3(t){return cg()?t instanceof Node||t instanceof yl(t).Node:!1}function AP(t){return cg()?t instanceof Element||t instanceof yl(t).Element:!1}function E2(t){return cg()?t instanceof HTMLElement||t instanceof yl(t).HTMLElement:!1}function yx(t){return!cg()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof yl(t).ShadowRoot}const NP=new Set(["inline","contents"]);function w3(t){const{overflow:e,overflowX:n,overflowY:r,display:a}=A2(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!NP.has(a)}function CP(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const TP=new Set(["html","body","#document"]);function LP(t){return TP.has(v3(t))}function A2(t){return yl(t).getComputedStyle(t)}function OP(t){if(v3(t)==="html")return t;const e=t.assignedSlot||t.parentNode||yx(t)&&t.host||y3(t);return yx(e)?e.host:e}function x3(t){const e=OP(t);return LP(e)?t.ownerDocument?t.ownerDocument.body:t.body:E2(e)&&w3(e)?e:x3(e)}function Lm(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const a=x3(t),s=a===((r=t.ownerDocument)==null?void 0:r.body),l=yl(a);if(s){const u=Mv(l);return e.concat(l,l.visualViewport||[],w3(a)?a:[],u&&n?Lm(u):[])}return e.concat(a,Lm(a,[],n))}function Mv(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function jP(t){const e=A2(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const a=E2(t),s=a?t.offsetWidth:n,l=a?t.offsetHeight:r,u=Cm(n)!==s||Cm(r)!==l;return u&&(n=s,r=l),{width:n,height:r,$:u}}function N2(t){return AP(t)?t:t.contextElement}function bx(t){const e=N2(t);if(!E2(e))return Tm(1);const n=e.getBoundingClientRect(),{width:r,height:a,$:s}=jP(e);let l=(s?Cm(n.width):n.width)/r,u=(s?Cm(n.height):n.height)/a;return(!l||!Number.isFinite(l))&&(l=1),(!u||!Number.isFinite(u))&&(u=1),{x:l,y:u}}const RP=Tm(0);function DP(t){const e=yl(t);return!CP()||!e.visualViewport?RP:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function kP(t,e,n){return!1}function wx(t,e,n,r){e===void 0&&(e=!1);const a=t.getBoundingClientRect(),s=N2(t);let l=Tm(1);e&&(l=bx(t));const u=kP()?DP(s):Tm(0);let c=(a.left+u.x)/l.x,h=(a.top+u.y)/l.y,d=a.width/l.x,g=a.height/l.y;if(s){const y=yl(s),m=r;let x=y,E=Mv(x);for(;E&&r&&m!==x;){const A=bx(E),N=E.getBoundingClientRect(),O=A2(E),T=N.left+(E.clientLeft+parseFloat(O.paddingLeft))*A.x,D=N.top+(E.clientTop+parseFloat(O.paddingTop))*A.y;c*=A.x,h*=A.y,d*=A.x,g*=A.y,c+=T,h+=D,x=yl(E),E=Mv(x)}}return EP({width:d,height:g,x:c,y:h})}function S3(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function MP(t,e){let n=null,r;const a=y3(t);function s(){var u;clearTimeout(r),(u=n)==null||u.disconnect(),n=null}function l(u,c){u===void 0&&(u=!1),c===void 0&&(c=1),s();const h=t.getBoundingClientRect(),{left:d,top:g,width:y,height:m}=h;if(u||e(),!y||!m)return;const x=Dp(g),E=Dp(a.clientWidth-(d+y)),A=Dp(a.clientHeight-(g+m)),N=Dp(d),T={rootMargin:-x+"px "+-E+"px "+-A+"px "+-N+"px",threshold:_P(0,SP(1,c))||1};let D=!0;function F(Q){const P=Q[0].intersectionRatio;if(P!==c){if(!D)return l();P?l(!1,P):r=setTimeout(()=>{l(!1,1e-7)},1e3)}P===1&&!S3(h,t.getBoundingClientRect())&&l(),D=!1}try{n=new IntersectionObserver(F,{...T,root:a.ownerDocument})}catch{n=new IntersectionObserver(F,T)}n.observe(t)}return l(!0),s}function PP(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:a=!0,ancestorResize:s=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,h=N2(t),d=a||s?[...h?Lm(h):[],...Lm(e)]:[];d.forEach(N=>{a&&N.addEventListener("scroll",n,{passive:!0}),s&&N.addEventListener("resize",n)});const g=h&&u?MP(h,n):null;let y=-1,m=null;l&&(m=new ResizeObserver(N=>{let[O]=N;O&&O.target===h&&m&&(m.unobserve(e),cancelAnimationFrame(y),y=requestAnimationFrame(()=>{var T;(T=m)==null||T.observe(e)})),n()}),h&&!c&&m.observe(h),m.observe(e));let x,E=c?wx(t):null;c&&A();function A(){const N=wx(t);E&&!S3(E,N)&&n(),E=N,x=requestAnimationFrame(A)}return n(),()=>{var N;d.forEach(O=>{a&&O.removeEventListener("scroll",n),s&&O.removeEventListener("resize",n)}),g==null||g(),(N=m)==null||N.disconnect(),m=null,c&&cancelAnimationFrame(x)}}var Pv=k.useLayoutEffect,IP=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],Om=function(){};function FP(t,e){return e?e[0]==="-"?t+e:t+"__"+e:t}function UP(t,e){for(var n=arguments.length,r=new Array(n>2?n-2:0),a=2;a<n;a++)r[a-2]=arguments[a];var s=[].concat(r);if(e&&t)for(var l in e)e.hasOwnProperty(l)&&e[l]&&s.push("".concat(FP(t,l)));return s.filter(function(u){return u}).map(function(u){return String(u).trim()}).join(" ")}var xx=function(e){return WP(e)?e.filter(Boolean):Rn(e)==="object"&&e!==null?[e]:[]},_3=function(e){e.className,e.clearValue,e.cx,e.getStyles,e.getClassNames,e.getValue,e.hasValue,e.isMulti,e.isRtl,e.options,e.selectOption,e.selectProps,e.setValue,e.theme;var n=_l(e,IP);return $t({},n)},Yr=function(e,n,r){var a=e.cx,s=e.getStyles,l=e.getClassNames,u=e.className;return{css:s(n,e),className:a(r??{},l(n,e),u)}};function fg(t){return[document.documentElement,document.body,window].indexOf(t)>-1}function BP(t){return fg(t)?window.innerHeight:t.clientHeight}function E3(t){return fg(t)?window.pageYOffset:t.scrollTop}function jm(t,e){if(fg(t)){window.scrollTo(0,e);return}t.scrollTop=e}function $P(t){var e=getComputedStyle(t),n=e.position==="absolute",r=/(auto|scroll)/;if(e.position==="fixed")return document.documentElement;for(var a=t;a=a.parentElement;)if(e=getComputedStyle(a),!(n&&e.position==="static")&&r.test(e.overflow+e.overflowY+e.overflowX))return a;return document.documentElement}function zP(t,e,n,r){return n*((t=t/r-1)*t*t+1)+e}function kp(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:200,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:Om,a=E3(t),s=e-a,l=10,u=0;function c(){u+=l;var h=zP(u,a,s,n);jm(t,h),u<n?window.requestAnimationFrame(c):r(t)}c()}function Sx(t,e){var n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),a=e.offsetHeight/3;r.bottom+a>n.bottom?jm(t,Math.min(e.offsetTop+e.clientHeight-t.offsetHeight+a,t.scrollHeight)):r.top-a<n.top&&jm(t,Math.max(e.offsetTop-a,0))}function qP(t){var e=t.getBoundingClientRect();return{bottom:e.bottom,height:e.height,left:e.left,right:e.right,top:e.top,width:e.width}}function _x(){try{return document.createEvent("TouchEvent"),!0}catch{return!1}}function HP(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch{return!1}}var A3=!1,VP={get passive(){return A3=!0}},Mp=typeof window<"u"?window:{};Mp.addEventListener&&Mp.removeEventListener&&(Mp.addEventListener("p",Om,VP),Mp.removeEventListener("p",Om,!1));var YP=A3;function GP(t){return t!=null}function WP(t){return Array.isArray(t)}function Pp(t,e,n){return t?e:n}var KP=function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];var s=Object.entries(e).filter(function(l){var u=ro(l,1),c=u[0];return!r.includes(c)});return s.reduce(function(l,u){var c=ro(u,2),h=c[0],d=c[1];return l[h]=d,l},{})},JP=["children","innerProps"],XP=["children","innerProps"];function ZP(t){var e=t.maxHeight,n=t.menuEl,r=t.minHeight,a=t.placement,s=t.shouldScroll,l=t.isFixedPosition,u=t.controlHeight,c=$P(n),h={placement:"bottom",maxHeight:e};if(!n||!n.offsetParent)return h;var d=c.getBoundingClientRect(),g=d.height,y=n.getBoundingClientRect(),m=y.bottom,x=y.height,E=y.top,A=n.offsetParent.getBoundingClientRect(),N=A.top,O=l?window.innerHeight:BP(c),T=E3(c),D=parseInt(getComputedStyle(n).marginBottom,10),F=parseInt(getComputedStyle(n).marginTop,10),Q=N-F,P=O-E,$=Q+T,B=g-T-E,ne=m-O+T+D,I=T+E-F,z=160;switch(a){case"auto":case"bottom":if(P>=x)return{placement:"bottom",maxHeight:e};if(B>=x&&!l)return s&&kp(c,ne,z),{placement:"bottom",maxHeight:e};if(!l&&B>=r||l&&P>=r){s&&kp(c,ne,z);var J=l?P-D:B-D;return{placement:"bottom",maxHeight:J}}if(a==="auto"||l){var ae=e,me=l?Q:$;return me>=r&&(ae=Math.min(me-D-u,e)),{placement:"top",maxHeight:ae}}if(a==="bottom")return s&&jm(c,ne),{placement:"bottom",maxHeight:e};break;case"top":if(Q>=x)return{placement:"top",maxHeight:e};if($>=x&&!l)return s&&kp(c,I,z),{placement:"top",maxHeight:e};if(!l&&$>=r||l&&Q>=r){var Z=e;return(!l&&$>=r||l&&Q>=r)&&(Z=l?Q-F:$-F),s&&kp(c,I,z),{placement:"top",maxHeight:Z}}return{placement:"bottom",maxHeight:e};default:throw new Error('Invalid placement provided "'.concat(a,'".'))}return h}function QP(t){var e={bottom:"top",top:"bottom"};return t?e[t]:"bottom"}var N3=function(e){return e==="auto"?"bottom":e},e9=function(e,n){var r,a=e.placement,s=e.theme,l=s.borderRadius,u=s.spacing,c=s.colors;return $t((r={label:"menu"},Ph(r,QP(a),"100%"),Ph(r,"position","absolute"),Ph(r,"width","100%"),Ph(r,"zIndex",1),r),n?{}:{backgroundColor:c.neutral0,borderRadius:l,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:u.menuGutter,marginTop:u.menuGutter})},C3=k.createContext(null),t9=function(e){var n=e.children,r=e.minMenuHeight,a=e.maxMenuHeight,s=e.menuPlacement,l=e.menuPosition,u=e.menuShouldScrollIntoView,c=e.theme,h=k.useContext(C3)||{},d=h.setPortalPlacement,g=k.useRef(null),y=k.useState(a),m=ro(y,2),x=m[0],E=m[1],A=k.useState(null),N=ro(A,2),O=N[0],T=N[1],D=c.spacing.controlHeight;return Pv(function(){var F=g.current;if(F){var Q=l==="fixed",P=u&&!Q,$=ZP({maxHeight:a,menuEl:F,minHeight:r,placement:s,shouldScroll:P,isFixedPosition:Q,controlHeight:D});E($.maxHeight),T($.placement),d==null||d($.placement)}},[a,s,l,u,r,d,D]),n({ref:g,placerProps:$t($t({},e),{},{placement:O||N3(s),maxHeight:x})})},n9=function(e){var n=e.children,r=e.innerRef,a=e.innerProps;return Mt("div",Wt({},Yr(e,"menu",{menu:!0}),{ref:r},a),n)},r9=n9,a9=function(e,n){var r=e.maxHeight,a=e.theme.spacing.baseUnit;return $t({maxHeight:r,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},n?{}:{paddingBottom:a,paddingTop:a})},i9=function(e){var n=e.children,r=e.innerProps,a=e.innerRef,s=e.isMulti;return Mt("div",Wt({},Yr(e,"menuList",{"menu-list":!0,"menu-list--is-multi":s}),{ref:a},r),n)},T3=function(e,n){var r=e.theme,a=r.spacing.baseUnit,s=r.colors;return $t({textAlign:"center"},n?{}:{color:s.neutral40,padding:"".concat(a*2,"px ").concat(a*3,"px")})},s9=T3,o9=T3,l9=function(e){var n=e.children,r=n===void 0?"No options":n,a=e.innerProps,s=_l(e,JP);return Mt("div",Wt({},Yr($t($t({},s),{},{children:r,innerProps:a}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),a),r)},u9=function(e){var n=e.children,r=n===void 0?"Loading...":n,a=e.innerProps,s=_l(e,XP);return Mt("div",Wt({},Yr($t($t({},s),{},{children:r,innerProps:a}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),a),r)},c9=function(e){var n=e.rect,r=e.offset,a=e.position;return{left:n.left,position:a,top:r,width:n.width,zIndex:1}},f9=function(e){var n=e.appendTo,r=e.children,a=e.controlElement,s=e.innerProps,l=e.menuPlacement,u=e.menuPosition,c=k.useRef(null),h=k.useRef(null),d=k.useState(N3(l)),g=ro(d,2),y=g[0],m=g[1],x=k.useMemo(function(){return{setPortalPlacement:m}},[]),E=k.useState(null),A=ro(E,2),N=A[0],O=A[1],T=k.useCallback(function(){if(a){var P=qP(a),$=u==="fixed"?0:window.pageYOffset,B=P[y]+$;(B!==(N==null?void 0:N.offset)||P.left!==(N==null?void 0:N.rect.left)||P.width!==(N==null?void 0:N.rect.width))&&O({offset:B,rect:P})}},[a,u,y,N==null?void 0:N.offset,N==null?void 0:N.rect.left,N==null?void 0:N.rect.width]);Pv(function(){T()},[T]);var D=k.useCallback(function(){typeof h.current=="function"&&(h.current(),h.current=null),a&&c.current&&(h.current=PP(a,c.current,T,{elementResize:"ResizeObserver"in window}))},[a,T]);Pv(function(){D()},[D]);var F=k.useCallback(function(P){c.current=P,D()},[D]);if(!n&&u!=="fixed"||!N)return null;var Q=Mt("div",Wt({ref:F},Yr($t($t({},e),{},{offset:N.offset,position:u,rect:N.rect}),"menuPortal",{"menu-portal":!0}),s),r);return Mt(C3.Provider,{value:x},n?V_.createPortal(Q,n):Q)},h9=function(e){var n=e.isDisabled,r=e.isRtl;return{label:"container",direction:r?"rtl":void 0,pointerEvents:n?"none":void 0,position:"relative"}},d9=function(e){var n=e.children,r=e.innerProps,a=e.isDisabled,s=e.isRtl;return Mt("div",Wt({},Yr(e,"container",{"--is-disabled":a,"--is-rtl":s}),r),n)},p9=function(e,n){var r=e.theme.spacing,a=e.isMulti,s=e.hasValue,l=e.selectProps.controlShouldRenderValue;return $t({alignItems:"center",display:a&&s&&l?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},n?{}:{padding:"".concat(r.baseUnit/2,"px ").concat(r.baseUnit*2,"px")})},m9=function(e){var n=e.children,r=e.innerProps,a=e.isMulti,s=e.hasValue;return Mt("div",Wt({},Yr(e,"valueContainer",{"value-container":!0,"value-container--is-multi":a,"value-container--has-value":s}),r),n)},g9=function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},v9=function(e){var n=e.children,r=e.innerProps;return Mt("div",Wt({},Yr(e,"indicatorsContainer",{indicators:!0}),r),n)},Ex,y9=["size"],b9=["innerProps","isRtl","size"],w9={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},L3=function(e){var n=e.size,r=_l(e,y9);return Mt("svg",Wt({height:n,width:n,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:w9},r))},C2=function(e){return Mt(L3,Wt({size:20},e),Mt("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},O3=function(e){return Mt(L3,Wt({size:20},e),Mt("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},j3=function(e,n){var r=e.isFocused,a=e.theme,s=a.spacing.baseUnit,l=a.colors;return $t({label:"indicatorContainer",display:"flex",transition:"color 150ms"},n?{}:{color:r?l.neutral60:l.neutral20,padding:s*2,":hover":{color:r?l.neutral80:l.neutral40}})},x9=j3,S9=function(e){var n=e.children,r=e.innerProps;return Mt("div",Wt({},Yr(e,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),r),n||Mt(O3,null))},_9=j3,E9=function(e){var n=e.children,r=e.innerProps;return Mt("div",Wt({},Yr(e,"clearIndicator",{indicator:!0,"clear-indicator":!0}),r),n||Mt(C2,null))},A9=function(e,n){var r=e.isDisabled,a=e.theme,s=a.spacing.baseUnit,l=a.colors;return $t({label:"indicatorSeparator",alignSelf:"stretch",width:1},n?{}:{backgroundColor:r?l.neutral10:l.neutral20,marginBottom:s*2,marginTop:s*2})},N9=function(e){var n=e.innerProps;return Mt("span",Wt({},n,Yr(e,"indicatorSeparator",{"indicator-separator":!0})))},C9=wP(Ex||(Ex=xP([`
164
- 0%, 80%, 100% { opacity: 0; }
165
- 40% { opacity: 1; }
166
- `]))),T9=function(e,n){var r=e.isFocused,a=e.size,s=e.theme,l=s.colors,u=s.spacing.baseUnit;return $t({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:a,lineHeight:1,marginRight:a,textAlign:"center",verticalAlign:"middle"},n?{}:{color:r?l.neutral60:l.neutral20,padding:u*2})},p1=function(e){var n=e.delay,r=e.offset;return Mt("span",{css:_2({animation:"".concat(C9," 1s ease-in-out ").concat(n,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:r?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},L9=function(e){var n=e.innerProps,r=e.isRtl,a=e.size,s=a===void 0?4:a,l=_l(e,b9);return Mt("div",Wt({},Yr($t($t({},l),{},{innerProps:n,isRtl:r,size:s}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),n),Mt(p1,{delay:0,offset:r}),Mt(p1,{delay:160,offset:!0}),Mt(p1,{delay:320,offset:!r}))},O9=function(e,n){var r=e.isDisabled,a=e.isFocused,s=e.theme,l=s.colors,u=s.borderRadius,c=s.spacing;return $t({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:c.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},n?{}:{backgroundColor:r?l.neutral5:l.neutral0,borderColor:r?l.neutral10:a?l.primary:l.neutral20,borderRadius:u,borderStyle:"solid",borderWidth:1,boxShadow:a?"0 0 0 1px ".concat(l.primary):void 0,"&:hover":{borderColor:a?l.primary:l.neutral30}})},j9=function(e){var n=e.children,r=e.isDisabled,a=e.isFocused,s=e.innerRef,l=e.innerProps,u=e.menuIsOpen;return Mt("div",Wt({ref:s},Yr(e,"control",{control:!0,"control--is-disabled":r,"control--is-focused":a,"control--menu-is-open":u}),l,{"aria-disabled":r||void 0}),n)},R9=j9,D9=["data"],k9=function(e,n){var r=e.theme.spacing;return n?{}:{paddingBottom:r.baseUnit*2,paddingTop:r.baseUnit*2}},M9=function(e){var n=e.children,r=e.cx,a=e.getStyles,s=e.getClassNames,l=e.Heading,u=e.headingProps,c=e.innerProps,h=e.label,d=e.theme,g=e.selectProps;return Mt("div",Wt({},Yr(e,"group",{group:!0}),c),Mt(l,Wt({},u,{selectProps:g,theme:d,getStyles:a,getClassNames:s,cx:r}),h),Mt("div",null,n))},P9=function(e,n){var r=e.theme,a=r.colors,s=r.spacing;return $t({label:"group",cursor:"default",display:"block"},n?{}:{color:a.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:s.baseUnit*3,paddingRight:s.baseUnit*3,textTransform:"uppercase"})},I9=function(e){var n=_3(e);n.data;var r=_l(n,D9);return Mt("div",Wt({},Yr(e,"groupHeading",{"group-heading":!0}),r))},F9=M9,U9=["innerRef","isDisabled","isHidden","inputClassName"],B9=function(e,n){var r=e.isDisabled,a=e.value,s=e.theme,l=s.spacing,u=s.colors;return $t($t({visibility:r?"hidden":"visible",transform:a?"translateZ(0)":""},$9),n?{}:{margin:l.baseUnit/2,paddingBottom:l.baseUnit/2,paddingTop:l.baseUnit/2,color:u.neutral80})},R3={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},$9={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":$t({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},R3)},z9=function(e){return $t({label:"input",color:"inherit",background:0,opacity:e?0:1,width:"100%"},R3)},q9=function(e){var n=e.cx,r=e.value,a=_3(e),s=a.innerRef,l=a.isDisabled,u=a.isHidden,c=a.inputClassName,h=_l(a,U9);return Mt("div",Wt({},Yr(e,"input",{"input-container":!0}),{"data-value":r||""}),Mt("input",Wt({className:n({input:!0},c),ref:s,style:z9(u),disabled:l},h)))},H9=q9,V9=function(e,n){var r=e.theme,a=r.spacing,s=r.borderRadius,l=r.colors;return $t({label:"multiValue",display:"flex",minWidth:0},n?{}:{backgroundColor:l.neutral10,borderRadius:s/2,margin:a.baseUnit/2})},Y9=function(e,n){var r=e.theme,a=r.borderRadius,s=r.colors,l=e.cropWithEllipsis;return $t({overflow:"hidden",textOverflow:l||l===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},n?{}:{borderRadius:a/2,color:s.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},G9=function(e,n){var r=e.theme,a=r.spacing,s=r.borderRadius,l=r.colors,u=e.isFocused;return $t({alignItems:"center",display:"flex"},n?{}:{borderRadius:s/2,backgroundColor:u?l.dangerLight:void 0,paddingLeft:a.baseUnit,paddingRight:a.baseUnit,":hover":{backgroundColor:l.dangerLight,color:l.danger}})},D3=function(e){var n=e.children,r=e.innerProps;return Mt("div",r,n)},W9=D3,K9=D3;function J9(t){var e=t.children,n=t.innerProps;return Mt("div",Wt({role:"button"},n),e||Mt(C2,{size:14}))}var X9=function(e){var n=e.children,r=e.components,a=e.data,s=e.innerProps,l=e.isDisabled,u=e.removeProps,c=e.selectProps,h=r.Container,d=r.Label,g=r.Remove;return Mt(h,{data:a,innerProps:$t($t({},Yr(e,"multiValue",{"multi-value":!0,"multi-value--is-disabled":l})),s),selectProps:c},Mt(d,{data:a,innerProps:$t({},Yr(e,"multiValueLabel",{"multi-value__label":!0})),selectProps:c},n),Mt(g,{data:a,innerProps:$t($t({},Yr(e,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(n||"option")},u),selectProps:c}))},Z9=X9,Q9=function(e,n){var r=e.isDisabled,a=e.isFocused,s=e.isSelected,l=e.theme,u=l.spacing,c=l.colors;return $t({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},n?{}:{backgroundColor:s?c.primary:a?c.primary25:"transparent",color:r?c.neutral20:s?c.neutral0:"inherit",padding:"".concat(u.baseUnit*2,"px ").concat(u.baseUnit*3,"px"),":active":{backgroundColor:r?void 0:s?c.primary:c.primary50}})},eI=function(e){var n=e.children,r=e.isDisabled,a=e.isFocused,s=e.isSelected,l=e.innerRef,u=e.innerProps;return Mt("div",Wt({},Yr(e,"option",{option:!0,"option--is-disabled":r,"option--is-focused":a,"option--is-selected":s}),{ref:l,"aria-disabled":r},u),n)},tI=eI,nI=function(e,n){var r=e.theme,a=r.spacing,s=r.colors;return $t({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},n?{}:{color:s.neutral50,marginLeft:a.baseUnit/2,marginRight:a.baseUnit/2})},rI=function(e){var n=e.children,r=e.innerProps;return Mt("div",Wt({},Yr(e,"placeholder",{placeholder:!0}),r),n)},aI=rI,iI=function(e,n){var r=e.isDisabled,a=e.theme,s=a.spacing,l=a.colors;return $t({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},n?{}:{color:r?l.neutral40:l.neutral80,marginLeft:s.baseUnit/2,marginRight:s.baseUnit/2})},sI=function(e){var n=e.children,r=e.isDisabled,a=e.innerProps;return Mt("div",Wt({},Yr(e,"singleValue",{"single-value":!0,"single-value--is-disabled":r}),a),n)},oI=sI,k3={ClearIndicator:E9,Control:R9,DropdownIndicator:S9,DownChevron:O3,CrossIcon:C2,Group:F9,GroupHeading:I9,IndicatorsContainer:v9,IndicatorSeparator:N9,Input:H9,LoadingIndicator:L9,Menu:r9,MenuList:i9,MenuPortal:f9,LoadingMessage:u9,NoOptionsMessage:l9,MultiValue:Z9,MultiValueContainer:W9,MultiValueLabel:K9,MultiValueRemove:J9,Option:tI,Placeholder:aI,SelectContainer:d9,SingleValue:oI,ValueContainer:m9},lI=function(e){return $t($t({},k3),e.components)},Ax=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function uI(t,e){return!!(t===e||Ax(t)&&Ax(e))}function cI(t,e){if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(!uI(t[n],e[n]))return!1;return!0}function fI(t,e){e===void 0&&(e=cI);var n=null;function r(){for(var a=[],s=0;s<arguments.length;s++)a[s]=arguments[s];if(n&&n.lastThis===this&&e(a,n.lastArgs))return n.lastResult;var l=t.apply(this,a);return n={lastResult:l,lastArgs:a,lastThis:this},l}return r.clear=function(){n=null},r}var hI={name:"7pg0cj-a11yText",styles:"label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap"},dI=function(e){return Mt("span",Wt({css:hI},e))},Nx=dI,pI={guidance:function(e){var n=e.isSearchable,r=e.isMulti,a=e.tabSelectsValue,s=e.context,l=e.isInitialFocus;switch(s){case"menu":return"Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu".concat(a?", press Tab to select the option and exit the menu":"",".");case"input":return l?"".concat(e["aria-label"]||"Select"," is focused ").concat(n?",type to refine list":"",", press Down to open the menu, ").concat(r?" press left to focus selected values":""):"";case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value";default:return""}},onChange:function(e){var n=e.action,r=e.label,a=r===void 0?"":r,s=e.labels,l=e.isDisabled;switch(n){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(a,", deselected.");case"clear":return"All selected options have been cleared.";case"initial-input-focus":return"option".concat(s.length>1?"s":""," ").concat(s.join(","),", selected.");case"select-option":return l?"option ".concat(a," is disabled. Select another option."):"option ".concat(a,", selected.");default:return""}},onFocus:function(e){var n=e.context,r=e.focused,a=e.options,s=e.label,l=s===void 0?"":s,u=e.selectValue,c=e.isDisabled,h=e.isSelected,d=e.isAppleDevice,g=function(E,A){return E&&E.length?"".concat(E.indexOf(A)+1," of ").concat(E.length):""};if(n==="value"&&u)return"value ".concat(l," focused, ").concat(g(u,r),".");if(n==="menu"&&d){var y=c?" disabled":"",m="".concat(h?" selected":"").concat(y);return"".concat(l).concat(m,", ").concat(g(a,r),".")}return""},onFilter:function(e){var n=e.inputValue,r=e.resultsMessage;return"".concat(r).concat(n?" for search term "+n:"",".")}},mI=function(e){var n=e.ariaSelection,r=e.focusedOption,a=e.focusedValue,s=e.focusableOptions,l=e.isFocused,u=e.selectValue,c=e.selectProps,h=e.id,d=e.isAppleDevice,g=c.ariaLiveMessages,y=c.getOptionLabel,m=c.inputValue,x=c.isMulti,E=c.isOptionDisabled,A=c.isSearchable,N=c.menuIsOpen,O=c.options,T=c.screenReaderStatus,D=c.tabSelectsValue,F=c.isLoading,Q=c["aria-label"],P=c["aria-live"],$=k.useMemo(function(){return $t($t({},pI),g||{})},[g]),B=k.useMemo(function(){var me="";if(n&&$.onChange){var Z=n.option,ce=n.options,oe=n.removedValue,ge=n.removedValues,he=n.value,U=function(be){return Array.isArray(be)?null:be},j=oe||Z||U(he),Y=j?y(j):"",K=ce||ge||void 0,ie=K?K.map(y):[],V=$t({isDisabled:j&&E(j,u),label:Y,labels:ie},n);me=$.onChange(V)}return me},[n,$,E,u,y]),ne=k.useMemo(function(){var me="",Z=r||a,ce=!!(r&&u&&u.includes(r));if(Z&&$.onFocus){var oe={focused:Z,label:y(Z),isDisabled:E(Z,u),isSelected:ce,options:s,context:Z===r?"menu":"value",selectValue:u,isAppleDevice:d};me=$.onFocus(oe)}return me},[r,a,y,E,$,s,u,d]),I=k.useMemo(function(){var me="";if(N&&O.length&&!F&&$.onFilter){var Z=T({count:s.length});me=$.onFilter({inputValue:m,resultsMessage:Z})}return me},[s,m,N,$,O,T,F]),z=(n==null?void 0:n.action)==="initial-input-focus",J=k.useMemo(function(){var me="";if($.guidance){var Z=a?"value":N?"menu":"input";me=$.guidance({"aria-label":Q,context:Z,isDisabled:r&&E(r,u),isMulti:x,isSearchable:A,tabSelectsValue:D,isInitialFocus:z})}return me},[Q,r,a,x,E,A,N,$,u,D,z]),ae=Mt(k.Fragment,null,Mt("span",{id:"aria-selection"},B),Mt("span",{id:"aria-focused"},ne),Mt("span",{id:"aria-results"},I),Mt("span",{id:"aria-guidance"},J));return Mt(k.Fragment,null,Mt(Nx,{id:h},z&&ae),Mt(Nx,{"aria-live":P,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},l&&!z&&ae))},gI=mI,Iv=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],vI=new RegExp("["+Iv.map(function(t){return t.letters}).join("")+"]","g"),M3={};for(var m1=0;m1<Iv.length;m1++)for(var g1=Iv[m1],v1=0;v1<g1.letters.length;v1++)M3[g1.letters[v1]]=g1.base;var P3=function(e){return e.replace(vI,function(n){return M3[n]})},yI=fI(P3),Cx=function(e){return e.replace(/^\s+|\s+$/g,"")},bI=function(e){return"".concat(e.label," ").concat(e.value)},wI=function(e){return function(n,r){if(n.data.__isNew__)return!0;var a=$t({ignoreCase:!0,ignoreAccents:!0,stringify:bI,trim:!0,matchFrom:"any"},e),s=a.ignoreCase,l=a.ignoreAccents,u=a.stringify,c=a.trim,h=a.matchFrom,d=c?Cx(r):r,g=c?Cx(u(n)):u(n);return s&&(d=d.toLowerCase(),g=g.toLowerCase()),l&&(d=yI(d),g=P3(g)),h==="start"?g.substr(0,d.length)===d:g.indexOf(d)>-1}},xI=["innerRef"];function SI(t){var e=t.innerRef,n=_l(t,xI),r=KP(n,"onExited","in","enter","exit","appear");return Mt("input",Wt({ref:e},r,{css:_2({label:"dummyInput",background:0,border:0,caretColor:"transparent",fontSize:"inherit",gridArea:"1 / 1 / 2 / 3",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(.01)"},"","")}))}var _I=function(e){e.cancelable&&e.preventDefault(),e.stopPropagation()};function EI(t){var e=t.isEnabled,n=t.onBottomArrive,r=t.onBottomLeave,a=t.onTopArrive,s=t.onTopLeave,l=k.useRef(!1),u=k.useRef(!1),c=k.useRef(0),h=k.useRef(null),d=k.useCallback(function(A,N){if(h.current!==null){var O=h.current,T=O.scrollTop,D=O.scrollHeight,F=O.clientHeight,Q=h.current,P=N>0,$=D-F-T,B=!1;$>N&&l.current&&(r&&r(A),l.current=!1),P&&u.current&&(s&&s(A),u.current=!1),P&&N>$?(n&&!l.current&&n(A),Q.scrollTop=D,B=!0,l.current=!0):!P&&-N>T&&(a&&!u.current&&a(A),Q.scrollTop=0,B=!0,u.current=!0),B&&_I(A)}},[n,r,a,s]),g=k.useCallback(function(A){d(A,A.deltaY)},[d]),y=k.useCallback(function(A){c.current=A.changedTouches[0].clientY},[]),m=k.useCallback(function(A){var N=c.current-A.changedTouches[0].clientY;d(A,N)},[d]),x=k.useCallback(function(A){if(A){var N=YP?{passive:!1}:!1;A.addEventListener("wheel",g,N),A.addEventListener("touchstart",y,N),A.addEventListener("touchmove",m,N)}},[m,y,g]),E=k.useCallback(function(A){A&&(A.removeEventListener("wheel",g,!1),A.removeEventListener("touchstart",y,!1),A.removeEventListener("touchmove",m,!1))},[m,y,g]);return k.useEffect(function(){if(e){var A=h.current;return x(A),function(){E(A)}}},[e,x,E]),function(A){h.current=A}}var Tx=["boxSizing","height","overflow","paddingRight","position"],Lx={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function Ox(t){t.cancelable&&t.preventDefault()}function jx(t){t.stopPropagation()}function Rx(){var t=this.scrollTop,e=this.scrollHeight,n=t+this.offsetHeight;t===0?this.scrollTop=1:n===e&&(this.scrollTop=t-1)}function Dx(){return"ontouchstart"in window||navigator.maxTouchPoints}var kx=!!(typeof window<"u"&&window.document&&window.document.createElement),Oh=0,lf={capture:!1,passive:!1};function AI(t){var e=t.isEnabled,n=t.accountForScrollbars,r=n===void 0?!0:n,a=k.useRef({}),s=k.useRef(null),l=k.useCallback(function(c){if(kx){var h=document.body,d=h&&h.style;if(r&&Tx.forEach(function(x){var E=d&&d[x];a.current[x]=E}),r&&Oh<1){var g=parseInt(a.current.paddingRight,10)||0,y=document.body?document.body.clientWidth:0,m=window.innerWidth-y+g||0;Object.keys(Lx).forEach(function(x){var E=Lx[x];d&&(d[x]=E)}),d&&(d.paddingRight="".concat(m,"px"))}h&&Dx()&&(h.addEventListener("touchmove",Ox,lf),c&&(c.addEventListener("touchstart",Rx,lf),c.addEventListener("touchmove",jx,lf))),Oh+=1}},[r]),u=k.useCallback(function(c){if(kx){var h=document.body,d=h&&h.style;Oh=Math.max(Oh-1,0),r&&Oh<1&&Tx.forEach(function(g){var y=a.current[g];d&&(d[g]=y)}),h&&Dx()&&(h.removeEventListener("touchmove",Ox,lf),c&&(c.removeEventListener("touchstart",Rx,lf),c.removeEventListener("touchmove",jx,lf)))}},[r]);return k.useEffect(function(){if(e){var c=s.current;return l(c),function(){u(c)}}},[e,l,u]),function(c){s.current=c}}var NI=function(e){var n=e.target;return n.ownerDocument.activeElement&&n.ownerDocument.activeElement.blur()},CI={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function TI(t){var e=t.children,n=t.lockEnabled,r=t.captureEnabled,a=r===void 0?!0:r,s=t.onBottomArrive,l=t.onBottomLeave,u=t.onTopArrive,c=t.onTopLeave,h=EI({isEnabled:a,onBottomArrive:s,onBottomLeave:l,onTopArrive:u,onTopLeave:c}),d=AI({isEnabled:n}),g=function(m){h(m),d(m)};return Mt(k.Fragment,null,n&&Mt("div",{onClick:NI,css:CI}),e(g))}var LI={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},OI=function(e){var n=e.name,r=e.onFocus;return Mt("input",{required:!0,name:n,tabIndex:-1,"aria-hidden":"true",onFocus:r,css:LI,value:"",onChange:function(){}})},jI=OI;function T2(t){var e;return typeof window<"u"&&window.navigator!=null?t.test(((e=window.navigator.userAgentData)===null||e===void 0?void 0:e.platform)||window.navigator.platform):!1}function RI(){return T2(/^iPhone/i)}function I3(){return T2(/^Mac/i)}function DI(){return T2(/^iPad/i)||I3()&&navigator.maxTouchPoints>1}function kI(){return RI()||DI()}function MI(){return I3()||kI()}var PI=function(e){return e.label},II=function(e){return e.label},FI=function(e){return e.value},UI=function(e){return!!e.isDisabled},BI={clearIndicator:_9,container:h9,control:O9,dropdownIndicator:x9,group:k9,groupHeading:P9,indicatorsContainer:g9,indicatorSeparator:A9,input:B9,loadingIndicator:T9,loadingMessage:o9,menu:e9,menuList:a9,menuPortal:c9,multiValue:V9,multiValueLabel:Y9,multiValueRemove:G9,noOptionsMessage:s9,option:Q9,placeholder:nI,singleValue:iI,valueContainer:p9},$I={primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},zI=4,F3=4,qI=38,HI=F3*2,VI={baseUnit:F3,controlHeight:qI,menuGutter:HI},y1={borderRadius:zI,colors:$I,spacing:VI},YI={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:_x(),captureMenuScroll:!_x(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:wI(),formatGroupLabel:PI,getOptionLabel:II,getOptionValue:FI,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:UI,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!HP(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(e){var n=e.count;return"".concat(n," result").concat(n!==1?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function Mx(t,e,n,r){var a=$3(t,e,n),s=z3(t,e,n),l=B3(t,e),u=Rm(t,e);return{type:"option",data:e,isDisabled:a,isSelected:s,label:l,value:u,index:r}}function tm(t,e){return t.options.map(function(n,r){if("options"in n){var a=n.options.map(function(l,u){return Mx(t,l,e,u)}).filter(function(l){return Ix(t,l)});return a.length>0?{type:"group",data:n,options:a,index:r}:void 0}var s=Mx(t,n,e,r);return Ix(t,s)?s:void 0}).filter(GP)}function U3(t){return t.reduce(function(e,n){return n.type==="group"?e.push.apply(e,y2(n.options.map(function(r){return r.data}))):e.push(n.data),e},[])}function Px(t,e){return t.reduce(function(n,r){return r.type==="group"?n.push.apply(n,y2(r.options.map(function(a){return{data:a.data,id:"".concat(e,"-").concat(r.index,"-").concat(a.index)}}))):n.push({data:r.data,id:"".concat(e,"-").concat(r.index)}),n},[])}function GI(t,e){return U3(tm(t,e))}function Ix(t,e){var n=t.inputValue,r=n===void 0?"":n,a=e.data,s=e.isSelected,l=e.label,u=e.value;return(!H3(t)||!s)&&q3(t,{label:l,value:u,data:a},r)}function WI(t,e){var n=t.focusedValue,r=t.selectValue,a=r.indexOf(n);if(a>-1){var s=e.indexOf(n);if(s>-1)return n;if(a<e.length)return e[a]}return null}function KI(t,e){var n=t.focusedOption;return n&&e.indexOf(n)>-1?n:e[0]}var b1=function(e,n){var r,a=(r=e.find(function(s){return s.data===n}))===null||r===void 0?void 0:r.id;return a||null},B3=function(e,n){return e.getOptionLabel(n)},Rm=function(e,n){return e.getOptionValue(n)};function $3(t,e,n){return typeof t.isOptionDisabled=="function"?t.isOptionDisabled(e,n):!1}function z3(t,e,n){if(n.indexOf(e)>-1)return!0;if(typeof t.isOptionSelected=="function")return t.isOptionSelected(e,n);var r=Rm(t,e);return n.some(function(a){return Rm(t,a)===r})}function q3(t,e,n){return t.filterOption?t.filterOption(e,n):!0}var H3=function(e){var n=e.hideSelectedOptions,r=e.isMulti;return n===void 0?r:n},JI=1,V3=(function(t){vM(n,t);var e=wM(n);function n(r){var a;if(mM(this,n),a=e.call(this,r),a.state={ariaSelection:null,focusedOption:null,focusedOptionId:null,focusableOptionsWithIds:[],focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0,instancePrefix:"",isAppleDevice:!1},a.blockOptionHover=!1,a.isComposing=!1,a.commonProps=void 0,a.initialTouchX=0,a.initialTouchY=0,a.openAfterFocus=!1,a.scrollToFocusedOptionOnUpdate=!1,a.userIsDragging=void 0,a.controlRef=null,a.getControlRef=function(c){a.controlRef=c},a.focusedOptionRef=null,a.getFocusedOptionRef=function(c){a.focusedOptionRef=c},a.menuListRef=null,a.getMenuListRef=function(c){a.menuListRef=c},a.inputRef=null,a.getInputRef=function(c){a.inputRef=c},a.focus=a.focusInput,a.blur=a.blurInput,a.onChange=function(c,h){var d=a.props,g=d.onChange,y=d.name;h.name=y,a.ariaOnChange(c,h),g(c,h)},a.setValue=function(c,h,d){var g=a.props,y=g.closeMenuOnSelect,m=g.isMulti,x=g.inputValue;a.onInputChange("",{action:"set-value",prevInputValue:x}),y&&(a.setState({inputIsHiddenAfterUpdate:!m}),a.onMenuClose()),a.setState({clearFocusValueOnUpdate:!0}),a.onChange(c,{action:h,option:d})},a.selectOption=function(c){var h=a.props,d=h.blurInputOnSelect,g=h.isMulti,y=h.name,m=a.state.selectValue,x=g&&a.isOptionSelected(c,m),E=a.isOptionDisabled(c,m);if(x){var A=a.getOptionValue(c);a.setValue(m.filter(function(N){return a.getOptionValue(N)!==A}),"deselect-option",c)}else if(!E)g?a.setValue([].concat(y2(m),[c]),"select-option",c):a.setValue(c,"select-option");else{a.ariaOnChange(c,{action:"select-option",option:c,name:y});return}d&&a.blurInput()},a.removeValue=function(c){var h=a.props.isMulti,d=a.state.selectValue,g=a.getOptionValue(c),y=d.filter(function(x){return a.getOptionValue(x)!==g}),m=Pp(h,y,y[0]||null);a.onChange(m,{action:"remove-value",removedValue:c}),a.focusInput()},a.clearValue=function(){var c=a.state.selectValue;a.onChange(Pp(a.props.isMulti,[],null),{action:"clear",removedValues:c})},a.popValue=function(){var c=a.props.isMulti,h=a.state.selectValue,d=h[h.length-1],g=h.slice(0,h.length-1),y=Pp(c,g,g[0]||null);d&&a.onChange(y,{action:"pop-value",removedValue:d})},a.getFocusedOptionId=function(c){return b1(a.state.focusableOptionsWithIds,c)},a.getFocusableOptionsWithIds=function(){return Px(tm(a.props,a.state.selectValue),a.getElementId("option"))},a.getValue=function(){return a.state.selectValue},a.cx=function(){for(var c=arguments.length,h=new Array(c),d=0;d<c;d++)h[d]=arguments[d];return UP.apply(void 0,[a.props.classNamePrefix].concat(h))},a.getOptionLabel=function(c){return B3(a.props,c)},a.getOptionValue=function(c){return Rm(a.props,c)},a.getStyles=function(c,h){var d=a.props.unstyled,g=BI[c](h,d);g.boxSizing="border-box";var y=a.props.styles[c];return y?y(g,h):g},a.getClassNames=function(c,h){var d,g;return(d=(g=a.props.classNames)[c])===null||d===void 0?void 0:d.call(g,h)},a.getElementId=function(c){return"".concat(a.state.instancePrefix,"-").concat(c)},a.getComponents=function(){return lI(a.props)},a.buildCategorizedOptions=function(){return tm(a.props,a.state.selectValue)},a.getCategorizedOptions=function(){return a.props.menuIsOpen?a.buildCategorizedOptions():[]},a.buildFocusableOptions=function(){return U3(a.buildCategorizedOptions())},a.getFocusableOptions=function(){return a.props.menuIsOpen?a.buildFocusableOptions():[]},a.ariaOnChange=function(c,h){a.setState({ariaSelection:$t({value:c},h)})},a.onMenuMouseDown=function(c){c.button===0&&(c.stopPropagation(),c.preventDefault(),a.focusInput())},a.onMenuMouseMove=function(c){a.blockOptionHover=!1},a.onControlMouseDown=function(c){if(!c.defaultPrevented){var h=a.props.openMenuOnClick;a.state.isFocused?a.props.menuIsOpen?c.target.tagName!=="INPUT"&&c.target.tagName!=="TEXTAREA"&&a.onMenuClose():h&&a.openMenu("first"):(h&&(a.openAfterFocus=!0),a.focusInput()),c.target.tagName!=="INPUT"&&c.target.tagName!=="TEXTAREA"&&c.preventDefault()}},a.onDropdownIndicatorMouseDown=function(c){if(!(c&&c.type==="mousedown"&&c.button!==0)&&!a.props.isDisabled){var h=a.props,d=h.isMulti,g=h.menuIsOpen;a.focusInput(),g?(a.setState({inputIsHiddenAfterUpdate:!d}),a.onMenuClose()):a.openMenu("first"),c.preventDefault()}},a.onClearIndicatorMouseDown=function(c){c&&c.type==="mousedown"&&c.button!==0||(a.clearValue(),c.preventDefault(),a.openAfterFocus=!1,c.type==="touchend"?a.focusInput():setTimeout(function(){return a.focusInput()}))},a.onScroll=function(c){typeof a.props.closeMenuOnScroll=="boolean"?c.target instanceof HTMLElement&&fg(c.target)&&a.props.onMenuClose():typeof a.props.closeMenuOnScroll=="function"&&a.props.closeMenuOnScroll(c)&&a.props.onMenuClose()},a.onCompositionStart=function(){a.isComposing=!0},a.onCompositionEnd=function(){a.isComposing=!1},a.onTouchStart=function(c){var h=c.touches,d=h&&h.item(0);d&&(a.initialTouchX=d.clientX,a.initialTouchY=d.clientY,a.userIsDragging=!1)},a.onTouchMove=function(c){var h=c.touches,d=h&&h.item(0);if(d){var g=Math.abs(d.clientX-a.initialTouchX),y=Math.abs(d.clientY-a.initialTouchY),m=5;a.userIsDragging=g>m||y>m}},a.onTouchEnd=function(c){a.userIsDragging||(a.controlRef&&!a.controlRef.contains(c.target)&&a.menuListRef&&!a.menuListRef.contains(c.target)&&a.blurInput(),a.initialTouchX=0,a.initialTouchY=0)},a.onControlTouchEnd=function(c){a.userIsDragging||a.onControlMouseDown(c)},a.onClearIndicatorTouchEnd=function(c){a.userIsDragging||a.onClearIndicatorMouseDown(c)},a.onDropdownIndicatorTouchEnd=function(c){a.userIsDragging||a.onDropdownIndicatorMouseDown(c)},a.handleInputChange=function(c){var h=a.props.inputValue,d=c.currentTarget.value;a.setState({inputIsHiddenAfterUpdate:!1}),a.onInputChange(d,{action:"input-change",prevInputValue:h}),a.props.menuIsOpen||a.onMenuOpen()},a.onInputFocus=function(c){a.props.onFocus&&a.props.onFocus(c),a.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(a.openAfterFocus||a.props.openMenuOnFocus)&&a.openMenu("first"),a.openAfterFocus=!1},a.onInputBlur=function(c){var h=a.props.inputValue;if(a.menuListRef&&a.menuListRef.contains(document.activeElement)){a.inputRef.focus();return}a.props.onBlur&&a.props.onBlur(c),a.onInputChange("",{action:"input-blur",prevInputValue:h}),a.onMenuClose(),a.setState({focusedValue:null,isFocused:!1})},a.onOptionHover=function(c){if(!(a.blockOptionHover||a.state.focusedOption===c)){var h=a.getFocusableOptions(),d=h.indexOf(c);a.setState({focusedOption:c,focusedOptionId:d>-1?a.getFocusedOptionId(c):null})}},a.shouldHideSelectedOptions=function(){return H3(a.props)},a.onValueInputFocus=function(c){c.preventDefault(),c.stopPropagation(),a.focus()},a.onKeyDown=function(c){var h=a.props,d=h.isMulti,g=h.backspaceRemovesValue,y=h.escapeClearsValue,m=h.inputValue,x=h.isClearable,E=h.isDisabled,A=h.menuIsOpen,N=h.onKeyDown,O=h.tabSelectsValue,T=h.openMenuOnFocus,D=a.state,F=D.focusedOption,Q=D.focusedValue,P=D.selectValue;if(!E&&!(typeof N=="function"&&(N(c),c.defaultPrevented))){switch(a.blockOptionHover=!0,c.key){case"ArrowLeft":if(!d||m)return;a.focusValue("previous");break;case"ArrowRight":if(!d||m)return;a.focusValue("next");break;case"Delete":case"Backspace":if(m)return;if(Q)a.removeValue(Q);else{if(!g)return;d?a.popValue():x&&a.clearValue()}break;case"Tab":if(a.isComposing||c.shiftKey||!A||!O||!F||T&&a.isOptionSelected(F,P))return;a.selectOption(F);break;case"Enter":if(c.keyCode===229)break;if(A){if(!F||a.isComposing)return;a.selectOption(F);break}return;case"Escape":A?(a.setState({inputIsHiddenAfterUpdate:!1}),a.onInputChange("",{action:"menu-close",prevInputValue:m}),a.onMenuClose()):x&&y&&a.clearValue();break;case" ":if(m)return;if(!A){a.openMenu("first");break}if(!F)return;a.selectOption(F);break;case"ArrowUp":A?a.focusOption("up"):a.openMenu("last");break;case"ArrowDown":A?a.focusOption("down"):a.openMenu("first");break;case"PageUp":if(!A)return;a.focusOption("pageup");break;case"PageDown":if(!A)return;a.focusOption("pagedown");break;case"Home":if(!A)return;a.focusOption("first");break;case"End":if(!A)return;a.focusOption("last");break;default:return}c.preventDefault()}},a.state.instancePrefix="react-select-"+(a.props.instanceId||++JI),a.state.selectValue=xx(r.value),r.menuIsOpen&&a.state.selectValue.length){var s=a.getFocusableOptionsWithIds(),l=a.buildFocusableOptions(),u=l.indexOf(a.state.selectValue[0]);a.state.focusableOptionsWithIds=s,a.state.focusedOption=l[u],a.state.focusedOptionId=b1(s,l[u])}return a}return gM(n,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&Sx(this.menuListRef,this.focusedOptionRef),MI()&&this.setState({isAppleDevice:!0})}},{key:"componentDidUpdate",value:function(a){var s=this.props,l=s.isDisabled,u=s.menuIsOpen,c=this.state.isFocused;(c&&!l&&a.isDisabled||c&&u&&!a.menuIsOpen)&&this.focusInput(),c&&l&&!a.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!c&&!l&&a.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(Sx(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(a,s){this.props.onInputChange(a,s)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(a){var s=this,l=this.state,u=l.selectValue,c=l.isFocused,h=this.buildFocusableOptions(),d=a==="first"?0:h.length-1;if(!this.props.isMulti){var g=h.indexOf(u[0]);g>-1&&(d=g)}this.scrollToFocusedOptionOnUpdate=!(c&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:h[d],focusedOptionId:this.getFocusedOptionId(h[d])},function(){return s.onMenuOpen()})}},{key:"focusValue",value:function(a){var s=this.state,l=s.selectValue,u=s.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var c=l.indexOf(u);u||(c=-1);var h=l.length-1,d=-1;if(l.length){switch(a){case"previous":c===0?d=0:c===-1?d=h:d=c-1;break;case"next":c>-1&&c<h&&(d=c+1);break}this.setState({inputIsHidden:d!==-1,focusedValue:l[d]})}}}},{key:"focusOption",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"first",s=this.props.pageSize,l=this.state.focusedOption,u=this.getFocusableOptions();if(u.length){var c=0,h=u.indexOf(l);l||(h=-1),a==="up"?c=h>0?h-1:u.length-1:a==="down"?c=(h+1)%u.length:a==="pageup"?(c=h-s,c<0&&(c=0)):a==="pagedown"?(c=h+s,c>u.length-1&&(c=u.length-1)):a==="last"&&(c=u.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:u[c],focusedValue:null,focusedOptionId:this.getFocusedOptionId(u[c])})}}},{key:"getTheme",value:(function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(y1):$t($t({},y1),this.props.theme):y1})},{key:"getCommonProps",value:function(){var a=this.clearValue,s=this.cx,l=this.getStyles,u=this.getClassNames,c=this.getValue,h=this.selectOption,d=this.setValue,g=this.props,y=g.isMulti,m=g.isRtl,x=g.options,E=this.hasValue();return{clearValue:a,cx:s,getStyles:l,getClassNames:u,getValue:c,hasValue:E,isMulti:y,isRtl:m,options:x,selectOption:h,selectProps:g,setValue:d,theme:this.getTheme()}}},{key:"hasValue",value:function(){var a=this.state.selectValue;return a.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var a=this.props,s=a.isClearable,l=a.isMulti;return s===void 0?l:s}},{key:"isOptionDisabled",value:function(a,s){return $3(this.props,a,s)}},{key:"isOptionSelected",value:function(a,s){return z3(this.props,a,s)}},{key:"filterOption",value:function(a,s){return q3(this.props,a,s)}},{key:"formatOptionLabel",value:function(a,s){if(typeof this.props.formatOptionLabel=="function"){var l=this.props.inputValue,u=this.state.selectValue;return this.props.formatOptionLabel(a,{context:s,inputValue:l,selectValue:u})}else return this.getOptionLabel(a)}},{key:"formatGroupLabel",value:function(a){return this.props.formatGroupLabel(a)}},{key:"startListeningComposition",value:(function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))})},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:(function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))})},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:(function(){var a=this.props,s=a.isDisabled,l=a.isSearchable,u=a.inputId,c=a.inputValue,h=a.tabIndex,d=a.form,g=a.menuIsOpen,y=a.required,m=this.getComponents(),x=m.Input,E=this.state,A=E.inputIsHidden,N=E.ariaSelection,O=this.commonProps,T=u||this.getElementId("input"),D=$t($t($t({"aria-autocomplete":"list","aria-expanded":g,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":y,role:"combobox","aria-activedescendant":this.state.isAppleDevice?void 0:this.state.focusedOptionId||""},g&&{"aria-controls":this.getElementId("listbox")}),!l&&{"aria-readonly":!0}),this.hasValue()?(N==null?void 0:N.action)==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return l?k.createElement(x,Wt({},O,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:T,innerRef:this.getInputRef,isDisabled:s,isHidden:A,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:h,form:d,type:"text",value:c},D)):k.createElement(SI,Wt({id:T,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:Om,onFocus:this.onInputFocus,disabled:s,tabIndex:h,inputMode:"none",form:d,value:""},D))})},{key:"renderPlaceholderOrValue",value:function(){var a=this,s=this.getComponents(),l=s.MultiValue,u=s.MultiValueContainer,c=s.MultiValueLabel,h=s.MultiValueRemove,d=s.SingleValue,g=s.Placeholder,y=this.commonProps,m=this.props,x=m.controlShouldRenderValue,E=m.isDisabled,A=m.isMulti,N=m.inputValue,O=m.placeholder,T=this.state,D=T.selectValue,F=T.focusedValue,Q=T.isFocused;if(!this.hasValue()||!x)return N?null:k.createElement(g,Wt({},y,{key:"placeholder",isDisabled:E,isFocused:Q,innerProps:{id:this.getElementId("placeholder")}}),O);if(A)return D.map(function($,B){var ne=$===F,I="".concat(a.getOptionLabel($),"-").concat(a.getOptionValue($));return k.createElement(l,Wt({},y,{components:{Container:u,Label:c,Remove:h},isFocused:ne,isDisabled:E,key:I,index:B,removeProps:{onClick:function(){return a.removeValue($)},onTouchEnd:function(){return a.removeValue($)},onMouseDown:function(J){J.preventDefault()}},data:$}),a.formatOptionLabel($,"value"))});if(N)return null;var P=D[0];return k.createElement(d,Wt({},y,{data:P,isDisabled:E}),this.formatOptionLabel(P,"value"))}},{key:"renderClearIndicator",value:function(){var a=this.getComponents(),s=a.ClearIndicator,l=this.commonProps,u=this.props,c=u.isDisabled,h=u.isLoading,d=this.state.isFocused;if(!this.isClearable()||!s||c||!this.hasValue()||h)return null;var g={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return k.createElement(s,Wt({},l,{innerProps:g,isFocused:d}))}},{key:"renderLoadingIndicator",value:function(){var a=this.getComponents(),s=a.LoadingIndicator,l=this.commonProps,u=this.props,c=u.isDisabled,h=u.isLoading,d=this.state.isFocused;if(!s||!h)return null;var g={"aria-hidden":"true"};return k.createElement(s,Wt({},l,{innerProps:g,isDisabled:c,isFocused:d}))}},{key:"renderIndicatorSeparator",value:function(){var a=this.getComponents(),s=a.DropdownIndicator,l=a.IndicatorSeparator;if(!s||!l)return null;var u=this.commonProps,c=this.props.isDisabled,h=this.state.isFocused;return k.createElement(l,Wt({},u,{isDisabled:c,isFocused:h}))}},{key:"renderDropdownIndicator",value:function(){var a=this.getComponents(),s=a.DropdownIndicator;if(!s)return null;var l=this.commonProps,u=this.props.isDisabled,c=this.state.isFocused,h={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return k.createElement(s,Wt({},l,{innerProps:h,isDisabled:u,isFocused:c}))}},{key:"renderMenu",value:function(){var a=this,s=this.getComponents(),l=s.Group,u=s.GroupHeading,c=s.Menu,h=s.MenuList,d=s.MenuPortal,g=s.LoadingMessage,y=s.NoOptionsMessage,m=s.Option,x=this.commonProps,E=this.state.focusedOption,A=this.props,N=A.captureMenuScroll,O=A.inputValue,T=A.isLoading,D=A.loadingMessage,F=A.minMenuHeight,Q=A.maxMenuHeight,P=A.menuIsOpen,$=A.menuPlacement,B=A.menuPosition,ne=A.menuPortalTarget,I=A.menuShouldBlockScroll,z=A.menuShouldScrollIntoView,J=A.noOptionsMessage,ae=A.onMenuScrollToTop,me=A.onMenuScrollToBottom;if(!P)return null;var Z=function(Y,K){var ie=Y.type,V=Y.data,se=Y.isDisabled,be=Y.isSelected,xe=Y.label,Oe=Y.value,Me=E===V,Ue=se?void 0:function(){return a.onOptionHover(V)},Be=se?void 0:function(){return a.selectOption(V)},Ke="".concat(a.getElementId("option"),"-").concat(K),ee={id:Ke,onClick:Be,onMouseMove:Ue,onMouseOver:Ue,tabIndex:-1,role:"option","aria-selected":a.state.isAppleDevice?void 0:be};return k.createElement(m,Wt({},x,{innerProps:ee,data:V,isDisabled:se,isSelected:be,key:Ke,label:xe,type:ie,value:Oe,isFocused:Me,innerRef:Me?a.getFocusedOptionRef:void 0}),a.formatOptionLabel(Y.data,"menu"))},ce;if(this.hasOptions())ce=this.getCategorizedOptions().map(function(j){if(j.type==="group"){var Y=j.data,K=j.options,ie=j.index,V="".concat(a.getElementId("group"),"-").concat(ie),se="".concat(V,"-heading");return k.createElement(l,Wt({},x,{key:V,data:Y,options:K,Heading:u,headingProps:{id:se,data:j.data},label:a.formatGroupLabel(j.data)}),j.options.map(function(be){return Z(be,"".concat(ie,"-").concat(be.index))}))}else if(j.type==="option")return Z(j,"".concat(j.index))});else if(T){var oe=D({inputValue:O});if(oe===null)return null;ce=k.createElement(g,x,oe)}else{var ge=J({inputValue:O});if(ge===null)return null;ce=k.createElement(y,x,ge)}var he={minMenuHeight:F,maxMenuHeight:Q,menuPlacement:$,menuPosition:B,menuShouldScrollIntoView:z},U=k.createElement(t9,Wt({},x,he),function(j){var Y=j.ref,K=j.placerProps,ie=K.placement,V=K.maxHeight;return k.createElement(c,Wt({},x,he,{innerRef:Y,innerProps:{onMouseDown:a.onMenuMouseDown,onMouseMove:a.onMenuMouseMove},isLoading:T,placement:ie}),k.createElement(TI,{captureEnabled:N,onTopArrive:ae,onBottomArrive:me,lockEnabled:I},function(se){return k.createElement(h,Wt({},x,{innerRef:function(xe){a.getMenuListRef(xe),se(xe)},innerProps:{role:"listbox","aria-multiselectable":x.isMulti,id:a.getElementId("listbox")},isLoading:T,maxHeight:V,focusedOption:E}),ce)}))});return ne||B==="fixed"?k.createElement(d,Wt({},x,{appendTo:ne,controlElement:this.controlRef,menuPlacement:$,menuPosition:B}),U):U}},{key:"renderFormField",value:function(){var a=this,s=this.props,l=s.delimiter,u=s.isDisabled,c=s.isMulti,h=s.name,d=s.required,g=this.state.selectValue;if(d&&!this.hasValue()&&!u)return k.createElement(jI,{name:h,onFocus:this.onValueInputFocus});if(!(!h||u))if(c)if(l){var y=g.map(function(E){return a.getOptionValue(E)}).join(l);return k.createElement("input",{name:h,type:"hidden",value:y})}else{var m=g.length>0?g.map(function(E,A){return k.createElement("input",{key:"i-".concat(A),name:h,type:"hidden",value:a.getOptionValue(E)})}):k.createElement("input",{name:h,type:"hidden",value:""});return k.createElement("div",null,m)}else{var x=g[0]?this.getOptionValue(g[0]):"";return k.createElement("input",{name:h,type:"hidden",value:x})}}},{key:"renderLiveRegion",value:function(){var a=this.commonProps,s=this.state,l=s.ariaSelection,u=s.focusedOption,c=s.focusedValue,h=s.isFocused,d=s.selectValue,g=this.getFocusableOptions();return k.createElement(gI,Wt({},a,{id:this.getElementId("live-region"),ariaSelection:l,focusedOption:u,focusedValue:c,isFocused:h,selectValue:d,focusableOptions:g,isAppleDevice:this.state.isAppleDevice}))}},{key:"render",value:function(){var a=this.getComponents(),s=a.Control,l=a.IndicatorsContainer,u=a.SelectContainer,c=a.ValueContainer,h=this.props,d=h.className,g=h.id,y=h.isDisabled,m=h.menuIsOpen,x=this.state.isFocused,E=this.commonProps=this.getCommonProps();return k.createElement(u,Wt({},E,{className:d,innerProps:{id:g,onKeyDown:this.onKeyDown},isDisabled:y,isFocused:x}),this.renderLiveRegion(),k.createElement(s,Wt({},E,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:y,isFocused:x,menuIsOpen:m}),k.createElement(c,Wt({},E,{isDisabled:y}),this.renderPlaceholderOrValue(),this.renderInput()),k.createElement(l,Wt({},E,{isDisabled:y}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(a,s){var l=s.prevProps,u=s.clearFocusValueOnUpdate,c=s.inputIsHiddenAfterUpdate,h=s.ariaSelection,d=s.isFocused,g=s.prevWasFocused,y=s.instancePrefix,m=a.options,x=a.value,E=a.menuIsOpen,A=a.inputValue,N=a.isMulti,O=xx(x),T={};if(l&&(x!==l.value||m!==l.options||E!==l.menuIsOpen||A!==l.inputValue)){var D=E?GI(a,O):[],F=E?Px(tm(a,O),"".concat(y,"-option")):[],Q=u?WI(s,O):null,P=KI(s,D),$=b1(F,P);T={selectValue:O,focusedOption:P,focusedOptionId:$,focusableOptionsWithIds:F,focusedValue:Q,clearFocusValueOnUpdate:!1}}var B=c!=null&&a!==l?{inputIsHidden:c,inputIsHiddenAfterUpdate:void 0}:{},ne=h,I=d&&g;return d&&!I&&(ne={value:Pp(N,O,O[0]||null),options:O,action:"initial-input-focus"},I=!g),(h==null?void 0:h.action)==="initial-input-focus"&&(ne=null),$t($t($t({},T),B),{},{prevProps:a,ariaSelection:ne,prevWasFocused:I})}}]),n})(k.Component);V3.defaultProps=YI;var XI=k.forwardRef(function(t,e){var n=pM(t);return k.createElement(V3,Wt({ref:e},n))}),ZI=XI;const Y3="mosques-by-location-db",Cf="mosquesByLocation";async function QI(t,e){await(await Gr(Y3,1,{upgrade(r){r.objectStoreNames.contains(Cf)||r.createObjectStore(Cf)}})).put(Cf,e,t)}async function eF(t){return(await Gr(Y3,1,{upgrade(n){n.objectStoreNames.contains(Cf)||n.createObjectStore(Cf)}})).get(Cf,t)}function tF(t,{onFetchMosques:e}={}){const[n,r]=k.useState([]),[a,s]=k.useState(!1);return k.useEffect(()=>{if(!t){r([]);return}let l=!1;return s(!0),(async()=>{try{const c=await eF(t);if(!l&&c&&c.length>0&&(r(c),e==null||e(c)),navigator.onLine){const h=await QO(t);if(!l)if(!h||h.length===0)r([]),e==null||e([]);else{const d=h.map(g=>({value:g.id,label:g.name,isDisabled:g.name==="Other Masjids"?!0:g.isDisabled??!1}));r(d),e==null||e(d),await QI(t,d)}}else(!c||c.length===0)&&(r([]),e==null||e([]),Un("info","You are offline and no cached mosque data is available."))}catch(c){l||(r([]),console.error(`Error fetching mosques in location ${t}: `,c),await fa(c,{message:`Error fetching mosques in location ${t}`,function:"useMosqueForLocation"}),Un("error","Error fetching mosques!"))}finally{l||s(!1)}})(),()=>{l=!0}},[t]),{mosques:n,loading:a}}const nF=t=>{const e=k.useRef(null);return k.useEffect(()=>{const n=e.current;n&&(n.tabIndex=0,n.focus())},[]),_.jsx(k3.Input,{...t,innerRef:n=>{e.current=n}})},rF={control:t=>({...t,color:"#1a202c",backgroundColor:"white"}),singleValue:t=>({...t,color:"#1a202c"}),input:t=>({...t,color:"#1a202c"}),option:(t,e)=>({...t,color:e.isDisabled?"green":e.isSelected?"#fff":"#1a202c",backgroundColor:e.isDisabled?"#f0f0f0":e.isSelected?"#2563eb":"#fff",cursor:e.isDisabled?"default":"pointer",fontWeight:e.isDisabled?"bold":"normal",pointerEvents:e.isDisabled?"none":"auto"}),placeholder:t=>({...t,color:"#a0aec0"})},G3=({isHome:t=!0})=>{const{org_nr:e}=xr(),{locationId:n,selectedMosque:r,setSelectedMosque:a}=Ii(),{mosques:s}=tF(n),l=Pi(),u=io(),{t:c}=kr(),h=d=>{if(a(d),!d)return;const g=u.pathname;g.includes("events")?l(`/${d.value}/events`):g.includes("view-timetable")?l(`/${d.value}/view-timetable`):l(t?`/${d.value}`:`/${d.value}/view-timetable`)};return _.jsxs("div",{className:"flex justify-center gap-1",children:[_.jsx("div",{children:_.jsx("button",{type:"button",disabled:t,className:`p-0 border-0 bg-transparent ${t?"cursor-default":"cursor-pointer"}`,onClick:()=>{t||l(`/${e}`)},"aria-label":"Go to masjid home",children:_.jsx("img",{src:"/img/masjid-select.png",alt:""})})}),_.jsx("div",{className:"w-50",children:_.jsx(ZI,{options:s,value:r,onChange:h,isSearchable:!0,placeholder:c("Select Masjid"),noOptionsMessage:()=>"No masjid found",styles:rF,components:{Input:nF}})})]})};function aF(t){return Aa({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M11.9997 10.5865L16.9495 5.63672L18.3637 7.05093L13.4139 12.0007L18.3637 16.9504L16.9495 18.3646L11.9997 13.4149L7.04996 18.3646L5.63574 16.9504L10.5855 12.0007L5.63574 7.05093L7.04996 5.63672L11.9997 10.5865Z"},child:[]}]})(t)}const W3="location-db",Tf="locations";async function iF(t){await(await Gr(W3,1,{upgrade(n){n.objectStoreNames.contains(Tf)||n.createObjectStore(Tf)}})).put(Tf,t,"all")}async function Fx(){return(await Gr(W3,1,{upgrade(e){e.objectStoreNames.contains(Tf)||e.createObjectStore(Tf)}})).get(Tf,"all")}function sF(){const[t,e]=k.useState([{name:"Oslo",id:"NO0301"}]),[n,r]=k.useState(!0);return k.useEffect(()=>{(async()=>{try{const s=await Fx();if(!navigator.onLine){s&&s.length>0&&e(s),r(!1);return}const u=await eM();if(!u){s&&s.length>0&&(e(s),Un("warning","Could not fetch fresh data, showing cached locations.")),r(!1);return}e(u),await iF(u),r(!1)}catch(s){console.error("Error fetching locations: ",s),await fa(s,{message:"Error fetching locations",function:"useLocations"}),Un("error","Error fetching locations");const l=await Fx();l&&l.length>0&&(e(l),Un("info","Showing cached locations due to fetch error.")),r(!1)}})()},[]),{locations:t,loading:n}}function L2(t){return Aa({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M217.9 256L345 129c9.4-9.4 9.4-24.6 0-33.9-9.4-9.4-24.6-9.3-34 0L167 239c-9.1 9.1-9.3 23.7-.7 33.1L310.9 417c4.7 4.7 10.9 7 17 7s12.3-2.3 17-7c9.4-9.4 9.4-24.6 0-33.9L217.9 256z"},child:[]}]})(t)}function oF(t){return Aa({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M416.3 256c0-21 13.1-38.9 31.7-46.1-4.9-20.5-13-39.7-23.7-57.1-6.4 2.8-13.2 4.3-20.1 4.3-12.6 0-25.2-4.8-34.9-14.4-14.9-14.9-18.2-36.8-10.2-55-17.3-10.7-36.6-18.8-57-23.7C295 82.5 277 95.7 256 95.7S217 82.5 209.9 64c-20.5 4.9-39.7 13-57.1 23.7 8.1 18.1 4.7 40.1-10.2 55-9.6 9.6-22.3 14.4-34.9 14.4-6.9 0-13.7-1.4-20.1-4.3C77 170.3 68.9 189.5 64 210c18.5 7.1 31.7 25 31.7 46.1 0 21-13.1 38.9-31.6 46.1 4.9 20.5 13 39.7 23.7 57.1 6.4-2.8 13.2-4.2 20-4.2 12.6 0 25.2 4.8 34.9 14.4 14.8 14.8 18.2 36.8 10.2 54.9 17.4 10.7 36.7 18.8 57.1 23.7 7.1-18.5 25-31.6 46-31.6s38.9 13.1 46 31.6c20.5-4.9 39.7-13 57.1-23.7-8-18.1-4.6-40 10.2-54.9 9.6-9.6 22.2-14.4 34.9-14.4 6.8 0 13.7 1.4 20 4.2 10.7-17.4 18.8-36.7 23.7-57.1-18.4-7.2-31.6-25.1-31.6-46.2zm-159.4 79.9c-44.3 0-80-35.9-80-80s35.7-80 80-80 80 35.9 80 80-35.7 80-80 80z"},child:[]}]})(t)}const hg=({isHome:t=!0})=>{const{org_nr:e,loc_id:n}=xr(),r=Pi(),{t:a,i18n:s}=kr(),{language:l,setLanguage:u,asrMethod:c,setAsrMethod:h,prayerMethod:d,setPrayerMethod:g,locationId:y,setLocationId:m,mosqueLogo:x,selectedMosque:E,setSelectedMosque:A,lat:N,lon:O}=Ii(),{masjidName:T,masjidAddress:D,masjidPostName:F,masjidContact:Q,masjidEmail:P,masjidInfo:$}=gd(e||(E==null?void 0:E.value)||"982842840"),{locations:B}=sF(),[ne,I]=k.useState(!1),[z,J]=k.useState(!1),[ae,me]=k.useState(!1),[Z,ce]=k.useState(!1),oe=l==="ar",ge=N&&O?`https://www.openstreetmap.org/export/embed.html?bbox=${O},${N},${O+.002},${N+.002}&marker=${N},${O}&layer=mapnik`:"";k.useEffect(()=>{e&&E||ce(!0)},[e,E,n]);const he=j=>{u(yv(j)),s.changeLanguage(yv(j))},U=j=>{const Y=j.target.value;B.find(ie=>ie.id===Y)&&(m(Y),t&&r(`/loc/${Y}`)),A(null)};return _.jsxs("div",{children:[_.jsxs("div",{className:"w-full mb-4 flex justify-between items-center",children:[_.jsxs("div",{className:"flex items-center",children:[!t&&_.jsx("button",{onClick:()=>r(`/${e}`),className:"text-sm font-semibold px-3 py-1 rounded hover:bg-gray-100 hover:text-black",children:_.jsx(Jk,{})}),_.jsx("select",{value:y,onChange:U,className:"w-20 sm:w-40 h-full font-semibold hover:cursor-pointer",children:B.map(j=>_.jsx("option",{value:j.id,className:"text-black",children:j.name},j.id))})]}),_.jsx("div",{className:"flex items-center space-x-2 h-full",children:_.jsx("img",{src:x!=null&&x.startsWith("http")?x:x?`data:image/png;base64,${x}`:"/default-logo.png",alt:"logo",className:"h-10 2xl:h-14 object-contain",loading:"lazy"})})]}),_.jsxs("div",{className:"flex flex-col sm:items-end justify-center w-full gap-5 sm:flex-row sm:justify-between",children:[_.jsxs("div",{className:"flex flex-col sm:flex-row items-center sm:w-1/2 gap-5",children:[Z&&_.jsx(G3,{isHome:t}),_.jsxs("div",{children:[_.jsxs("h4",{className:"flex justify-center sm:justify-start items-center gap-4 text-lg sm:text-xl font-medium text-center mb-1",children:[T,!Z&&_.jsx("span",{className:"cursor-pointer",onClick:()=>ce(!0),children:_.jsx(aF,{size:20,color:"red"})})]}),_.jsx("p",{className:"text-sm md:text-base",children:$})]})]}),_.jsx("div",{dir:oe?"rtl":"ltr",children:_.jsxs("h4",{className:"flex sm:text-xl font-medium items-center justify-center gap-4",children:[_.jsx(v2,{size:22,className:"cursor-pointer hover:text-green-500 hidden md:block",onClick:()=>r(`/${e||"982842840"}/lobby`)}),_.jsx(V4,{className:"cursor-pointer hover:text-yellow-500 hidden md:block",onClick:()=>r(`/${e||"982842840"}/masjid`)}),_.jsx(jj,{className:"cursor-pointer hover:text-blue-500",onClick:()=>J(!0),title:"View Phone"}),_.jsx(Xk,{className:"cursor-pointer hover:text-red-500",onClick:()=>I(!0),title:"View Location"}),_.jsx(oF,{size:24,className:"cursor-pointer hover:text-blue-500",onClick:()=>me(!0),title:"Settings"})]})})]}),_.jsx("div",{className:"border-b w-full mt-2 sm:mt-4"}),ne&&_.jsx("div",{className:"fixed inset-0 flex items-center justify-center bg-black/50 z-50",onClick:()=>I(!1),children:_.jsx("div",{className:"bg-white rounded-lg p-4 relative shadow-lg w-[90vw] h-[50vh] sm:w-[600px] sm:h-[400px]",onClick:j=>j.stopPropagation(),children:ge?_.jsx("iframe",{width:"100%",height:"100%",className:"rounded-md",src:ge,style:{border:0},allowFullScreen:!0}):_.jsx("h2",{className:"flex justify-center items-center h-full text-xl text-black",children:"No map found!"})})}),z&&_.jsx("div",{className:`\r
167
- fixed inset-0 flex items-center justify-center \r
168
- lg:block \r
169
- bg-black/50 z-50\r
170
- `,onClick:()=>J(!1),children:_.jsxs("div",{className:`\r
171
- bg-white rounded-lg p-4 sm:p-6 shadow-lg flex flex-col gap-1 sm:gap-2\r
172
- w-[80vw] sm:w-[340px]\r
173
- mt-15 text-sm sm:text-base text-black\r
174
- \r
175
- /* Ensure text wraps instead of overflowing */\r
176
- break-words\r
177
- \r
178
- /* Center for small screens */\r
179
- sm:mx-auto sm:mt-[20vh]\r
180
- \r
181
- /* Right-bottom for large screens */\r
182
- lg:absolute lg:top-15 lg:right-10\r
183
- `,onClick:j=>j.stopPropagation(),children:[_.jsxs("p",{className:"font-medium",children:["Address: ",D]}),_.jsxs("p",{className:"font-medium",children:["Post Name: ",F]}),_.jsxs("p",{className:"font-medium",children:["Phone: ",Q]}),_.jsxs("p",{className:"font-medium",children:["Email: ",P]})]})}),ae&&_.jsx("div",{className:`\r
184
- fixed inset-0 flex items-center justify-center \r
185
- lg:block \r
186
- bg-black/50 z-50\r
187
- `,onClick:()=>me(!1),children:_.jsxs("div",{className:`\r
188
- bg-white text-black rounded-lg p-4 sm:p-5 shadow-lg flex flex-col gap-1\r
189
- w-[80vw] sm:w-[330px]\r
190
- mt-15 text-sm sm:text-base\r
191
- \r
192
- /* Ensure text wraps instead of overflowing */\r
193
- break-words\r
194
- \r
195
- /* Center for small screens */\r
196
- sm:mx-auto sm:mt-[20vh]\r
197
- \r
198
- /* Right-bottom for large screens */\r
199
- lg:absolute lg:top-15 lg:right-10\r
200
- `,onClick:j=>j.stopPropagation(),children:[_.jsxs("div",{className:"flex gap-2 items-center",children:[_.jsx("label",{className:"font-semibold w-30",children:a("LANGUAGE")}),_.jsxs("select",{value:l!==null?lO(l):"",onChange:j=>he(Number(j.target.value)),className:"rounded-md px-2 py-1",children:[_.jsx("option",{value:"",children:a("SELECT")}),_.jsx("option",{value:1,children:a("NORWEGIAN")}),_.jsx("option",{value:2,children:a("ENGLISH")}),_.jsx("option",{value:3,children:a("ARABIC")})]})]}),_.jsxs("div",{className:"flex gap-2 items-center",children:[_.jsx("h2",{className:"font-semibold w-30",children:a("ASR METHOD")}),_.jsxs("select",{value:c!==null?c:"",onChange:j=>h(Number(j.target.value)),className:"rounded-md px-2 py-1",children:[_.jsx("option",{value:"",children:a("SELECT")}),_.jsx("option",{value:0,children:a("IRN DEFAULT")}),_.jsx("option",{value:1,children:a("1X METHOD")}),_.jsx("option",{value:2,children:a("2X METHOD")}),_.jsx("option",{value:3,children:a("50% METHOD")})]})]}),_.jsxs("div",{className:"flex gap-2 items-center",children:[_.jsx("h2",{className:"font-semibold w-30",children:a("PRAYER METHOD")}),_.jsxs("select",{value:d!==null?d:"",onChange:j=>g(Number(j.target.value)),className:"rounded-md px-2 py-1",children:[_.jsx("option",{value:"",children:a("SELECT")}),_.jsx("option",{value:1,children:a("IRN DEFAULT")}),_.jsxs("option",{value:2,children:[a("NORTH")," ",a("METHOD").toLowerCase()]}),_.jsxs("option",{value:3,children:[a("SOUTH")," ",a("METHOD").toLowerCase()]})]})]})]})})]})},lF=["SUN","MON","TUE","WED","THU","FRI","SAT"],uF=t=>{switch(t){case 7:return{calendarBg:"#F8F5E9",calendarText:"#27391C",buttonBg:"#FFFFFF",headingColor:"#FFFFFF",buttonTextColor:"#3A7D44"};case 8:return{calendarBg:"#543A14",calendarText:"#F0BB78",buttonBg:"#543A14",headingColor:"#543A14",buttonTextColor:"#FFF0DC"};case 9:return{calendarBg:"#FEF9E133",calendarText:"#E5D0AC",buttonBg:"#FEF9E1",headingColor:"#FEF9E1",buttonTextColor:"#6D2323"};default:return{calendarBg:"white",calendarText:"black",buttonBg:"black",headingColor:"black",buttonTextColor:"white"}}},Ip=t=>Math.floor(t*.9703+622),nm=({tn:t,showDate:e=!0,initialDate:n,onDateSelect:r})=>{const{org_nr:a}=xr(),{t:s}=kr(),u=Sl(a||void 0).language,[c,h]=k.useState(n||new Date),[d,g]=k.useState(n||new Date),[y,m]=k.useState(null),[x,E]=k.useState(new Map),{colorScheme:A,hijriMonthNames:N}=Ii(),O=A.isDefault,T=uF(t??0),F=(()=>{const V=io(),se=`/${a}`;return a?V.pathname===se:V.pathname==="/"})(),Q=u==="ar"?"hijri":"gregorian",[P,$]=k.useState(0),[B,ne]=k.useState(0),I=c.getFullYear(),z=c.getMonth(),J=new Date,ae=u==="ar"?6:0,me=[];for(let V=0;V<7;V++){const se=(ae+V)%7;me.push(lF[se])}k.useEffect(()=>{n&&(g(n),h(new Date(n.getFullYear(),n.getMonth())))},[n]),k.useEffect(()=>{if(!x.size)return;const V=d.toLocaleDateString("en-CA"),se=x.get(V);m(se||null),Q==="hijri"&&P===0&&se&&($(se.hijri_date_year),ne(se.hijri_date_month),h(new Date(Ip(se.hijri_date_year),z)))},[x,d,Q,P,z]),k.useEffect(()=>{const V=I,se=new Date(V-1,0,1),be=new Date(V+1,11,31),xe=se.toISOString().split("T")[0],Oe=be.toISOString().split("T")[0];eg(xe,Oe).then(Me=>{E(Ue=>new Map([...Ue,...Me]))}).catch(Me=>{console.error("Failed to fetch Hijri dates for year:",Me)})},[I]);const Z=()=>{if(Q==="gregorian"){const se=(new Date(I,z,1).getDay()-ae+7)%7,be=new Date(I,z+1,0).getDate(),xe=[],Oe=z===0?11:z-1,Me=z===0?I-1:I,Ue=new Date(Me,Oe+1,0).getDate();for(let ee=se;ee>0;ee--){const qe=new Date(Me,Oe,Ue-ee+1),ct=qe.toLocaleDateString("en-CA"),tt=x.get(ct);xe.push({gregorian:qe.getDate(),hijri:tt==null?void 0:tt.hijri_date_day,hijriObj:tt,currentMonth:!1,fullDate:qe})}for(let ee=1;ee<=be;ee++){const qe=new Date(I,z,ee),ct=qe.toLocaleDateString("en-CA"),tt=x.get(ct);xe.push({gregorian:ee,hijri:tt==null?void 0:tt.hijri_date_day,hijriObj:tt,currentMonth:!0,fullDate:qe})}const Ke=(7-xe.length%7)%7;for(let ee=1;ee<=Ke;ee++){const qe=new Date(I,z+1,ee),ct=qe.toLocaleDateString("en-CA"),tt=x.get(ct);xe.push({gregorian:ee,hijri:tt==null?void 0:tt.hijri_date_day,hijriObj:tt,currentMonth:!1,fullDate:qe})}return xe}else{const V=[];for(const[Be,Ke]of x.entries())if(Ke.hijri_date_year===P&&Ke.hijri_date_month===B){const ee=new Date(Be);V.push({gregorian:ee.getDate(),hijri:Ke.hijri_date_day,hijriObj:Ke,currentMonth:!0,fullDate:ee})}if(V.sort((Be,Ke)=>Be.fullDate.getTime()-Ke.fullDate.getTime()),V.length===0)return[];const se=V[0].fullDate,be=V[V.length-1].fullDate,xe=(se.getDay()-ae+7)%7,Oe=[];for(let Be=xe;Be>0;Be--){const Ke=new Date(se);Ke.setDate(Ke.getDate()-Be);const ee=Ke.toLocaleDateString("en-CA"),qe=x.get(ee);Oe.push({gregorian:Ke.getDate(),hijri:qe==null?void 0:qe.hijri_date_day,hijriObj:qe,currentMonth:!1,fullDate:Ke})}Oe.push(...V);const Ue=(7-Oe.length%7)%7;for(let Be=1;Be<=Ue;Be++){const Ke=new Date(be);Ke.setDate(Ke.getDate()+Be);const ee=Ke.toLocaleDateString("en-CA"),qe=x.get(ee);Oe.push({gregorian:Ke.getDate(),hijri:qe==null?void 0:qe.hijri_date_day,hijriObj:qe,currentMonth:!1,fullDate:Ke})}return Oe}},ce=(V,se)=>{const be=V.getFullYear(),xe=V.getMonth();h(new Date(be,xe)),g(V),m(se||null),Q==="hijri"&&se&&($(se.hijri_date_year),ne(se.hijri_date_month)),r&&r(V,se)},oe=()=>{const V=J.toLocaleDateString("en-CA"),se=x.get(V),be=J.getFullYear(),xe=J.getMonth();h(new Date(be,xe)),g(J),m(se||null),Q==="hijri"&&se&&($(se.hijri_date_year),ne(se.hijri_date_month)),r&&r(J,se)},ge=()=>{if(Q==="gregorian")h(new Date(I,z-1));else{let V=B-1,se=P;V<1&&(V=12,se--),ne(V),$(se),h(new Date(Ip(se),0))}},he=()=>{if(Q==="gregorian")h(new Date(I,z+1));else{let V=B+1,se=P;V>12&&(V=1,se++),ne(V),$(se),h(new Date(Ip(se),0))}},U=V=>{Q==="gregorian"?h(new Date(V,z)):($(V),h(new Date(Ip(V),0)))},j=Z();let Y;Q==="gregorian"?Y=c.toLocaleString("default",{month:"long"}):Y=N[B-1]||`Month ${B}`;const K=Array.from({length:20},(V,se)=>Q==="gregorian"?2015+se:1436+se),ie=Q==="gregorian"?I:P;return _.jsx("div",{style:{color:O?T.calendarText:A.textColor},className:"",children:_.jsxs("div",{className:`${F?"p-4":"p-4 md:p-6"} rounded-lg border`,style:{color:O?T.calendarText:A.prayerTimesColor.text,backgroundColor:O?T.calendarBg:A.prayerTimesColor.bg,direction:u==="ar"?"rtl":"ltr"},children:[_.jsx("h2",{className:`text-center font-bold ${F?"text-sm sm:text-base mb-4":"text-md md:text-lg mb-4"}`,children:s("HIJRI CALENDAR").toUpperCase()}),_.jsxs("div",{className:`flex justify-between items-center ${F?"mb-3 px-2":"mb-4 md:mb-6 md:px-4"}`,children:[_.jsx("select",{value:ie,onChange:V=>U(Number(V.target.value)),className:`border p-${F?"1":"2"} rounded ${F?"text-sm":"text-sm md:text-md font-semibold"}`,style:{backgroundColor:O?T.buttonBg:A.prayerTimesColor.text,color:O?T.buttonTextColor:A.prayerTimesColor.bg},children:K.map(V=>_.jsx("option",{value:V,children:V},V))}),_.jsxs("div",{className:`flex items-center ${F?"gap-2":"gap-2 md:gap-4"}`,children:[_.jsx("button",{onClick:ge,className:`${F?"px-2":"md:px-2"}`,children:"<"}),_.jsx("span",{className:`font-semibold text-center ${F?"min-w-[80px] text-sm":"min-w-[60px] text-sm md:text-md"}`,children:s(Y.toUpperCase())}),_.jsx("button",{onClick:he,className:`${F?"px-2":"md:px-2"}`,children:">"})]})]}),_.jsx("div",{className:`grid grid-cols-7 gap-1 text-center ${F?"mb-2 text-sm":"mb-2 md:mb-3 md:text-md"} font-semibold`,children:me.map(V=>_.jsx("div",{children:s(V)},V))}),_.jsx("div",{className:"grid grid-cols-7 gap-1 text-center",children:j.map((V,se)=>{const be=V.fullDate.getDate()===d.getDate()&&V.fullDate.getMonth()===d.getMonth()&&V.fullDate.getFullYear()===d.getFullYear();return _.jsx("div",{onClick:()=>ce(V.fullDate,V.hijriObj),className:`${F?"p-1":"p-2"} rounded leading-none cursor-pointer ${be?"font-bold":""} ${!V.currentMonth&&!be?"opacity-90":""}`,style:{backgroundColor:be?O?T.buttonBg:A.prayerTimesColor.text:"transparent",color:be?O?T.buttonTextColor:A.prayerTimesColor.bg:V.currentMonth?O?T.calendarText:A.prayerTimesColor.text:O?`${T.calendarText}80`:`${A.prayerTimesColor.text}80`,lineHeight:"1"},children:u==="ar"?_.jsxs(_.Fragment,{children:[_.jsx("div",{className:"text-[14px] leading-none",children:V.hijri??""}),_.jsx("div",{className:"text-[10px] leading-none",children:V.gregorian})]}):_.jsxs(_.Fragment,{children:[_.jsx("div",{className:"text-[14px] leading-none",children:V.gregorian}),_.jsx("div",{className:"text-[10px] leading-none",children:V.hijri??""})]})},se)})}),_.jsxs("div",{className:`mt-4 gap-4 ${e?"flex justify-between items-center":"flex justify-end items-center"}`,children:[e&&_.jsxs("div",{className:`flex-1 text-center md:ml-${F?"20":"10"} lg:ml-${F?"20":"10"}`,children:[_.jsx("h2",{className:`${F?"text-sm":"text-sm md:text-md"} font-semibold`,children:d.toLocaleDateString("en-GB",{day:"numeric",month:"long",year:"numeric"})}),_.jsx("h2",{className:`${F?"text-sm":"text-sm md:text-md"} font-semibold`,children:y?Mo({hijriDayObj:y,language:u,t:s,hijriMonthNames:N}):"-"})]}),_.jsx("button",{onClick:oe,className:`${F?"px-3 py-1 text-sm":"px-2 py-1 text-sm md:text-md"} rounded-md font-semibold`,style:{backgroundColor:O?T.buttonBg:A.prayerTimesColor.text,color:O?T.buttonTextColor:A.prayerTimesColor.bg},children:s("TODAY")})]})]})})},uf=["Muharram","Safar","Rabi'ul Awwal","Rabi'ul Akhir","Jumadal Ula","Jumadal Akhira","Rajab","Sha'ban","Ramadan","Shawwal","Dhul Qa'ada","Dhul Hijja"];function O2({nr:t,isHome:e=!0}){const{i18n:n,t:r}=kr(),a=n.language||"en",{colorScheme:s,date:l,setDate:u,setNextHijriDay:c,periodType:h,setPeriodType:d,periodFrom:g,periodTo:y,setPeriodFrom:m,setPeriodTo:x,hijriMonthNames:E}=Ii(),[A,N]=k.useState(null),[O,T]=k.useState(null),[D,F]=k.useState(new Map),[Q,P]=k.useState(!1),[$,B]=k.useState(!1),[ne,I]=k.useState(!1),z=s.textColor,J=s.isDefault,ae=k.useRef(null),me=k.useRef(null),Z=k.useRef(null),ce=k.useRef(null),oe=k.useRef(null),ge=k.useRef(null);k.useEffect(()=>{const V=se=>{Q&&ae.current&&!ae.current.contains(se.target)&&me.current&&!me.current.contains(se.target)&&(console.log("Clicked outside main calendar, closing..."),P(!1)),$&&Z.current&&!Z.current.contains(se.target)&&oe.current&&!oe.current.contains(se.target)&&(console.log("Clicked outside From calendar, closing..."),B(!1)),ne&&ce.current&&!ce.current.contains(se.target)&&ge.current&&!ge.current.contains(se.target)&&(console.log("Clicked outside To calendar, closing..."),I(!1))};return document.addEventListener("mousedown",V),()=>{document.removeEventListener("mousedown",V)}},[Q,$,ne]),k.useEffect(()=>{if(!l)return;const V=l.getFullYear(),se=new Date(V,0,1),be=new Date(V,11,31),xe=se.toLocaleDateString("en-CA"),Oe=be.toLocaleDateString("en-CA");eg(xe,Oe).then(Me=>{F(Me);const Ue=l.toLocaleDateString("en-CA"),Be=Me.get(Ue);N(Be||null),h==="Custom"&&T(Be||null)}).catch(Me=>{console.error("Failed to fetch Hijri dates for year:",Me)})},[l,h]),k.useEffect(()=>{e&&d("Daily")},[e]),k.useEffect(()=>{if(l)if(h==="Daily")m(l),x(l);else if(h==="Weekly")m(l),x(new Date(l.getTime()+6*864e5));else if(h==="Monthly"){const V=new Date(l.getFullYear(),l.getMonth(),1),se=new Date(l.getFullYear(),l.getMonth()+1,0);m(V),x(se)}else h==="Custom"&&(m(l),x(l))},[l,h,m,x]),k.useEffect(()=>{if(!g||!y||!D.size)return;const V=g.toLocaleDateString("en-CA"),se=y.toLocaleDateString("en-CA"),be=D.get(V);N(be||null);const xe=D.get(se);if(T(xe||null),h==="Daily"){const Oe=new Date(g);Oe.setDate(Oe.getDate()+1);const Me=Oe.toLocaleDateString("en-CA"),Ue=D.get(Me);c(Ue||null)}else c(null)},[g,y,h,D,c]);const he=(V,se,be=!0)=>{if(!V)return;const xe=V.toLocaleDateString("en-CA"),Oe=D.get(xe)||se;h==="Custom"?be?(m(V),N(Oe||null),B(!1),y&&V>y&&(x(V),T(Oe||null))):(g&&V<g?(x(g),T(A),m(V),N(Oe||null)):(x(V),T(Oe||null)),I(!1)):(u(V),N(Oe||null),P(!1))};function U(){const V=e?"text-sm sm:text-base lg:text-lg":"text-xs sm:text-sm",se=e?"text-xs sm:text-sm lg:text-base":"text-xs sm:text-sm",be=Me=>{const Ue=Me.toLocaleString("en-US",{month:"long"}),Be=r(Ue.toUpperCase()),Ke=Me.getDate(),ee=Me.getFullYear();return a==="ar"?`${ee} ${Be} ${Ke}`:`${Ke} ${Be} ${ee}`},xe=(Me,Ue)=>{if(!Me||!Ue)return"Loading...";const Be=Me.toLocaleString("en-US",{month:"long"}),Ke=Ue.toLocaleString("en-US",{month:"long"}),ee=r(Be.toUpperCase()),qe=r(Ke.toUpperCase()),ct=Me.getDate(),tt=Ue.getDate(),Ye=Me.getFullYear(),gt=Ue.getFullYear();return a==="ar"?Ye===gt&&ee===qe?`${Ye} ${ee} ${ct} – ${tt}`:Ye===gt?`${Ye} ${ee} ${ct} – ${qe} ${tt}`:`${Ye} ${ee} ${ct} – ${gt} ${qe} ${tt}`:Ye===gt&&ee===qe?`${ct} – ${tt} ${ee} ${Ye}`:Ye===gt?`${ct} ${ee} – ${tt} ${qe} ${Ye}`:`${ct} ${ee} ${Ye} – ${tt} ${qe} ${gt}`},Oe=(Me,Ue)=>{if(!Me||!Ue)return"-";const Be=r(uf[Me.hijri_date_month-1].toUpperCase()),Ke=r(uf[Ue.hijri_date_month-1].toUpperCase()),ee=Me.hijri_date_day,qe=Ue.hijri_date_day,ct=Me.hijri_date_year,tt=Ue.hijri_date_year;return a==="ar"?ct===tt&&Be===Ke?`${ct} ${Be} ${ee} – ${qe}`:ct===tt?`${ct} ${Be} ${ee} – ${Ke} ${qe}`:`${ct} ${Be} ${ee} – ${tt} ${Ke} ${qe}`:ct===tt&&Be===Ke?`${ee} – ${qe} ${Be} ${ct}`:ct===tt?`${ee} ${Be} – ${qe} ${Ke} ${ct}`:`${ee} ${Be} ${ct} – ${qe} ${Ke} ${tt}`};if(h==="Daily")return _.jsxs(_.Fragment,{children:[_.jsx("div",{className:`font-medium ${V}`,style:{color:J?"":z},children:g?be(g):"Loading..."}),_.jsx("div",{className:`font-medium ${se}`,style:{color:J?"":z},children:A&&E.length>0?Mo({hijriDayObj:A,language:a,t:r,hijriMonthNames:E}):"-"})]});if(h==="Weekly")return _.jsxs(_.Fragment,{children:[_.jsx("div",{className:`font-medium ${V}`,style:{color:J?"":z},children:xe(g,y)}),_.jsx("div",{className:`font-medium ${se}`,style:{color:J?"":z},children:Oe(A,O)})]});if(h==="Monthly")if(a==="ar"){const Me=g?`${g.getFullYear()} ${r(g.toLocaleString("en-US",{month:"long"}).toUpperCase())}`:"Loading...";let Ue="";if(A&&O){const Be=r(uf[A.hijri_date_month-1].toUpperCase()),Ke=r(uf[O.hijri_date_month-1].toUpperCase()),ee=A.hijri_date_year;Ue=Be===Ke?`${Be} ${ee}`:`${Be} – ${Ke} ${ee}`}return _.jsxs(_.Fragment,{children:[_.jsx("div",{className:`font-medium ${V}`,style:{color:J?"":z},children:Me}),_.jsx("div",{className:`font-medium ${se}`,style:{color:J?"":z},children:Ue})]})}else{const Me=g?`${r(g.toLocaleString("en-US",{month:"long"}).toUpperCase())} ${g.getFullYear()}`:"Loading...";let Ue="";if(A&&O){const Be=r(uf[A.hijri_date_month-1].toUpperCase()),Ke=r(uf[O.hijri_date_month-1].toUpperCase()),ee=A.hijri_date_year;Ue=Be===Ke?`${Be} ${ee}`:`${Be} – ${Ke} ${ee}`}return _.jsxs(_.Fragment,{children:[_.jsx("div",{className:`font-medium ${V}`,style:{color:J?"":z},children:Me}),_.jsx("div",{className:`font-medium ${se}`,style:{color:J?"":z},children:Ue||"-"})]})}else if(h==="Custom")return _.jsxs(_.Fragment,{children:[_.jsx("div",{className:`font-medium ${V}`,style:{color:J?"":z},children:xe(g,y)}),_.jsx("div",{className:`font-medium ${se}`,style:{color:J?"":z},children:Oe(A,O)})]});return null}const j=()=>{if(l)if(h==="Monthly"){const V=new Date(l);V.setMonth(V.getMonth()-1),u(V)}else if(h==="Custom"){if(g){const V=new Date(g.getTime()-864e5);m(V),u(V),y.getTime()===g.getTime()&&x(V)}}else u(new Date(l.getTime()-1440*60*1e3))},Y=()=>{if(l)if(h==="Monthly"){const V=new Date(l);V.setMonth(V.getMonth()+1),u(V)}else if(h==="Custom"){if(g){const V=new Date(g.getTime()+864e5);m(V),u(V),y.getTime()===g.getTime()&&x(V)}}else u(new Date(l.getTime()+1440*60*1e3))},K=()=>{if(l){if(a==="ar"&&h==="Monthly"&&A){let V=A.hijri_date_month-1,se=A.hijri_date_year;V<1&&(V=12,se--);const be=Math.floor(se*.9703+622);u(new Date(be,0,1))}else{const V=new Date(l);V.setMonth(V.getMonth()-1),u(V)}if(h==="Custom"&&g){const V=new Date(g);V.setMonth(V.getMonth()-1),m(V),y.getTime()===g.getTime()&&x(V)}}},ie=()=>{if(l){if(a==="ar"&&h==="Monthly"&&A){let V=A.hijri_date_month+1,se=A.hijri_date_year;V>12&&(V=1,se++);const be=Math.floor(se*.9703+622);u(new Date(be,0,1))}else{const V=new Date(l);V.setMonth(V.getMonth()+1),u(V)}if(h==="Custom"&&g){const V=new Date(g);V.setMonth(V.getMonth()+1),m(V),y.getTime()===g.getTime()&&x(V)}}};return _.jsxs("div",{className:`flex items-center ${h==="Custom"?"justify-between gap-4 sm:gap-6 lg:gap-10":"justify-center gap-1 sm:gap-2 lg:gap-4"}`,children:[h==="Custom"?_.jsxs("div",{className:"flex flex-col gap-2 items-center w-full sm:w-auto",children:[_.jsxs("div",{className:"flex justify-between items-center w-full gap-2",children:[_.jsx("label",{className:`font-medium ${e?"text-xs sm:text-sm lg:text-base":"text-xs sm:text-sm"}`,style:{color:J?"":z},children:r("FROM")}),_.jsxs("div",{className:"relative flex items-center",children:[_.jsx("input",{type:"date",value:g?g.toLocaleDateString("en-CA"):"",onChange:V=>{const se=new Date(V.target.value);he(se,void 0,!0)},className:`text-black font-medium text-center rounded p-1 ${e?"h-6 sm:h-7 lg:h-8 w-24 sm:w-28 lg:w-32 text-xs sm:text-sm lg:text-base":"h-5 sm:h-6 w-24 lg:w-26 sm:w-24 text-xs sm:text-sm"} ${t===7?"bg-white":t===8?"bg-[#F0BB78]":"bg-[#E5D0AC]"}`,style:{backgroundColor:J?"":z}}),_.jsx("button",{ref:oe,className:"ml-1 sm:ml-2 text-sm sm:text-base lg:text-lg p-1 sm:p-1.5 lg:p-2 transition","aria-label":"Open From calendar",type:"button",onClick:()=>B(!$),children:_.jsx(e1,{color:J?"":z,size:24})}),$&&_.jsx("div",{ref:Z,className:"absolute bg-white border border-gray-300 shadow-md rounded-md z-10 w-60 h-64 sm:w-64 sm:h-auto",style:{top:"100%",left:0},children:_.jsx(nm,{showDate:!1,initialDate:g||l,onDateSelect:(V,se)=>he(V,se,!0)})})]})]}),_.jsxs("div",{className:"flex justify-between items-center w-full gap-2",children:[_.jsx("label",{className:`font-medium ${e?"text-xs sm:text-sm lg:text-base":"text-xs sm:text-sm"} ${t===7?"text-white":t===8?"text-[#543A14]":"text-[#E5D0AC]"}`,style:{color:J?"":z},children:r("TO")}),_.jsxs("div",{className:"relative flex items-center",children:[_.jsx("input",{type:"date",value:y?y.toLocaleDateString("en-CA"):"",min:g?g.toLocaleDateString("en-CA"):"",onChange:V=>{const se=new Date(V.target.value);he(se,void 0,!1)},className:`text-black font-medium text-center rounded p-1 ${e?"h-6 sm:h-7 lg:h-8 w-24 sm:w-28 lg:w-32 text-xs sm:text-sm lg:text-base":"h-5 sm:h-6 w-24 lg:w-26 sm:w-24 text-xs sm:text-sm"} ${t===7?"bg-white":t===8?"bg-[#F0BB78]":"bg-[#E5D0AC]"}`,style:{backgroundColor:J?"":z}}),_.jsx("button",{ref:ge,className:"ml-1 sm:ml-2 text-sm sm:text-base lg:text-lg p-1 sm:p-1.5 lg:p-2 transition","aria-label":"Open To calendar",type:"button",onClick:()=>I(!ne),children:_.jsx(e1,{color:J?"":z,size:24})}),ne&&_.jsx("div",{ref:ce,className:"absolute bg-white border border-gray-300 shadow-md rounded-md z-10 w-60 h-64 sm:w-64 sm:h-auto",style:{top:"100%",left:0},children:_.jsx(nm,{showDate:!1,initialDate:y||l,onDateSelect:(V,se)=>he(V,se,!1)})})]})]})]}):_.jsxs(_.Fragment,{children:[_.jsxs("div",{className:`flex items-center ${e?"gap-1 sm:gap-2 lg:gap-4":"gap-0.5 sm:gap-1"}`,children:[e&&_.jsx("button",{onClick:K,className:`rounded-md transition flex items-center justify-center ${e?"text-xs sm:text-sm lg:text-base w-6 sm:w-8 lg:w-10 h-6 sm:h-8 lg:h-10":"text-xs sm:text-sm w-5 sm:w-6 h-5 sm:h-6"} ${t===7?"text-[#3A7D44] bg-white hover:bg-white/80":t===8?"text-[#FFF0DC] bg-[#543A14] hover:bg-black/60":"text-[#6D2323] bg-[#E5D0AC] hover:bg-white/80"}`,style:{backgroundColor:J?"":z},"aria-label":"Previous month",type:"button",children:_.jsx(Cj,{})}),_.jsx("button",{onClick:j,className:`rounded-md transition flex items-center justify-center ${e?"text-xs sm:text-sm lg:text-base w-6 sm:w-8 lg:w-10 h-6 sm:h-8 lg:h-10":"text-xs sm:text-sm w-5 sm:w-6 h-5 sm:h-6"} ${t===7?"text-[#3A7D44] bg-white hover:bg-white/80":t===8?"text-[#FFF0DC] bg-[#543A14] hover:bg-black/60":"text-[#6D2323] bg-[#E5D0AC] hover:bg-white/80"}`,style:{backgroundColor:J?"":z},"aria-label":"Previous period",type:"button",children:_.jsx(Lj,{})}),_.jsx("div",{className:"flex flex-col items-center justify-center flex-1",children:U()}),_.jsx("button",{onClick:Y,className:`rounded-md transition flex items-center justify-center ${e?"text-xs sm:text-sm lg:text-base w-6 sm:w-8 lg:w-10 h-6 sm:h-8 lg:h-10":"text-xs sm:text-sm w-5 sm:w-6 h-5 sm:h-6"} ${t===7?"text-[#3A7D44] bg-white hover:bg-white/80":t===8?"text-[#FFF0DC] bg-[#543A14] hover:bg-black/60":"text-[#6D2323] bg-[#E5D0AC] hover:bg-white/80"}`,style:{backgroundColor:J?"":z},"aria-label":"Next period",type:"button",children:_.jsx(Oj,{})}),e&&_.jsx("button",{onClick:ie,className:`rounded-md transition flex items-center justify-center ${e?"text-xs sm:text-sm lg:text-base w-6 sm:w-8 lg:w-10 h-6 sm:h-8 lg:h-10":"text-xs sm:text-sm w-5 sm:w-6 h-5 sm:h-6"} ${t===7?"text-[#3A7D44] bg-white hover:bg-white/80":t===8?"text-[#FFF0DC] bg-[#543A14] hover:bg-black/60":"text-[#6D2323] bg-[#E5D0AC] hover:bg-white/80"}`,style:{backgroundColor:J?"":z},"aria-label":"Next month",type:"button",children:_.jsx(Tj,{})})]}),_.jsxs("div",{className:"relative",children:[_.jsx("button",{ref:me,className:"text-sm sm:text-base lg:text-lg p-1 sm:p-1.5 lg:p-2 transition flex items-center justify-center","aria-label":"Open calendar",type:"button",tabIndex:0,onClick:()=>P(!Q),children:_.jsx(e1,{color:J?"":z,size:24})}),Q&&_.jsx("div",{ref:ae,className:"absolute bg-white border border-gray-300 shadow-md rounded-md z-10 w-60 h-64 sm:w-64 sm:h-auto",style:{top:"100%",right:0},children:_.jsx(nm,{showDate:!1,initialDate:l,onDateSelect:(V,se)=>he(V,se,!0)})})]})]}),!e&&_.jsx("div",{className:"",children:_.jsxs("select",{value:h,className:`rounded-sm focus:outline-none ${e?"text-xs sm:text-sm lg:text-base p-1":"text-xs sm:text-sm p-0.5 sm:p-1"} text-black ${t===7?"bg-white":t===8?"bg-[#F0BB78]":"bg-[#E5D0AC]"}`,style:{color:J?"":s.bgColor,backgroundColor:J?"":z},onChange:V=>d(V.target.value),children:[_.jsx("option",{value:"Daily",children:r("DAILY")}),_.jsx("option",{value:"Weekly",children:r("WEEKLY")}),_.jsx("option",{value:"Monthly",children:r("MONTHLY")}),_.jsx("option",{value:"Custom",children:r("CUSTOM")})]})})]})}function K3(t){return Aa({attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M9.383 3.076A1 1 0 0110 4v12a1 1 0 01-1.707.707L4.586 13H2a1 1 0 01-1-1V8a1 1 0 011-1h2.586l3.707-3.707a1 1 0 011.09-.217zM12.293 7.293a1 1 0 011.414 0L15 8.586l1.293-1.293a1 1 0 111.414 1.414L16.414 10l1.293 1.293a1 1 0 01-1.414 1.414L15 11.414l-1.293 1.293a1 1 0 01-1.414-1.414L13.586 10l-1.293-1.293a1 1 0 010-1.414z",clipRule:"evenodd"},child:[]}]})(t)}function J3(t){return Aa({attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M9.383 3.076A1 1 0 0110 4v12a1 1 0 01-1.707.707L4.586 13H2a1 1 0 01-1-1V8a1 1 0 011-1h2.586l3.707-3.707a1 1 0 011.09-.217zM14.657 2.929a1 1 0 011.414 0A9.972 9.972 0 0119 10a9.972 9.972 0 01-2.929 7.071 1 1 0 01-1.414-1.414A7.971 7.971 0 0017 10c0-2.21-.894-4.208-2.343-5.657a1 1 0 010-1.414zm-2.829 2.828a1 1 0 011.415 0A5.983 5.983 0 0115 10a5.984 5.984 0 01-1.757 4.243 1 1 0 01-1.415-1.415A3.984 3.984 0 0013 10a3.983 3.983 0 00-1.172-2.828 1 1 0 010-1.415z",clipRule:"evenodd"},child:[]}]})(t)}const X3=t=>{const[e,n]=k.useState({}),[r,a]=k.useState(!0),[s,l]=k.useState(null),u=["fajr","dhuhr","asr","maghrib","isha","jumuah"],c=async()=>{a(!0),l(null);try{const{data:h,error:d}=await ft.from("adhan_audio").select("fajr, dhuhr, asr, maghrib, isha, jumuah").eq("mosque_id",t||"982842840").maybeSingle();if(d&&d.code!=="PGRST116")throw new Error(d.message||"Failed to fetch audio sources");const g={};h&&u.forEach(y=>{const m=h[y];if(m&&typeof m=="string"){const x=m.split("/").pop()||`${y}.mp3`;g[y]={src:m,fileName:x,type:"upload",media:"audio"}}}),n(g)}catch(h){const d=h instanceof Error?h.message:"Unknown error occurred";l(d),console.error("Fetch adhan audio error:",d)}finally{a(!1)}};return k.useEffect(()=>{if(!t){a(!1);return}a(!0),c();const h=ft.channel("adhan_audio_changes").on("postgres_changes",{event:"*",schema:"public",table:"adhan_audio",filter:`mosque_id=eq.${t}`},()=>{c()}).subscribe();return()=>{ft.removeChannel(h)}},[t]),{audioSources:e,loading:r,error:s}};/*! js-cookie v3.0.5 | MIT */function Fp(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)t[r]=n[r]}return t}var cF={read:function(t){return t[0]==='"'&&(t=t.slice(1,-1)),t.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(t){return encodeURIComponent(t).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function Fv(t,e){function n(a,s,l){if(!(typeof document>"u")){l=Fp({},e,l),typeof l.expires=="number"&&(l.expires=new Date(Date.now()+l.expires*864e5)),l.expires&&(l.expires=l.expires.toUTCString()),a=encodeURIComponent(a).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var u="";for(var c in l)l[c]&&(u+="; "+c,l[c]!==!0&&(u+="="+l[c].split(";")[0]));return document.cookie=a+"="+t.write(s,a)+u}}function r(a){if(!(typeof document>"u"||arguments.length&&!a)){for(var s=document.cookie?document.cookie.split("; "):[],l={},u=0;u<s.length;u++){var c=s[u].split("="),h=c.slice(1).join("=");try{var d=decodeURIComponent(c[0]);if(l[d]=t.read(h,d),a===d)break}catch{}}return a?l[a]:l}}return Object.create({set:n,get:r,remove:function(a,s){n(a,"",Fp({},s,{expires:-1}))},withAttributes:function(a){return Fv(this.converter,Fp({},this.attributes,a))},withConverter:function(a){return Fv(Fp({},this.converter,a),this.attributes)}},{attributes:{value:Object.freeze(e)},converter:{value:Object.freeze(t)}})}var Dm=Fv(cF,{path:"/"});const Ux=t=>{const e=new Date,[n,r]=t.split(":").map(Number),a=new Date(e.getFullYear(),e.getMonth(),e.getDate(),n,r),s=(e.getTime()-a.getTime())/1e3;return s>=0&&s<=1},Bx=t=>{const e=new Date,n=t.iqamah||t.adhan,[r,a]=n.split(":").map(Number),l=(new Date(e.getFullYear(),e.getMonth(),e.getDate(),r,a).getTime()-e.getTime())/1e3;if(l<=0)return"Now";const u=Math.floor(l/60),c=Math.floor(l%60);return`${u}m ${c}s`},fF=({prayerTimesColor:t})=>{const{language:e,prayerTimesWithSunrise:n,extraInfo:r,org_nr:a,nextHijriDay:s,hijriMonthNames:l}=Ii(),{t:u}=kr(),{audioSources:c,loading:h,error:d}=X3(a),[g,y]=k.useState(null),[m,x]=k.useState(!1),[E,A]=k.useState(null),[N,O]=k.useState(""),[T,D]=k.useState([]),F=k.useRef(null),[Q,P]=k.useState(null),[$,B]=k.useState(!1),[ne,I]=k.useState(()=>{const he={},U=Dm.get("volumeStates"),j=U?JSON.parse(U):{};return n.forEach((Y,K)=>{he[K]=j[K]!==void 0?j[K]:!1}),he});k.useEffect(()=>{Dm.set("volumeStates",JSON.stringify(ne),{expires:365})},[ne]);const z=/iphone|ipad|ipod/i.test(window.navigator.userAgent),J=()=>window.matchMedia("(display-mode: standalone)").matches||window.navigator.standalone;k.useEffect(()=>{z&&!J()&&B(!0)},[]),k.useEffect(()=>{if(z&&!J()){console.log("Skip notification request — iPhone must add to Home Screen first");return}Notification.permission==="default"&&Notification.requestPermission()},[]),k.useEffect(()=>{const he=new Date,U=new Date(he.getFullYear(),he.getMonth(),he.getDate()+1,0,0,0).getTime()-he.getTime(),j=setTimeout(()=>{D([]),console.log("Reset triggered prayers at midnight")},U);return()=>clearTimeout(j)},[]),k.useEffect(()=>{if(!m||!E)return;const he=setInterval(()=>{const U=Bx(E);O(U),U==="Now"&&(x(!1),A(null),clearInterval(he))},1e3);return()=>clearInterval(he)},[m,E]),k.useEffect(()=>{if(h||d||!n)return;const he=setInterval(()=>{n.forEach((U,j)=>{const Y=U.name.toLowerCase();if(U.name!=="Fajr end"&&!ne[j]&&Ux(U.adhan)&&Q!==U.name&&!T.includes(U.name)){const K=c[Y];console.log(`Attempting to play ${Y} audio:`,{audioSource:K==null?void 0:K.src}),K!=null&&K.src?(F.current&&(F.current.pause(),F.current.currentTime=0),F.current=new Audio(K.src),F.current.play().catch(ie=>console.error(`Error playing ${Y} audio:`,ie)),y(Y),P(U.name),F.current.onended=()=>{y(null),P(null),F.current=null}):console.warn(`No audio source for ${Y}`),D(ie=>[...ie,U.name])}})},1e3);return()=>clearInterval(he)},[n,c,ne,Q,h,d,T]),k.useEffect(()=>{if(h||d||!n)return;const he=setInterval(()=>{n.forEach(U=>{U.name!=="Fajr end"&&Ux(U.adhan)&&!T.includes(U.name)&&(Notification.permission==="granted"&&(console.log(`Triggering notification for prayer: ${U.name}`),new Notification(`${u(U.name)} Iqamah Time ${U.iqamah||U.adhan} Arrive On Time`)),x(!0),A(U),O(Bx(U)),D(j=>[...j,U.name]))})},1e3);return()=>clearInterval(he)},[n,h,d,T,u]);const ae=()=>{F.current&&(F.current.pause(),F.current.currentTime=0,F.current=null,y(null),P(null))},me=he=>{I(U=>({...U,[he]:!U[he]}))},Z=()=>{x(!1),A(null)};function ce(he){return he?he.startsWith("linear-gradient")||he.startsWith("radial-gradient")?{backgroundImage:he,color:t.text}:{backgroundColor:he,color:t.text}:{}}const oe=ce(t.bg),ge=e==="ar";return _.jsxs("div",{className:"w-full mx-auto font-DM py-2 sm:py-4",dir:ge?"rtl":"ltr",children:[h&&_.jsx("div",{className:"p-4 text-center",children:"Loading..."}),d&&_.jsx("div",{className:"p-4 text-center text-red-600",children:d}),!h&&!d&&_.jsxs(_.Fragment,{children:[_.jsxs("div",{className:"flex justify-between text-sm sm:text-base items-center py-1 px-4",children:[_.jsx("div",{className:`${a?"w-[40%]":"w-1/2"}`}),_.jsx("div",{className:`${a?"w-1/5":"w-full"} text-center font-medium`,children:u("ADHAN")}),a&&_.jsx("div",{className:"w-1/5 text-center font-medium",children:u("JAMAAT")}),a&&_.jsxs("div",{className:"w-1/5 text-center font-medium",children:[_.jsx("span",{className:"block sm:hidden",children:u("TMRW")}),_.jsx("span",{className:"hidden sm:block",children:u("TOMORROW")})]})]}),_.jsx("div",{className:"p-[1px] rounded-lg bg-gradient-to-br from-white to-[#807E7E57]",children:_.jsxs("div",{className:"py-2 sm:px-4 rounded-lg backdrop-blur-md",style:oe,children:[n==null?void 0:n.map((he,U)=>_.jsxs(yn.Fragment,{children:[_.jsxs("div",{className:"flex items-center justify-between px-3 py-2",children:[_.jsxs("div",{className:`${a?"w-[40%]":"w-1/2"} flex items-center justify-between`,children:[_.jsx("span",{className:"sm:text-lg font-semibold",children:he.name==="Fajr end"?_.jsx(dd,{color:"orange",size:28}):u(he.name.toUpperCase())}),he.name!=="Fajr end"&&_.jsxs("div",{className:"flex items-center",children:[g===he.name.toLowerCase()&&_.jsx("button",{type:"button",className:"mr-2 w-6 h-6 bg-red-500 rounded-full focus:outline-none",onClick:ae}),_.jsx("button",{type:"button",className:"ml-2 focus:outline-none","aria-label":ne[U]?"Mute":"Unmute",onClick:()=>me(U),children:ne[U]?_.jsx(K3,{}):_.jsx(J3,{})})]})]}),_.jsx("div",{className:`${a?"w-1/5":"w-full"} sm:text-lg text-center font-semibold`,children:he.adhan}),a&&_.jsx("div",{className:"w-1/5 text-center sm:text-lg font-semibold",children:he.iqamah}),a&&_.jsx("div",{className:"w-1/5 text-center sm:text-lg font-semibold",children:he.tomorrow})]}),U===4&&_.jsx("div",{className:`text-sm font-semibold p-3 ${ge?"text-right":""}`,children:s?Mo({hijriDayObj:s,language:e,t:u,hijriMonthNames:l}):" "})]},U)),a&&_.jsxs(_.Fragment,{children:[_.jsx("div",{className:"border-b py-1 sm:py-2"}),_.jsxs("div",{className:"flex flex-col gap-4 items-center justify- shadow- rounded- px-3 py-4",children:[_.jsxs("div",{className:"flex w-full",children:[_.jsx("div",{className:"w-1/4 md:w-2/5"}),[1,2,3].map(he=>_.jsxs("div",{className:"w-1/4 md:w-1/5 text-center text-sm sm:text-base ",children:[u("JAMAAT")," ",he]},he))]}),r.filter(he=>he.label==="Eid"?Array.isArray(he.time)&&he.time.some(U=>U&&U.trim()!==""):!0).map(he=>_.jsxs("div",{className:"flex w-full",children:[_.jsx("div",{className:"w-1/4 md:w-2/5 md:text-lg font-semibold",children:u(he==null?void 0:he.label.toUpperCase())}),Array.isArray(he.time)?[0,1,2].map(U=>_.jsx("div",{className:"w-1/4 md:w-1/5 text-center text-lg font-semibold ",children:he.time[U]},U)):_.jsxs(_.Fragment,{children:[_.jsx("div",{className:"w-1/4 md:w-1/5 text-center text-lg font-semibold ",children:he.time}),_.jsx("div",{className:"w-1/4 md:w-1/5"}),_.jsx("div",{className:"w-1/4 md:w-1/5"})]})]},he==null?void 0:he.label))]})]})]})})]}),m&&E&&_.jsxs("div",{className:"fixed bottom-4 right-4 text-black text-lg bg-white p-4 rounded shadow-lg z-50",children:[_.jsxs("p",{children:[u(E.name)," Iqamah Time Within: ",N]}),_.jsx("button",{className:"mt-2 bg-blue-500 text-white px-2 py-1 rounded",onClick:Z,children:"Close"})]}),$&&_.jsxs("div",{className:"fixed bottom-5 left-1/2 -translate-x-1/2 bg-white shadow-xl border p-3 rounded-lg text-center z-50 w-[90%] max-w-[400px]",children:[_.jsx("p",{className:"font-semibold mb-2",children:"To receive Adhan Notifications"}),_.jsxs("p",{className:"text-sm mb-2",children:["Please ",_.jsx("b",{children:"add this app to your Home Screen"}),"."]}),_.jsxs("p",{className:"text-xs",children:["Tap ",_.jsx("b",{children:"Share → Add to Home Screen"})]}),_.jsx("button",{className:"mt-3 px-3 py-1 text-sm rounded bg-blue-600 text-white",onClick:()=>B(!1),children:"OK"})]})]})},hF=()=>{const t=()=>new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!1}),[e,n]=k.useState(t());return k.useEffect(()=>{const r=setInterval(()=>{n(t())},1e3);return()=>clearInterval(r)},[]),_.jsx("div",{className:"w-full flex justify-center font-bold text-4xl mt-6 sm:mt-4",children:e})},$x=t=>{const e=new Date,[n,r]=t.split(":").map(Number),a=new Date(e.getFullYear(),e.getMonth(),e.getDate(),n,r),s=(e.getTime()-a.getTime())/1e3;return s>=0&&s<=1},zx=t=>{const e=new Date,n=t.iqamah||t.adhan,[r,a]=n.split(":").map(Number),l=(new Date(e.getFullYear(),e.getMonth(),e.getDate(),r,a).getTime()-e.getTime())/1e3;if(l<=0)return"Now";const u=Math.floor(l/60),c=Math.floor(l%60);return`${u}m ${c}s`},dF=({prayerTimesColor:t})=>{const{t:e}=kr(),{language:n,prayerTimesWithSunrise:r,extraInfo:a,org_nr:s,nextHijriDay:l,hijriMonthNames:u}=Ii(),c=n==="ar",{audioSources:h,loading:d,error:g}=X3(s),[y,m]=k.useState(null),[x,E]=k.useState(!1),[A,N]=k.useState(null),[O,T]=k.useState(""),[D,F]=k.useState([]),Q=k.useRef(null),[P,$]=k.useState(null),[B,ne]=k.useState(!1),[I,z]=k.useState(()=>{const he={},U=Dm.get("volumeStates"),j=U?JSON.parse(U):{};return r.forEach((Y,K)=>{he[K]=j[K]!==void 0?j[K]:!1}),he});k.useEffect(()=>{Dm.set("volumeStates",JSON.stringify(I),{expires:365})},[I]);const J=/iphone|ipad|ipod/i.test(window.navigator.userAgent),ae=()=>window.matchMedia("(display-mode: standalone)").matches||window.navigator.standalone;k.useEffect(()=>{J&&!ae()&&ne(!0)},[]),k.useEffect(()=>{if(J&&!ae()){console.log("Skip notification request — iPhone must add to Home Screen first");return}Notification.permission==="default"&&Notification.requestPermission()},[]),k.useEffect(()=>{const he=new Date,U=new Date(he.getFullYear(),he.getMonth(),he.getDate()+1,0,0,0).getTime()-he.getTime(),j=setTimeout(()=>{F([]),console.log("Reset triggered prayers at midnight")},U);return()=>clearTimeout(j)},[]),k.useEffect(()=>{if(!x||!A)return;const he=setInterval(()=>{const U=zx(A);T(U),U==="Now"&&(E(!1),N(null),clearInterval(he))},1e3);return()=>clearInterval(he)},[x,A]),k.useEffect(()=>{if(d||g||!r)return;const he=setInterval(()=>{r.forEach((U,j)=>{const Y=U.name.toLowerCase();if(U.name!=="Fajr end"&&!I[j]&&$x(U.adhan)&&P!==U.name&&!D.includes(U.name)){const K=h[Y];console.log(`Attempting to play ${Y} audio:`,{audioSource:K==null?void 0:K.src}),K!=null&&K.src?(Q.current&&(Q.current.pause(),Q.current.currentTime=0,console.log(`Stopped previous audio for ${P}`)),Q.current=new Audio(K.src),Q.current.play().then(()=>{console.log(`Playing ${Y} audio`),m(Y),$(U.name),F(ie=>[...ie,U.name])}).catch(ie=>console.error(`Error playing ${Y} audio:`,ie)),Q.current.onended=()=>{console.log(`Audio ended for ${U.name}`),m(null),$(null),Q.current=null}):(console.warn(`No audio source for ${Y}`),F(ie=>[...ie,U.name]))}})},1e3);return()=>clearInterval(he)},[r,h,I,P,d,g,D]),k.useEffect(()=>{if(d||g||!r)return;const he=setInterval(()=>{r.forEach(U=>{U.name!=="Fajr end"&&$x(U.adhan)&&!D.includes(U.name)&&(Notification.permission==="granted"&&new Notification(`${e(U.name)} Iqamah Time ${U.iqamah||U.adhan} Arrive On Time`),E(!0),N(U),T(zx(U)),F(j=>[...j,U.name]))})},1e3);return()=>clearInterval(he)},[r,d,g,D,e]);const me=()=>{Q.current&&(Q.current.pause(),Q.current.currentTime=0,Q.current=null,m(null),$(null),console.log("Audio stopped by user"))},Z=he=>{console.log(`Toggling volume for prayer index ${he}: ${!I[he]}`),z(U=>({...U,[he]:!U[he]}))},ce=()=>{E(!1),N(null),console.log("Popup closed by user")};function oe(he){return he?he.startsWith("linear-gradient")||he.startsWith("radial-gradient")?{backgroundImage:he,color:t.text}:{backgroundColor:he,color:t.text}:{}}const ge=oe(t.bg);return _.jsxs("div",{className:"min-w-[300px] mx-auto font-DM",style:{direction:c?"rtl":"ltr"},children:[d&&_.jsx("div",{className:"p-4 text-center",children:"Loading..."}),g&&_.jsx("div",{className:"p-4 text-center text-red-600",children:g}),!d&&!g&&r&&_.jsxs(_.Fragment,{children:[_.jsxs("div",{className:"flex justify-between items-center px-2 py-2",children:[_.jsx("div",{className:"w-[35%] items-center justify-between"}),_.jsx("div",{className:`${s?"w-1/5":"w-full"} text-center font-medium`,children:e("ADHAN")}),s&&_.jsx("div",{className:"w-1/5 text-center font-medium",children:e("JAMAAT")}),s&&_.jsx("div",{className:"w-1/5 text-center font-medium",children:e("TMRW")})]}),r.map((he,U)=>{var j;return _.jsxs(yn.Fragment,{children:[_.jsxs("div",{className:"flex items-center justify-between border shadow-md rounded-xl px-3 py-4 mb-2 backdrop-blur-md",style:ge,children:[_.jsxs("div",{className:"w-[35%] flex items-center justify-between",children:[_.jsx("span",{className:"md:text-lg font-medium",children:he.name==="Fajr end"?_.jsx(dd,{color:"orange",size:28}):e(he.name.toUpperCase())}),he.name!=="Fajr end"&&_.jsxs("div",{className:"flex items-center",children:[y===he.name.toLowerCase()&&_.jsx("button",{type:"button",className:"mr-2 w-6 h-6 bg-red-500 rounded-full focus:outline-none",onClick:me}),_.jsx("button",{type:"button",className:"focus:outline-none","aria-label":I[U]?"Mute":"Unmute",onClick:()=>Z(U),children:I[U]?_.jsx(K3,{}):_.jsx(J3,{})})]})]}),_.jsx("div",{className:`${s?"w-1/5":"w-full"} text-center md:text-lg font-medium`,children:he.name==="Sunrise"?(j=a[1])==null?void 0:j.time:he.adhan}),s&&_.jsx("div",{className:"w-1/5 text-center md:text-lg font-medium",children:he.iqamah}),s&&_.jsx("div",{className:"w-1/5 text-center md:text-lg font-medium",children:he.tomorrow})]}),U===4&&_.jsx("div",{className:`m-2 text-sm font-medium ${c?"text-right":"text-left"}`,children:l&&u.length>0?Mo({hijriDayObj:l,language:n,t:e,hijriMonthNames:u}):" "})]},U)}),s&&_.jsxs("div",{className:"flex flex-col gap-4 border shadow-md rounded-xl px-3 py-4 mt-10 backdrop-blur-md",style:ge,children:[_.jsxs("div",{className:"flex w-full",children:[_.jsx("div",{className:`w-1/4 md:w-2/5 ${c?"text-right":"text-left"}`}),[1,2,3].map(he=>_.jsxs("div",{className:"w-1/4 md:w-1/5 text-center text-sm md:text-base",children:[e("JAMAAT")," ",he]},he))]}),a.filter(he=>he.label==="Eid"?Array.isArray(he.time)&&he.time.some(U=>U&&U.trim()!==""):!0).map(he=>_.jsxs("div",{className:"flex w-full",children:[_.jsx("div",{className:`w-1/4 md:w-2/5 md:text-lg font-medium ${c?"text-right":"text-left"}`,children:e(he.label.toUpperCase())}),Array.isArray(he.time)?[0,1,2].map(U=>_.jsx("div",{className:"w-1/4 md:w-1/5 text-center text-lg font-medium",children:he.time[U]},U)):_.jsxs(_.Fragment,{children:[_.jsx("div",{className:"w-1/4 md:w-1/5 text-center text-lg font-medium",children:he.time}),_.jsx("div",{className:"w-1/4 md:w-1/5 text-lg font-medium"}),_.jsx("div",{className:"w-1/4 md:w-1/5 text-lg font-medium"})]})]},he.label))]})]}),x&&A&&_.jsxs("div",{className:"fixed bottom-4 right-4 text-black text-lg bg-white p-4 rounded shadow-lg z-50",children:[_.jsxs("p",{children:[e(A.name)," Iqamah Time Within: ",O]}),_.jsx("button",{className:"mt-2 bg-blue-500 text-white px-2 py-1 rounded",onClick:ce,children:"Close"})]}),B&&_.jsxs("div",{className:"fixed bottom-5 left-1/2 -translate-x-1/2 bg-white shadow-xl border p-3 rounded-lg text-center z-50 w-[90%] max-w-[400px]",children:[_.jsx("p",{className:"font-semibold mb-2",children:"To receive Adhan Notifications"}),_.jsxs("p",{className:"text-sm mb-2",children:["Please ",_.jsx("b",{children:"add this app to your Home Screen"}),"."]}),_.jsxs("p",{className:"text-xs",children:["Tap ",_.jsx("b",{children:"Share → Add to Home Screen"})]}),_.jsx("button",{className:"mt-3 px-3 py-1 text-sm rounded bg-blue-600 text-white",onClick:()=>ne(!1),children:"OK"})]})]})},pF={7:{container:"font-DM py-10",item:"bg-[#255F38] p-3 rounded-md min-w-[200px] text-left flex-col justify-center"},8:{container:"font-montserrat py-4 sm:py-6 w-full",item:"bg-[#F0BB78] p-3 rounded-md text-left min-w-[200px] text-xs font-medium transition",heading:"text-xl font-bold mb-2",subheading:"text-xs sm:text-sm"},9:{container:"font-onest py-4 sm:py-6 w-full hover:cursor-pointer",item:"bg-[#FEF9E1]/10 border border-white p-3 min-w-[200px] rounded-md text-xs text-white hover:bg-[#581a1a] transition",heading:"text-xl font-bold mb-2",subheading:"text-xs sm:text-sm"}},mF=({tn:t=7,prayerTimesColor:e})=>{const{i18n:n,t:r}=kr(),a=n.language,s=Pi(),{colorScheme:l,events:u,selectedMosque:c,hijriMonthNames:h}=Ii(),d=pF[t],g=l.isDefault,[y,m]=k.useState(new Map);return k.useEffect(()=>{if(!u||u.length===0)return;const x=u.map(F=>new Date(F.date)),E=new Date(Math.min(...x.map(F=>F.getTime()))),A=new Date(Math.max(...x.map(F=>F.getTime()))),N=new Date(E.getFullYear(),0,1),O=new Date(A.getFullYear(),11,31),T=N.toLocaleDateString("en-CA"),D=O.toLocaleDateString("en-CA");eg(T,D).then(F=>{m(F)}).catch(F=>{console.error("Failed to fetch Hijri dates for events:",F)})},[u]),_.jsx("div",{className:d.container,onClick:()=>s(`/${(c==null?void 0:c.value)||982842840}/events`),children:_.jsxs(_.Fragment,{children:[_.jsxs("div",{className:"flex justify-between items-center mb-3",children:[_.jsx("h2",{className:"text-sm sm:text-base font-semibold sm:font-bold",children:r("EVENTS & CALENDAR").toUpperCase()}),_.jsx(Vm,{className:"text-xs font-medium hover:underline",to:`/${(c==null?void 0:c.value)||982842840}/events`,children:r("SEE ALL")})]}),_.jsx("div",{className:"w-full h-24 rounded-md overflow-x-auto flex gap-4 [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden",style:{color:e.text},children:u.length===0?_.jsx("div",{className:`${d.item} flex items-center justify-center h-full w-full`,style:{color:e.text,backgroundColor:g?"":e.bg},children:_.jsx("p",{className:"text-sm sm:text-base font-bold",children:"No events found"})}):u.slice(0,3).map((x,E)=>{const A=new Date(x.date);let N;if(a==="ar"){const O=A.toLocaleDateString("en-CA"),T=y.get(O);N=T?Mo({hijriDayObj:T,language:a,t:r,hijriMonthNames:h}):"Loading..."}else N=A.toLocaleDateString("en-US",{month:"long",day:"numeric"}),N=N.split(" ")[0].toUpperCase()+" "+N.split(" ")[1];return _.jsxs("div",{className:d.item,style:{color:e.text,backgroundColor:g?"":e.bg},children:[_.jsx("p",{className:"text-sm sm:text-base font-extrabold",children:N}),_.jsx("p",{className:"text-[10px] sm:text-xs font-bold mt-1 leading-tight",children:x.description})]},E)})})]})})},gF={7:{container:"font-DM",card:"bg-[#255F38] p-3 rounded-md flex flex-col justify-start h-32 relative",heading:"py-1",subheading:"text-xs sm:text-sm font-light mt-1",button:"absolute bottom-4 right-5 bg-white text-[#27391C] text-[11px] sm:text-xs px-3 py-2 rounded hover:bg-gray-100"},8:{container:"font-montserrat w-full",card:"p-6 rounded-md flex flex-col bg-[#F0BB78] justify- h-38 relative",heading:"py-1",subheading:"text-xs sm:text-sm font-light mt-1",button:"absolute bottom-4 right-5 text-[#FFFFFF] text-[11px] sm:text-xs px-3 py-2 rounded-md hover:bg-gray-"},9:{container:"font-onest hover:cursor-pointer",card:"p-4 bg-[#FEF9E1]/10 flex flex-col rounded-lg border border-white relative",heading:"",subheading:"py-5 text-xs sm:text-sm"}},vF=({tn:t,prayerTimesColor:e})=>{const n=gF[t],{t:r}=kr(),a=Pi(),{colorScheme:s,selectedMosque:l}=Ii(),u=s.isDefault;return _.jsx("div",{className:n.container,onClick:t===9?()=>a(`/${(l==null?void 0:l.value)||982842840}/view-timetable`):void 0,children:_.jsxs("div",{className:n.card,style:{backgroundColor:u?n.card:e.bg,color:e.text},children:[_.jsx("h2",{className:`font-bold sm:text-lg ${n.heading}`,children:r("CREATE YOUR PRAYER TIMETABLE")}),_.jsxs("div",{className:"flex items-center justify-between pr-4",children:[_.jsx("p",{className:n.subheading,children:r("VIEW AND DOWNLOAD YOUR CUSTOM PRAYER TIMETABLE")}),t===9&&_.jsx(v2,{className:"",size:50})]}),t!==9&&_.jsxs(Vm,{className:n.button,to:`/${(l==null?void 0:l.value)||982842840}/view-timetable`,style:{color:u?n.button:e.bg,backgroundColor:e.text},children:[r("VIEW FULL CALENDAR")," >"]})]})})},yF={BackgroundDiv:t=>{const{className:e,style:n}=t;return _.jsx("div",{className:e,style:n})},Header:hg,MasjidSelect:G3,DateSelector:O2,PrayerTable:fF,MasjidPrayerClock:ag,Time:hF,PrayerTableTab:dF,EventCard:mF,CreatePrayerTimetableCard:vF,AnnouncementBar:Z4};function Uv({components:t,componentProps:e={}}){return _.jsx(_.Fragment,{children:t.map((n,r)=>{var s,l;const a=yF[n.type];if(a){const u={...n.props||{},...e};let c={};if((s=n.style)!=null&&s.backgroundImage){const h=n.style.backgroundImage,g="https://yhbphdjhoxovcxfoimdx.supabase.co/storage/v1/object/public"+h,y=n.style.backgroundRepeat,m=n.style.backgroundOpacity;c=h?{backgroundImage:`url(${g})`,backgroundSize:y?"":"cover",backgroundPosition:"center",backgroundRepeat:y?"repeat":"no-repeat",opacity:m||1,filter:y?"":"blur(8px)"}:{}}else(l=n.style)!=null&&l.backgroundColor&&(c={...n.style});return _.jsx("div",{className:n.className||"",style:c,children:_.jsx(a,{...u})},r)}else{if(n.components&&n.gridConfig)return _.jsx("div",{className:`${n.gridConfig.className||""} ${n.className||""}`,style:n.gridConfig.style,children:_.jsx(Uv,{components:n.components,componentProps:e})},r);if(n.components){let u={};return n.type==="Main"&&(u={...n.style}),_.jsx("div",{className:n.className||"",style:u,children:_.jsx(Uv,{components:n.components,componentProps:e})},r)}}return null})})}function bF({config:t,componentProps:e={}}){var l,u;const[n,r]=k.useState("loading"),[a,s]=k.useState(null);return k.useEffect(()=>{const c=setTimeout(()=>{n==="loading"&&(r("error"),s("No Layout configuration Found"))},5e3);return()=>clearTimeout(c)},[n]),k.useEffect(()=>{t!=null&&t.components&&t.gridConfig?(r("ready"),s(null)):t==null&&(r("error"),s("No layout configuration provided"))},[t]),n==="loading"?_.jsx("div",{className:"min-h-screen flex items-center justify-center p-8",children:_.jsxs("div",{className:"text-center max-w-md",children:[_.jsx("div",{className:"w-16 h-16 border-4 border-blue-200 border-t-blue-600 rounded-full animate-spin mx-auto mb-4"}),_.jsx("h2",{className:"text-xl font-semibold text-gray-900 mb-2",children:"Loading layout..."}),_.jsx("p",{className:"text-gray-600",children:"Preparing your dashboard"})]})}):n==="error"?_.jsx("div",{className:"min-h-screen bg-gradient-to-br from-red-50 to-orange-50 flex items-center justify-center p-8",children:_.jsxs("div",{className:"max-w-md w-full bg-white rounded-2xl shadow-2xl border border-red-100 p-8 text-center",children:[_.jsx("div",{className:"w-24 h-24 mx-auto mb-6 bg-red-100 rounded-2xl flex items-center justify-center",children:_.jsx("svg",{className:"w-12 h-12 text-red-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:_.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.732 16.5c-.77.833.192 2.5 1.732 2.5z"})})}),_.jsx("h2",{className:"text-2xl font-bold text-gray-900 mb-4",children:"Layout Failed"}),_.jsx("p",{className:"text-gray-600 mb-6",children:a||"Configuration is invalid or missing"}),_.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 justify-center",children:[_.jsx("button",{onClick:()=>window.location.reload(),className:"px-6 py-3 bg-blue-600 text-white font-medium rounded-xl hover:bg-blue-700",children:"Reload Page"}),_.jsx("button",{onClick:()=>r("loading"),className:"px-6 py-3 bg-gray-100 text-gray-900 font-medium rounded-xl hover:bg-gray-200",children:"Retry"})]})]})}):_.jsx("div",{className:((l=t==null?void 0:t.gridConfig)==null?void 0:l.className)||"",style:(u=t==null?void 0:t.gridConfig)==null?void 0:u.style,children:_.jsx(Uv,{components:(t==null?void 0:t.components)||[],componentProps:e})})}function bd(t){const[e,n]=k.useState(null),[r,a]=k.useState(8),[s,l]=k.useState(!0);return k.useEffect(()=>{let u=null;const c=async()=>{if(l(!0),!t){try{const{data:h,error:d}=await ft.from("layout").select("ud_theme_id, ud_layout").eq("mosque_id",982842840).single();if(d)throw d;n(h.ud_layout),a(h.ud_theme_id),await ec(`${t}-ud`,{layout:h.ud_layout,udThemeId:h.ud_theme_id})}catch(h){console.error("Error loading default layout: ",h),await fa(h,{message:"Error loading default layout",mosqueId:null,context:"default layout fallback"}),Un("error","Could not load default theme!"),n(null)}finally{l(!1)}return}if(!navigator.onLine){const h=await Pf(`${t}-ud`);if(h){n(h.layout),a(h.id),l(!1);return}}try{const{data:h}=await ft.from("layout").select("ud_theme_id, ud_layout").eq("mosque_id",t).single();if(h&&h.ud_layout)n(h.ud_layout),a(h.ud_theme_id),await ec(`${t}-ud`,{layout:h.ud_layout,id:h.ud_theme_id});else{const{data:d,error:g}=await ft.from("mosque_t").select("organisasjonsnummer").eq("organisasjonsnummer",t).single();if(!d||g){Un("warning","Please enter a valid org_nr!");return}if(d){const{data:y,error:m}=await ft.from("layout").select("ud_theme_id, ud_layout").eq("mosque_id",982842840).single();if(m)throw m;const{error:x}=await ft.from("layout").upsert([{mosque_id:t,ud_theme_id:y.ud_theme_id,ud_layout:y==null?void 0:y.ud_layout}],{onConflict:"mosque_id"}).single();if(x)throw x;n(y==null?void 0:y.ud_layout),a(y.ud_theme_id),await ec(`${t}-ud`,{layout:y.ud_layout,id:y.ud_theme_id})}}}catch(h){const d=await Pf(`${t}-ud`);d?(n(d.layout),d.id&&a(d.id)):n(null),console.log("Error fetching config: ",h),await fa(h,{mosqueId:t})}finally{l(!1)}};return c(),u=ft.channel(`ud_layout_changes:${t}`).on("postgres_changes",{event:"*",schema:"public",table:"layout",filter:`mosque_id=eq.${t}`},()=>{c()}).subscribe(),()=>{u==null||u.unsubscribe()}},[t]),{udConfig:e,udThemeId:r,loading:s}}function wF(){const{selectedMosque:t,prayerTimes:e,prayerTimesReady:n}=Ii(),{org_nr:r}=xr(),{udConfig:a,loading:s}=bd(r||(t==null?void 0:t.value)||""),{isDefault:l,textColor:u,prayerTimesColor:c,...h}=a||{},{loading:d}=gd(r||(t==null?void 0:t.value)||"982842840");return k.useEffect(()=>{const g=()=>{Un("success","Back online!")},y=()=>{Un("warning","You are offline!")};return window.addEventListener("online",g),window.addEventListener("offline",y),()=>{window.removeEventListener("online",g),window.removeEventListener("offline",y)}},[]),s||d||!n?_.jsx("div",{className:"h-screen flex items-center justify-center",children:_.jsx(Mf,{})}):_.jsx(bF,{config:h,componentProps:{isDefault:l,textColor:u,prayerTimesColor:c,prayerTimes:e}})}function qx(){const{org_nr:t,loc_id:e}=xr();return _.jsx(n3,{org_nr:t,loc_id:e,children:_.jsx(wF,{})})}const xF=()=>_.jsxs("div",{className:"h-screen flex flex-col items-center justify-center text-center px-4",children:[_.jsx("h1",{className:"text-4xl font-bold text-red-600",children:"404 - Page Not Found"}),_.jsx("p",{className:"mt-4 text-lg text-gray-600",children:"Sorry, the page you are looking for does not exist."})]}),SF=()=>{const{org_nr:t,loc_id:e}=xr();return _.jsx(n3,{org_nr:t,loc_id:e,children:_.jsx(dC,{})})},_F="modulepreload",EF=function(t){return"/"+t},Hx={},w1=function(e,n,r){let a=Promise.resolve();if(n&&n.length>0){let l=function(h){return Promise.all(h.map(d=>Promise.resolve(d).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const u=document.querySelector("meta[property=csp-nonce]"),c=(u==null?void 0:u.nonce)||(u==null?void 0:u.getAttribute("nonce"));a=l(n.map(h=>{if(h=EF(h),h in Hx)return;Hx[h]=!0;const d=h.endsWith(".css"),g=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${g}`))return;const y=document.createElement("link");if(y.rel=d?"stylesheet":_F,d||(y.as="script"),y.crossOrigin="",y.href=h,c&&y.setAttribute("nonce",c),document.head.appendChild(y),d)return new Promise((m,x)=>{y.addEventListener("load",m),y.addEventListener("error",()=>x(new Error(`Unable to preload CSS for ${h}`)))})}))}function s(l){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=l,window.dispatchEvent(u),!u.defaultPrevented)throw l}return a.then(l=>{for(const u of l||[])u.status==="rejected"&&s(u.reason);return e().catch(s)})};var ao=Uint8Array,ns=Uint16Array,j2=Int32Array,R2=new ao([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),D2=new ao([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Vx=new ao([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Z3=function(t,e){for(var n=new ns(31),r=0;r<31;++r)n[r]=e+=1<<t[r-1];for(var a=new j2(n[30]),r=1;r<30;++r)for(var s=n[r];s<n[r+1];++s)a[s]=s-n[r]<<5|r;return{b:n,r:a}},Q3=Z3(R2,2),AF=Q3.b,Bv=Q3.r;AF[28]=258,Bv[258]=28;var NF=Z3(D2,0),Yx=NF.r,$v=new ns(32768);for(var wr=0;wr<32768;++wr){var iu=(wr&43690)>>1|(wr&21845)<<1;iu=(iu&52428)>>2|(iu&13107)<<2,iu=(iu&61680)>>4|(iu&3855)<<4,$v[wr]=((iu&65280)>>8|(iu&255)<<8)>>1}var zh=(function(t,e,n){for(var r=t.length,a=0,s=new ns(e);a<r;++a)t[a]&&++s[t[a]-1];var l=new ns(e);for(a=1;a<e;++a)l[a]=l[a-1]+s[a-1]<<1;var u;if(n){u=new ns(1<<e);var c=15-e;for(a=0;a<r;++a)if(t[a])for(var h=a<<4|t[a],d=e-t[a],g=l[t[a]-1]++<<d,y=g|(1<<d)-1;g<=y;++g)u[$v[g]>>c]=h}else for(u=new ns(r),a=0;a<r;++a)t[a]&&(u[a]=$v[l[t[a]-1]++]>>15-t[a]);return u}),rc=new ao(288);for(var wr=0;wr<144;++wr)rc[wr]=8;for(var wr=144;wr<256;++wr)rc[wr]=9;for(var wr=256;wr<280;++wr)rc[wr]=7;for(var wr=280;wr<288;++wr)rc[wr]=8;var km=new ao(32);for(var wr=0;wr<32;++wr)km[wr]=5;var CF=zh(rc,9,0),TF=zh(km,5,0),e6=function(t){return(t+7)/8|0},LF=function(t,e,n){return(n==null||n>t.length)&&(n=t.length),new ao(t.subarray(e,n))},cl=function(t,e,n){n<<=e&7;var r=e/8|0;t[r]|=n,t[r+1]|=n>>8},jh=function(t,e,n){n<<=e&7;var r=e/8|0;t[r]|=n,t[r+1]|=n>>8,t[r+2]|=n>>16},x1=function(t,e){for(var n=[],r=0;r<t.length;++r)t[r]&&n.push({s:r,f:t[r]});var a=n.length,s=n.slice();if(!a)return{t:n6,l:0};if(a==1){var l=new ao(n[0].s+1);return l[n[0].s]=1,{t:l,l:1}}n.sort(function(F,Q){return F.f-Q.f}),n.push({s:-1,f:25001});var u=n[0],c=n[1],h=0,d=1,g=2;for(n[0]={s:-1,f:u.f+c.f,l:u,r:c};d!=a-1;)u=n[n[h].f<n[g].f?h++:g++],c=n[h!=d&&n[h].f<n[g].f?h++:g++],n[d++]={s:-1,f:u.f+c.f,l:u,r:c};for(var y=s[0].s,r=1;r<a;++r)s[r].s>y&&(y=s[r].s);var m=new ns(y+1),x=zv(n[d-1],m,0);if(x>e){var r=0,E=0,A=x-e,N=1<<A;for(s.sort(function(Q,P){return m[P.s]-m[Q.s]||Q.f-P.f});r<a;++r){var O=s[r].s;if(m[O]>e)E+=N-(1<<x-m[O]),m[O]=e;else break}for(E>>=A;E>0;){var T=s[r].s;m[T]<e?E-=1<<e-m[T]++-1:++r}for(;r>=0&&E;--r){var D=s[r].s;m[D]==e&&(--m[D],++E)}x=e}return{t:new ao(m),l:x}},zv=function(t,e,n){return t.s==-1?Math.max(zv(t.l,e,n+1),zv(t.r,e,n+1)):e[t.s]=n},Gx=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new ns(++e),r=0,a=t[0],s=1,l=function(c){n[r++]=c},u=1;u<=e;++u)if(t[u]==a&&u!=e)++s;else{if(!a&&s>2){for(;s>138;s-=138)l(32754);s>2&&(l(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(l(a),--s;s>6;s-=6)l(8304);s>2&&(l(s-3<<5|8208),s=0)}for(;s--;)l(a);s=1,a=t[u]}return{c:n.subarray(0,r),n:e}},Rh=function(t,e){for(var n=0,r=0;r<e.length;++r)n+=t[r]*e[r];return n},t6=function(t,e,n){var r=n.length,a=e6(e+2);t[a]=r&255,t[a+1]=r>>8,t[a+2]=t[a]^255,t[a+3]=t[a+1]^255;for(var s=0;s<r;++s)t[a+s+4]=n[s];return(a+4+r)*8},Wx=function(t,e,n,r,a,s,l,u,c,h,d){cl(e,d++,n),++a[256];for(var g=x1(a,15),y=g.t,m=g.l,x=x1(s,15),E=x.t,A=x.l,N=Gx(y),O=N.c,T=N.n,D=Gx(E),F=D.c,Q=D.n,P=new ns(19),$=0;$<O.length;++$)++P[O[$]&31];for(var $=0;$<F.length;++$)++P[F[$]&31];for(var B=x1(P,7),ne=B.t,I=B.l,z=19;z>4&&!ne[Vx[z-1]];--z);var J=h+5<<3,ae=Rh(a,rc)+Rh(s,km)+l,me=Rh(a,y)+Rh(s,E)+l+14+3*z+Rh(P,ne)+2*P[16]+3*P[17]+7*P[18];if(c>=0&&J<=ae&&J<=me)return t6(e,d,t.subarray(c,c+h));var Z,ce,oe,ge;if(cl(e,d,1+(me<ae)),d+=2,me<ae){Z=zh(y,m,0),ce=y,oe=zh(E,A,0),ge=E;var he=zh(ne,I,0);cl(e,d,T-257),cl(e,d+5,Q-1),cl(e,d+10,z-4),d+=14;for(var $=0;$<z;++$)cl(e,d+3*$,ne[Vx[$]]);d+=3*z;for(var U=[O,F],j=0;j<2;++j)for(var Y=U[j],$=0;$<Y.length;++$){var K=Y[$]&31;cl(e,d,he[K]),d+=ne[K],K>15&&(cl(e,d,Y[$]>>5&127),d+=Y[$]>>12)}}else Z=CF,ce=rc,oe=TF,ge=km;for(var $=0;$<u;++$){var ie=r[$];if(ie>255){var K=ie>>18&31;jh(e,d,Z[K+257]),d+=ce[K+257],K>7&&(cl(e,d,ie>>23&31),d+=R2[K]);var V=ie&31;jh(e,d,oe[V]),d+=ge[V],V>3&&(jh(e,d,ie>>5&8191),d+=D2[V])}else jh(e,d,Z[ie]),d+=ce[ie]}return jh(e,d,Z[256]),d+ce[256]},OF=new j2([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),n6=new ao(0),jF=function(t,e,n,r,a,s){var l=s.z||t.length,u=new ao(r+l+5*(1+Math.ceil(l/7e3))+a),c=u.subarray(r,u.length-a),h=s.l,d=(s.r||0)&7;if(e){d&&(c[0]=s.r>>3);for(var g=OF[e-1],y=g>>13,m=g&8191,x=(1<<n)-1,E=s.p||new ns(32768),A=s.h||new ns(x+1),N=Math.ceil(n/3),O=2*N,T=function(Ke){return(t[Ke]^t[Ke+1]<<N^t[Ke+2]<<O)&x},D=new j2(25e3),F=new ns(288),Q=new ns(32),P=0,$=0,B=s.i||0,ne=0,I=s.w||0,z=0;B+2<l;++B){var J=T(B),ae=B&32767,me=A[J];if(E[ae]=me,A[J]=ae,I<=B){var Z=l-B;if((P>7e3||ne>24576)&&(Z>423||!h)){d=Wx(t,c,0,D,F,Q,$,ne,z,B-z,d),ne=P=$=0,z=B;for(var ce=0;ce<286;++ce)F[ce]=0;for(var ce=0;ce<30;++ce)Q[ce]=0}var oe=2,ge=0,he=m,U=ae-me&32767;if(Z>2&&J==T(B-U))for(var j=Math.min(y,Z)-1,Y=Math.min(32767,B),K=Math.min(258,Z);U<=Y&&--he&&ae!=me;){if(t[B+oe]==t[B+oe-U]){for(var ie=0;ie<K&&t[B+ie]==t[B+ie-U];++ie);if(ie>oe){if(oe=ie,ge=U,ie>j)break;for(var V=Math.min(U,ie-2),se=0,ce=0;ce<V;++ce){var be=B-U+ce&32767,xe=E[be],Oe=be-xe&32767;Oe>se&&(se=Oe,me=be)}}}ae=me,me=E[ae],U+=ae-me&32767}if(ge){D[ne++]=268435456|Bv[oe]<<18|Yx[ge];var Me=Bv[oe]&31,Ue=Yx[ge]&31;$+=R2[Me]+D2[Ue],++F[257+Me],++Q[Ue],I=B+oe,++P}else D[ne++]=t[B],++F[t[B]]}}for(B=Math.max(B,I);B<l;++B)D[ne++]=t[B],++F[t[B]];d=Wx(t,c,h,D,F,Q,$,ne,z,B-z,d),h||(s.r=d&7|c[d/8|0]<<3,d-=7,s.h=A,s.p=E,s.i=B,s.w=I)}else{for(var B=s.w||0;B<l+h;B+=65535){var Be=B+65535;Be>=l&&(c[d/8|0]=h,Be=l),d=t6(c,d+1,t.subarray(B,Be))}s.i=l}return LF(u,0,r+e6(d)+a)},r6=function(){var t=1,e=0;return{p:function(n){for(var r=t,a=e,s=n.length|0,l=0;l!=s;){for(var u=Math.min(l+2655,s);l<u;++l)a+=r+=n[l];r=(r&65535)+15*(r>>16),a=(a&65535)+15*(a>>16)}t=r,e=a},d:function(){return t%=65521,e%=65521,(t&255)<<24|(t&65280)<<8|(e&255)<<8|e>>8}}},RF=function(t,e,n,r,a){if(!a&&(a={l:1},e.dictionary)){var s=e.dictionary.subarray(-32768),l=new ao(s.length+t.length);l.set(s),l.set(t,s.length),t=l,a.w=s.length}return jF(t,e.level==null?6:e.level,e.mem==null?a.l?Math.ceil(Math.max(8,Math.min(13,Math.log(t.length)))*1.5):20:12+e.mem,n,r,a)},a6=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8},DF=function(t,e){var n=e.level,r=n==0?0:n<6?1:n==9?3:2;if(t[0]=120,t[1]=r<<6|(e.dictionary&&32),t[1]|=31-(t[0]<<8|t[1])%31,e.dictionary){var a=r6();a.p(e.dictionary),a6(t,2,a.d())}};function qv(t,e){e||(e={});var n=r6();n.p(t);var r=RF(t,e,e.dictionary?6:2,4);return DF(r,e),a6(r,r.length-4,n.d()),r}var kF=typeof TextDecoder<"u"&&new TextDecoder,MF=0;try{kF.decode(n6,{stream:!0}),MF=1}catch{}function Kx(t,e="utf8"){return new TextDecoder(e).decode(t)}const PF=new TextEncoder;function IF(t){return PF.encode(t)}const FF=1024*8,UF=(()=>{const t=new Uint8Array(4),e=new Uint32Array(t.buffer);return!((e[0]=1)&t[0])})(),S1={int8:globalThis.Int8Array,uint8:globalThis.Uint8Array,int16:globalThis.Int16Array,uint16:globalThis.Uint16Array,int32:globalThis.Int32Array,uint32:globalThis.Uint32Array,uint64:globalThis.BigUint64Array,int64:globalThis.BigInt64Array,float32:globalThis.Float32Array,float64:globalThis.Float64Array};class k2{constructor(e=FF,n={}){tr(this,"buffer");tr(this,"byteLength");tr(this,"byteOffset");tr(this,"length");tr(this,"offset");tr(this,"lastWrittenByte");tr(this,"littleEndian");tr(this,"_data");tr(this,"_mark");tr(this,"_marks");let r=!1;typeof e=="number"?e=new ArrayBuffer(e):(r=!0,this.lastWrittenByte=e.byteLength);const a=n.offset?n.offset>>>0:0,s=e.byteLength-a;let l=a;(ArrayBuffer.isView(e)||e instanceof k2)&&(e.byteLength!==e.buffer.byteLength&&(l=e.byteOffset+a),e=e.buffer),r?this.lastWrittenByte=s:this.lastWrittenByte=0,this.buffer=e,this.length=s,this.byteLength=s,this.byteOffset=l,this.offset=0,this.littleEndian=!0,this._data=new DataView(this.buffer,l,s),this._mark=0,this._marks=[]}available(e=1){return this.offset+e<=this.length}isLittleEndian(){return this.littleEndian}setLittleEndian(){return this.littleEndian=!0,this}isBigEndian(){return!this.littleEndian}setBigEndian(){return this.littleEndian=!1,this}skip(e=1){return this.offset+=e,this}back(e=1){return this.offset-=e,this}seek(e){return this.offset=e,this}mark(){return this._mark=this.offset,this}reset(){return this.offset=this._mark,this}pushMark(){return this._marks.push(this.offset),this}popMark(){const e=this._marks.pop();if(e===void 0)throw new Error("Mark stack empty");return this.seek(e),this}rewind(){return this.offset=0,this}ensureAvailable(e=1){if(!this.available(e)){const r=(this.offset+e)*2,a=new Uint8Array(r);a.set(new Uint8Array(this.buffer)),this.buffer=a.buffer,this.length=r,this.byteLength=r,this._data=new DataView(this.buffer)}return this}readBoolean(){return this.readUint8()!==0}readInt8(){return this._data.getInt8(this.offset++)}readUint8(){return this._data.getUint8(this.offset++)}readByte(){return this.readUint8()}readBytes(e=1){return this.readArray(e,"uint8")}readArray(e,n){const r=S1[n].BYTES_PER_ELEMENT*e,a=this.byteOffset+this.offset,s=this.buffer.slice(a,a+r);if(this.littleEndian===UF&&n!=="uint8"&&n!=="int8"){const u=new Uint8Array(this.buffer.slice(a,a+r));u.reverse();const c=new S1[n](u.buffer);return this.offset+=r,c.reverse(),c}const l=new S1[n](s);return this.offset+=r,l}readInt16(){const e=this._data.getInt16(this.offset,this.littleEndian);return this.offset+=2,e}readUint16(){const e=this._data.getUint16(this.offset,this.littleEndian);return this.offset+=2,e}readInt32(){const e=this._data.getInt32(this.offset,this.littleEndian);return this.offset+=4,e}readUint32(){const e=this._data.getUint32(this.offset,this.littleEndian);return this.offset+=4,e}readFloat32(){const e=this._data.getFloat32(this.offset,this.littleEndian);return this.offset+=4,e}readFloat64(){const e=this._data.getFloat64(this.offset,this.littleEndian);return this.offset+=8,e}readBigInt64(){const e=this._data.getBigInt64(this.offset,this.littleEndian);return this.offset+=8,e}readBigUint64(){const e=this._data.getBigUint64(this.offset,this.littleEndian);return this.offset+=8,e}readChar(){return String.fromCharCode(this.readInt8())}readChars(e=1){let n="";for(let r=0;r<e;r++)n+=this.readChar();return n}readUtf8(e=1){return Kx(this.readBytes(e))}decodeText(e=1,n="utf8"){return Kx(this.readBytes(e),n)}writeBoolean(e){return this.writeUint8(e?255:0),this}writeInt8(e){return this.ensureAvailable(1),this._data.setInt8(this.offset++,e),this._updateLastWrittenByte(),this}writeUint8(e){return this.ensureAvailable(1),this._data.setUint8(this.offset++,e),this._updateLastWrittenByte(),this}writeByte(e){return this.writeUint8(e)}writeBytes(e){this.ensureAvailable(e.length);for(let n=0;n<e.length;n++)this._data.setUint8(this.offset++,e[n]);return this._updateLastWrittenByte(),this}writeInt16(e){return this.ensureAvailable(2),this._data.setInt16(this.offset,e,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeUint16(e){return this.ensureAvailable(2),this._data.setUint16(this.offset,e,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeInt32(e){return this.ensureAvailable(4),this._data.setInt32(this.offset,e,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeUint32(e){return this.ensureAvailable(4),this._data.setUint32(this.offset,e,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat32(e){return this.ensureAvailable(4),this._data.setFloat32(this.offset,e,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat64(e){return this.ensureAvailable(8),this._data.setFloat64(this.offset,e,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeBigInt64(e){return this.ensureAvailable(8),this._data.setBigInt64(this.offset,e,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeBigUint64(e){return this.ensureAvailable(8),this._data.setBigUint64(this.offset,e,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeChar(e){return this.writeUint8(e.charCodeAt(0))}writeChars(e){for(let n=0;n<e.length;n++)this.writeUint8(e.charCodeAt(n));return this}writeUtf8(e){return this.writeBytes(IF(e))}toArray(){return new Uint8Array(this.buffer,this.byteOffset,this.lastWrittenByte)}getWrittenByteLength(){return this.lastWrittenByte-this.byteOffset}_updateLastWrittenByte(){this.offset>this.lastWrittenByte&&(this.lastWrittenByte=this.offset)}}function Bf(t){let e=t.length;for(;--e>=0;)t[e]=0}const BF=3,$F=258,i6=29,zF=256,qF=zF+1+i6,s6=30,HF=512,VF=new Array((qF+2)*2);Bf(VF);const YF=new Array(s6*2);Bf(YF);const GF=new Array(HF);Bf(GF);const WF=new Array($F-BF+1);Bf(WF);const KF=new Array(i6);Bf(KF);const JF=new Array(s6);Bf(JF);const XF=(t,e,n,r)=>{let a=t&65535|0,s=t>>>16&65535|0,l=0;for(;n!==0;){l=n>2e3?2e3:n,n-=l;do a=a+e[r++]|0,s=s+a|0;while(--l);a%=65521,s%=65521}return a|s<<16|0};var Hv=XF;const ZF=()=>{let t,e=[];for(var n=0;n<256;n++){t=n;for(var r=0;r<8;r++)t=t&1?3988292384^t>>>1:t>>>1;e[n]=t}return e},QF=new Uint32Array(ZF()),eU=(t,e,n,r)=>{const a=QF,s=r+n;t^=-1;for(let l=r;l<s;l++)t=t>>>8^a[(t^e[l])&255];return t^-1};var No=eU,Vv={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},o6={Z_NO_FLUSH:0,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_DEFLATED:8};const tU=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var nU=function(t){const e=Array.prototype.slice.call(arguments,1);for(;e.length;){const n=e.shift();if(n){if(typeof n!="object")throw new TypeError(n+"must be non-object");for(const r in n)tU(n,r)&&(t[r]=n[r])}}return t},rU=t=>{let e=0;for(let r=0,a=t.length;r<a;r++)e+=t[r].length;const n=new Uint8Array(e);for(let r=0,a=0,s=t.length;r<s;r++){let l=t[r];n.set(l,a),a+=l.length}return n},l6={assign:nU,flattenChunks:rU};let u6=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{u6=!1}const id=new Uint8Array(256);for(let t=0;t<256;t++)id[t]=t>=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;id[254]=id[254]=1;var aU=t=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(t);let e,n,r,a,s,l=t.length,u=0;for(a=0;a<l;a++)n=t.charCodeAt(a),(n&64512)===55296&&a+1<l&&(r=t.charCodeAt(a+1),(r&64512)===56320&&(n=65536+(n-55296<<10)+(r-56320),a++)),u+=n<128?1:n<2048?2:n<65536?3:4;for(e=new Uint8Array(u),s=0,a=0;s<u;a++)n=t.charCodeAt(a),(n&64512)===55296&&a+1<l&&(r=t.charCodeAt(a+1),(r&64512)===56320&&(n=65536+(n-55296<<10)+(r-56320),a++)),n<128?e[s++]=n:n<2048?(e[s++]=192|n>>>6,e[s++]=128|n&63):n<65536?(e[s++]=224|n>>>12,e[s++]=128|n>>>6&63,e[s++]=128|n&63):(e[s++]=240|n>>>18,e[s++]=128|n>>>12&63,e[s++]=128|n>>>6&63,e[s++]=128|n&63);return e};const iU=(t,e)=>{if(e<65534&&t.subarray&&u6)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));let n="";for(let r=0;r<e;r++)n+=String.fromCharCode(t[r]);return n};var sU=(t,e)=>{const n=e||t.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(t.subarray(0,e));let r,a;const s=new Array(n*2);for(a=0,r=0;r<n;){let l=t[r++];if(l<128){s[a++]=l;continue}let u=id[l];if(u>4){s[a++]=65533,r+=u-1;continue}for(l&=u===2?31:u===3?15:7;u>1&&r<n;)l=l<<6|t[r++]&63,u--;if(u>1){s[a++]=65533;continue}l<65536?s[a++]=l:(l-=65536,s[a++]=55296|l>>10&1023,s[a++]=56320|l&1023)}return iU(s,a)},oU=(t,e)=>{e=e||t.length,e>t.length&&(e=t.length);let n=e-1;for(;n>=0&&(t[n]&192)===128;)n--;return n<0||n===0?e:n+id[t[n]]>e?n:e},Yv={string2buf:aU,buf2string:sU,utf8border:oU};function lU(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var uU=lU;const Up=16209,cU=16191;var fU=function(e,n){let r,a,s,l,u,c,h,d,g,y,m,x,E,A,N,O,T,D,F,Q,P,$,B,ne;const I=e.state;r=e.next_in,B=e.input,a=r+(e.avail_in-5),s=e.next_out,ne=e.output,l=s-(n-e.avail_out),u=s+(e.avail_out-257),c=I.dmax,h=I.wsize,d=I.whave,g=I.wnext,y=I.window,m=I.hold,x=I.bits,E=I.lencode,A=I.distcode,N=(1<<I.lenbits)-1,O=(1<<I.distbits)-1;e:do{x<15&&(m+=B[r++]<<x,x+=8,m+=B[r++]<<x,x+=8),T=E[m&N];t:for(;;){if(D=T>>>24,m>>>=D,x-=D,D=T>>>16&255,D===0)ne[s++]=T&65535;else if(D&16){F=T&65535,D&=15,D&&(x<D&&(m+=B[r++]<<x,x+=8),F+=m&(1<<D)-1,m>>>=D,x-=D),x<15&&(m+=B[r++]<<x,x+=8,m+=B[r++]<<x,x+=8),T=A[m&O];n:for(;;){if(D=T>>>24,m>>>=D,x-=D,D=T>>>16&255,D&16){if(Q=T&65535,D&=15,x<D&&(m+=B[r++]<<x,x+=8,x<D&&(m+=B[r++]<<x,x+=8)),Q+=m&(1<<D)-1,Q>c){e.msg="invalid distance too far back",I.mode=Up;break e}if(m>>>=D,x-=D,D=s-l,Q>D){if(D=Q-D,D>d&&I.sane){e.msg="invalid distance too far back",I.mode=Up;break e}if(P=0,$=y,g===0){if(P+=h-D,D<F){F-=D;do ne[s++]=y[P++];while(--D);P=s-Q,$=ne}}else if(g<D){if(P+=h+g-D,D-=g,D<F){F-=D;do ne[s++]=y[P++];while(--D);if(P=0,g<F){D=g,F-=D;do ne[s++]=y[P++];while(--D);P=s-Q,$=ne}}}else if(P+=g-D,D<F){F-=D;do ne[s++]=y[P++];while(--D);P=s-Q,$=ne}for(;F>2;)ne[s++]=$[P++],ne[s++]=$[P++],ne[s++]=$[P++],F-=3;F&&(ne[s++]=$[P++],F>1&&(ne[s++]=$[P++]))}else{P=s-Q;do ne[s++]=ne[P++],ne[s++]=ne[P++],ne[s++]=ne[P++],F-=3;while(F>2);F&&(ne[s++]=ne[P++],F>1&&(ne[s++]=ne[P++]))}}else if((D&64)===0){T=A[(T&65535)+(m&(1<<D)-1)];continue n}else{e.msg="invalid distance code",I.mode=Up;break e}break}}else if((D&64)===0){T=E[(T&65535)+(m&(1<<D)-1)];continue t}else if(D&32){I.mode=cU;break e}else{e.msg="invalid literal/length code",I.mode=Up;break e}break}}while(r<a&&s<u);F=x>>3,r-=F,x-=F<<3,m&=(1<<x)-1,e.next_in=r,e.next_out=s,e.avail_in=r<a?5+(a-r):5-(r-a),e.avail_out=s<u?257+(u-s):257-(s-u),I.hold=m,I.bits=x};const cf=15,Jx=852,Xx=592,Zx=0,_1=1,Qx=2,hU=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),dU=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),pU=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),mU=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),gU=(t,e,n,r,a,s,l,u)=>{const c=u.bits;let h=0,d=0,g=0,y=0,m=0,x=0,E=0,A=0,N=0,O=0,T,D,F,Q,P,$=null,B;const ne=new Uint16Array(cf+1),I=new Uint16Array(cf+1);let z=null,J,ae,me;for(h=0;h<=cf;h++)ne[h]=0;for(d=0;d<r;d++)ne[e[n+d]]++;for(m=c,y=cf;y>=1&&ne[y]===0;y--);if(m>y&&(m=y),y===0)return a[s++]=1<<24|64<<16|0,a[s++]=1<<24|64<<16|0,u.bits=1,0;for(g=1;g<y&&ne[g]===0;g++);for(m<g&&(m=g),A=1,h=1;h<=cf;h++)if(A<<=1,A-=ne[h],A<0)return-1;if(A>0&&(t===Zx||y!==1))return-1;for(I[1]=0,h=1;h<cf;h++)I[h+1]=I[h]+ne[h];for(d=0;d<r;d++)e[n+d]!==0&&(l[I[e[n+d]]++]=d);if(t===Zx?($=z=l,B=20):t===_1?($=hU,z=dU,B=257):($=pU,z=mU,B=0),O=0,d=0,h=g,P=s,x=m,E=0,F=-1,N=1<<m,Q=N-1,t===_1&&N>Jx||t===Qx&&N>Xx)return 1;for(;;){J=h-E,l[d]+1<B?(ae=0,me=l[d]):l[d]>=B?(ae=z[l[d]-B],me=$[l[d]-B]):(ae=96,me=0),T=1<<h-E,D=1<<x,g=D;do D-=T,a[P+(O>>E)+D]=J<<24|ae<<16|me|0;while(D!==0);for(T=1<<h-1;O&T;)T>>=1;if(T!==0?(O&=T-1,O+=T):O=0,d++,--ne[h]===0){if(h===y)break;h=e[n+l[d]]}if(h>m&&(O&Q)!==F){for(E===0&&(E=m),P+=g,x=h-E,A=1<<x;x+E<y&&(A-=ne[x+E],!(A<=0));)x++,A<<=1;if(N+=1<<x,t===_1&&N>Jx||t===Qx&&N>Xx)return 1;F=O&Q,a[F]=m<<24|x<<16|P-s|0}}return O!==0&&(a[P+O]=h-E<<24|64<<16|0),u.bits=m,0};var qh=gU;const vU=0,c6=1,f6=2,{Z_FINISH:eS,Z_BLOCK:yU,Z_TREES:Bp,Z_OK:ac,Z_STREAM_END:bU,Z_NEED_DICT:wU,Z_STREAM_ERROR:Ns,Z_DATA_ERROR:h6,Z_MEM_ERROR:d6,Z_BUF_ERROR:xU,Z_DEFLATED:tS}=o6,dg=16180,nS=16181,rS=16182,aS=16183,iS=16184,sS=16185,oS=16186,lS=16187,uS=16188,cS=16189,Mm=16190,fl=16191,E1=16192,fS=16193,A1=16194,hS=16195,dS=16196,pS=16197,mS=16198,$p=16199,zp=16200,gS=16201,vS=16202,yS=16203,bS=16204,wS=16205,N1=16206,xS=16207,SS=16208,Nr=16209,p6=16210,m6=16211,SU=852,_U=592,EU=15,AU=EU,_S=t=>(t>>>24&255)+(t>>>8&65280)+((t&65280)<<8)+((t&255)<<24);function NU(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const sc=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||e.mode<dg||e.mode>m6?1:0},g6=t=>{if(sc(t))return Ns;const e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=e.wrap&1),e.mode=dg,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(SU),e.distcode=e.distdyn=new Int32Array(_U),e.sane=1,e.back=-1,ac},v6=t=>{if(sc(t))return Ns;const e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,g6(t)},y6=(t,e)=>{let n;if(sc(t))return Ns;const r=t.state;return e<0?(n=0,e=-e):(n=(e>>4)+5,e<48&&(e&=15)),e&&(e<8||e>15)?Ns:(r.window!==null&&r.wbits!==e&&(r.window=null),r.wrap=n,r.wbits=e,v6(t))},b6=(t,e)=>{if(!t)return Ns;const n=new NU;t.state=n,n.strm=t,n.window=null,n.mode=dg;const r=y6(t,e);return r!==ac&&(t.state=null),r},CU=t=>b6(t,AU);let ES=!0,C1,T1;const TU=t=>{if(ES){C1=new Int32Array(512),T1=new Int32Array(32);let e=0;for(;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(qh(c6,t.lens,0,288,C1,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;qh(f6,t.lens,0,32,T1,0,t.work,{bits:5}),ES=!1}t.lencode=C1,t.lenbits=9,t.distcode=T1,t.distbits=5},w6=(t,e,n,r)=>{let a;const s=t.state;return s.window===null&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new Uint8Array(s.wsize)),r>=s.wsize?(s.window.set(e.subarray(n-s.wsize,n),0),s.wnext=0,s.whave=s.wsize):(a=s.wsize-s.wnext,a>r&&(a=r),s.window.set(e.subarray(n-r,n-r+a),s.wnext),r-=a,r?(s.window.set(e.subarray(n-r,n),0),s.wnext=r,s.whave=s.wsize):(s.wnext+=a,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=a))),0},LU=(t,e)=>{let n,r,a,s,l,u,c,h,d,g,y,m,x,E,A=0,N,O,T,D,F,Q,P,$;const B=new Uint8Array(4);let ne,I;const z=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(sc(t)||!t.output||!t.input&&t.avail_in!==0)return Ns;n=t.state,n.mode===fl&&(n.mode=E1),l=t.next_out,a=t.output,c=t.avail_out,s=t.next_in,r=t.input,u=t.avail_in,h=n.hold,d=n.bits,g=u,y=c,$=ac;e:for(;;)switch(n.mode){case dg:if(n.wrap===0){n.mode=E1;break}for(;d<16;){if(u===0)break e;u--,h+=r[s++]<<d,d+=8}if(n.wrap&2&&h===35615){n.wbits===0&&(n.wbits=15),n.check=0,B[0]=h&255,B[1]=h>>>8&255,n.check=No(n.check,B,2,0),h=0,d=0,n.mode=nS;break}if(n.head&&(n.head.done=!1),!(n.wrap&1)||(((h&255)<<8)+(h>>8))%31){t.msg="incorrect header check",n.mode=Nr;break}if((h&15)!==tS){t.msg="unknown compression method",n.mode=Nr;break}if(h>>>=4,d-=4,P=(h&15)+8,n.wbits===0&&(n.wbits=P),P>15||P>n.wbits){t.msg="invalid window size",n.mode=Nr;break}n.dmax=1<<n.wbits,n.flags=0,t.adler=n.check=1,n.mode=h&512?cS:fl,h=0,d=0;break;case nS:for(;d<16;){if(u===0)break e;u--,h+=r[s++]<<d,d+=8}if(n.flags=h,(n.flags&255)!==tS){t.msg="unknown compression method",n.mode=Nr;break}if(n.flags&57344){t.msg="unknown header flags set",n.mode=Nr;break}n.head&&(n.head.text=h>>8&1),n.flags&512&&n.wrap&4&&(B[0]=h&255,B[1]=h>>>8&255,n.check=No(n.check,B,2,0)),h=0,d=0,n.mode=rS;case rS:for(;d<32;){if(u===0)break e;u--,h+=r[s++]<<d,d+=8}n.head&&(n.head.time=h),n.flags&512&&n.wrap&4&&(B[0]=h&255,B[1]=h>>>8&255,B[2]=h>>>16&255,B[3]=h>>>24&255,n.check=No(n.check,B,4,0)),h=0,d=0,n.mode=aS;case aS:for(;d<16;){if(u===0)break e;u--,h+=r[s++]<<d,d+=8}n.head&&(n.head.xflags=h&255,n.head.os=h>>8),n.flags&512&&n.wrap&4&&(B[0]=h&255,B[1]=h>>>8&255,n.check=No(n.check,B,2,0)),h=0,d=0,n.mode=iS;case iS:if(n.flags&1024){for(;d<16;){if(u===0)break e;u--,h+=r[s++]<<d,d+=8}n.length=h,n.head&&(n.head.extra_len=h),n.flags&512&&n.wrap&4&&(B[0]=h&255,B[1]=h>>>8&255,n.check=No(n.check,B,2,0)),h=0,d=0}else n.head&&(n.head.extra=null);n.mode=sS;case sS:if(n.flags&1024&&(m=n.length,m>u&&(m=u),m&&(n.head&&(P=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(r.subarray(s,s+m),P)),n.flags&512&&n.wrap&4&&(n.check=No(n.check,r,m,s)),u-=m,s+=m,n.length-=m),n.length))break e;n.length=0,n.mode=oS;case oS:if(n.flags&2048){if(u===0)break e;m=0;do P=r[s+m++],n.head&&P&&n.length<65536&&(n.head.name+=String.fromCharCode(P));while(P&&m<u);if(n.flags&512&&n.wrap&4&&(n.check=No(n.check,r,m,s)),u-=m,s+=m,P)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=lS;case lS:if(n.flags&4096){if(u===0)break e;m=0;do P=r[s+m++],n.head&&P&&n.length<65536&&(n.head.comment+=String.fromCharCode(P));while(P&&m<u);if(n.flags&512&&n.wrap&4&&(n.check=No(n.check,r,m,s)),u-=m,s+=m,P)break e}else n.head&&(n.head.comment=null);n.mode=uS;case uS:if(n.flags&512){for(;d<16;){if(u===0)break e;u--,h+=r[s++]<<d,d+=8}if(n.wrap&4&&h!==(n.check&65535)){t.msg="header crc mismatch",n.mode=Nr;break}h=0,d=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),t.adler=n.check=0,n.mode=fl;break;case cS:for(;d<32;){if(u===0)break e;u--,h+=r[s++]<<d,d+=8}t.adler=n.check=_S(h),h=0,d=0,n.mode=Mm;case Mm:if(n.havedict===0)return t.next_out=l,t.avail_out=c,t.next_in=s,t.avail_in=u,n.hold=h,n.bits=d,wU;t.adler=n.check=1,n.mode=fl;case fl:if(e===yU||e===Bp)break e;case E1:if(n.last){h>>>=d&7,d-=d&7,n.mode=N1;break}for(;d<3;){if(u===0)break e;u--,h+=r[s++]<<d,d+=8}switch(n.last=h&1,h>>>=1,d-=1,h&3){case 0:n.mode=fS;break;case 1:if(TU(n),n.mode=$p,e===Bp){h>>>=2,d-=2;break e}break;case 2:n.mode=dS;break;case 3:t.msg="invalid block type",n.mode=Nr}h>>>=2,d-=2;break;case fS:for(h>>>=d&7,d-=d&7;d<32;){if(u===0)break e;u--,h+=r[s++]<<d,d+=8}if((h&65535)!==(h>>>16^65535)){t.msg="invalid stored block lengths",n.mode=Nr;break}if(n.length=h&65535,h=0,d=0,n.mode=A1,e===Bp)break e;case A1:n.mode=hS;case hS:if(m=n.length,m){if(m>u&&(m=u),m>c&&(m=c),m===0)break e;a.set(r.subarray(s,s+m),l),u-=m,s+=m,c-=m,l+=m,n.length-=m;break}n.mode=fl;break;case dS:for(;d<14;){if(u===0)break e;u--,h+=r[s++]<<d,d+=8}if(n.nlen=(h&31)+257,h>>>=5,d-=5,n.ndist=(h&31)+1,h>>>=5,d-=5,n.ncode=(h&15)+4,h>>>=4,d-=4,n.nlen>286||n.ndist>30){t.msg="too many length or distance symbols",n.mode=Nr;break}n.have=0,n.mode=pS;case pS:for(;n.have<n.ncode;){for(;d<3;){if(u===0)break e;u--,h+=r[s++]<<d,d+=8}n.lens[z[n.have++]]=h&7,h>>>=3,d-=3}for(;n.have<19;)n.lens[z[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,ne={bits:n.lenbits},$=qh(vU,n.lens,0,19,n.lencode,0,n.work,ne),n.lenbits=ne.bits,$){t.msg="invalid code lengths set",n.mode=Nr;break}n.have=0,n.mode=mS;case mS:for(;n.have<n.nlen+n.ndist;){for(;A=n.lencode[h&(1<<n.lenbits)-1],N=A>>>24,O=A>>>16&255,T=A&65535,!(N<=d);){if(u===0)break e;u--,h+=r[s++]<<d,d+=8}if(T<16)h>>>=N,d-=N,n.lens[n.have++]=T;else{if(T===16){for(I=N+2;d<I;){if(u===0)break e;u--,h+=r[s++]<<d,d+=8}if(h>>>=N,d-=N,n.have===0){t.msg="invalid bit length repeat",n.mode=Nr;break}P=n.lens[n.have-1],m=3+(h&3),h>>>=2,d-=2}else if(T===17){for(I=N+3;d<I;){if(u===0)break e;u--,h+=r[s++]<<d,d+=8}h>>>=N,d-=N,P=0,m=3+(h&7),h>>>=3,d-=3}else{for(I=N+7;d<I;){if(u===0)break e;u--,h+=r[s++]<<d,d+=8}h>>>=N,d-=N,P=0,m=11+(h&127),h>>>=7,d-=7}if(n.have+m>n.nlen+n.ndist){t.msg="invalid bit length repeat",n.mode=Nr;break}for(;m--;)n.lens[n.have++]=P}}if(n.mode===Nr)break;if(n.lens[256]===0){t.msg="invalid code -- missing end-of-block",n.mode=Nr;break}if(n.lenbits=9,ne={bits:n.lenbits},$=qh(c6,n.lens,0,n.nlen,n.lencode,0,n.work,ne),n.lenbits=ne.bits,$){t.msg="invalid literal/lengths set",n.mode=Nr;break}if(n.distbits=6,n.distcode=n.distdyn,ne={bits:n.distbits},$=qh(f6,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,ne),n.distbits=ne.bits,$){t.msg="invalid distances set",n.mode=Nr;break}if(n.mode=$p,e===Bp)break e;case $p:n.mode=zp;case zp:if(u>=6&&c>=258){t.next_out=l,t.avail_out=c,t.next_in=s,t.avail_in=u,n.hold=h,n.bits=d,fU(t,y),l=t.next_out,a=t.output,c=t.avail_out,s=t.next_in,r=t.input,u=t.avail_in,h=n.hold,d=n.bits,n.mode===fl&&(n.back=-1);break}for(n.back=0;A=n.lencode[h&(1<<n.lenbits)-1],N=A>>>24,O=A>>>16&255,T=A&65535,!(N<=d);){if(u===0)break e;u--,h+=r[s++]<<d,d+=8}if(O&&(O&240)===0){for(D=N,F=O,Q=T;A=n.lencode[Q+((h&(1<<D+F)-1)>>D)],N=A>>>24,O=A>>>16&255,T=A&65535,!(D+N<=d);){if(u===0)break e;u--,h+=r[s++]<<d,d+=8}h>>>=D,d-=D,n.back+=D}if(h>>>=N,d-=N,n.back+=N,n.length=T,O===0){n.mode=wS;break}if(O&32){n.back=-1,n.mode=fl;break}if(O&64){t.msg="invalid literal/length code",n.mode=Nr;break}n.extra=O&15,n.mode=gS;case gS:if(n.extra){for(I=n.extra;d<I;){if(u===0)break e;u--,h+=r[s++]<<d,d+=8}n.length+=h&(1<<n.extra)-1,h>>>=n.extra,d-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=vS;case vS:for(;A=n.distcode[h&(1<<n.distbits)-1],N=A>>>24,O=A>>>16&255,T=A&65535,!(N<=d);){if(u===0)break e;u--,h+=r[s++]<<d,d+=8}if((O&240)===0){for(D=N,F=O,Q=T;A=n.distcode[Q+((h&(1<<D+F)-1)>>D)],N=A>>>24,O=A>>>16&255,T=A&65535,!(D+N<=d);){if(u===0)break e;u--,h+=r[s++]<<d,d+=8}h>>>=D,d-=D,n.back+=D}if(h>>>=N,d-=N,n.back+=N,O&64){t.msg="invalid distance code",n.mode=Nr;break}n.offset=T,n.extra=O&15,n.mode=yS;case yS:if(n.extra){for(I=n.extra;d<I;){if(u===0)break e;u--,h+=r[s++]<<d,d+=8}n.offset+=h&(1<<n.extra)-1,h>>>=n.extra,d-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){t.msg="invalid distance too far back",n.mode=Nr;break}n.mode=bS;case bS:if(c===0)break e;if(m=y-c,n.offset>m){if(m=n.offset-m,m>n.whave&&n.sane){t.msg="invalid distance too far back",n.mode=Nr;break}m>n.wnext?(m-=n.wnext,x=n.wsize-m):x=n.wnext-m,m>n.length&&(m=n.length),E=n.window}else E=a,x=l-n.offset,m=n.length;m>c&&(m=c),c-=m,n.length-=m;do a[l++]=E[x++];while(--m);n.length===0&&(n.mode=zp);break;case wS:if(c===0)break e;a[l++]=n.length,c--,n.mode=zp;break;case N1:if(n.wrap){for(;d<32;){if(u===0)break e;u--,h|=r[s++]<<d,d+=8}if(y-=c,t.total_out+=y,n.total+=y,n.wrap&4&&y&&(t.adler=n.check=n.flags?No(n.check,a,y,l-y):Hv(n.check,a,y,l-y)),y=c,n.wrap&4&&(n.flags?h:_S(h))!==n.check){t.msg="incorrect data check",n.mode=Nr;break}h=0,d=0}n.mode=xS;case xS:if(n.wrap&&n.flags){for(;d<32;){if(u===0)break e;u--,h+=r[s++]<<d,d+=8}if(n.wrap&4&&h!==(n.total&4294967295)){t.msg="incorrect length check",n.mode=Nr;break}h=0,d=0}n.mode=SS;case SS:$=bU;break e;case Nr:$=h6;break e;case p6:return d6;case m6:default:return Ns}return t.next_out=l,t.avail_out=c,t.next_in=s,t.avail_in=u,n.hold=h,n.bits=d,(n.wsize||y!==t.avail_out&&n.mode<Nr&&(n.mode<N1||e!==eS))&&w6(t,t.output,t.next_out,y-t.avail_out),g-=t.avail_in,y-=t.avail_out,t.total_in+=g,t.total_out+=y,n.total+=y,n.wrap&4&&y&&(t.adler=n.check=n.flags?No(n.check,a,y,t.next_out-y):Hv(n.check,a,y,t.next_out-y)),t.data_type=n.bits+(n.last?64:0)+(n.mode===fl?128:0)+(n.mode===$p||n.mode===A1?256:0),(g===0&&y===0||e===eS)&&$===ac&&($=xU),$},OU=t=>{if(sc(t))return Ns;let e=t.state;return e.window&&(e.window=null),t.state=null,ac},jU=(t,e)=>{if(sc(t))return Ns;const n=t.state;return(n.wrap&2)===0?Ns:(n.head=e,e.done=!1,ac)},RU=(t,e)=>{const n=e.length;let r,a,s;return sc(t)||(r=t.state,r.wrap!==0&&r.mode!==Mm)?Ns:r.mode===Mm&&(a=1,a=Hv(a,e,n,0),a!==r.check)?h6:(s=w6(t,e,n,n),s?(r.mode=p6,d6):(r.havedict=1,ac))};var DU=v6,kU=y6,MU=g6,PU=CU,IU=b6,FU=LU,UU=OU,BU=jU,$U=RU,zU="pako inflate (from Nodeca project)",pl={inflateReset:DU,inflateReset2:kU,inflateResetKeep:MU,inflateInit:PU,inflateInit2:IU,inflate:FU,inflateEnd:UU,inflateGetHeader:BU,inflateSetDictionary:$U,inflateInfo:zU};function qU(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var HU=qU;const x6=Object.prototype.toString,{Z_NO_FLUSH:VU,Z_FINISH:YU,Z_OK:sd,Z_STREAM_END:L1,Z_NEED_DICT:O1,Z_STREAM_ERROR:GU,Z_DATA_ERROR:AS,Z_MEM_ERROR:WU}=o6;function wd(t){this.options=l6.assign({chunkSize:1024*64,windowBits:15,to:""},t||{});const e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,e.windowBits===0&&(e.windowBits=-15)),e.windowBits>=0&&e.windowBits<16&&!(t&&t.windowBits)&&(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(e.windowBits&15)===0&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new uU,this.strm.avail_out=0;let n=pl.inflateInit2(this.strm,e.windowBits);if(n!==sd)throw new Error(Vv[n]);if(this.header=new HU,pl.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=Yv.string2buf(e.dictionary):x6.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(n=pl.inflateSetDictionary(this.strm,e.dictionary),n!==sd)))throw new Error(Vv[n])}wd.prototype.push=function(t,e){const n=this.strm,r=this.options.chunkSize,a=this.options.dictionary;let s,l,u;if(this.ended)return!1;for(e===~~e?l=e:l=e===!0?YU:VU,x6.call(t)==="[object ArrayBuffer]"?n.input=new Uint8Array(t):n.input=t,n.next_in=0,n.avail_in=n.input.length;;){for(n.avail_out===0&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),s=pl.inflate(n,l),s===O1&&a&&(s=pl.inflateSetDictionary(n,a),s===sd?s=pl.inflate(n,l):s===AS&&(s=O1));n.avail_in>0&&s===L1&&n.state.wrap>0&&t[n.next_in]!==0;)pl.inflateReset(n),s=pl.inflate(n,l);switch(s){case GU:case AS:case O1:case WU:return this.onEnd(s),this.ended=!0,!1}if(u=n.avail_out,n.next_out&&(n.avail_out===0||s===L1))if(this.options.to==="string"){let c=Yv.utf8border(n.output,n.next_out),h=n.next_out-c,d=Yv.buf2string(n.output,c);n.next_out=h,n.avail_out=r-h,h&&n.output.set(n.output.subarray(c,c+h),0),this.onData(d)}else this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out));if(!(s===sd&&u===0)){if(s===L1)return s=pl.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,!0;if(n.avail_in===0)break}}return!0};wd.prototype.onData=function(t){this.chunks.push(t)};wd.prototype.onEnd=function(t){t===sd&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=l6.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function KU(t,e){const n=new wd(e);if(n.push(t),n.err)throw n.msg||Vv[n.err];return n.result}var JU=wd,XU=KU,ZU={Inflate:JU,inflate:XU};const{Inflate:QU,inflate:eB}=ZU;var NS=QU,tB=eB;const S6=[];for(let t=0;t<256;t++){let e=t;for(let n=0;n<8;n++)e&1?e=3988292384^e>>>1:e=e>>>1;S6[t]=e}const CS=4294967295;function nB(t,e,n){let r=t;for(let a=0;a<n;a++)r=S6[(r^e[a])&255]^r>>>8;return r}function rB(t,e){return(nB(CS,t,e)^CS)>>>0}function TS(t,e,n){const r=t.readUint32(),a=rB(new Uint8Array(t.buffer,t.byteOffset+t.offset-e-4,e),e);if(a!==r)throw new Error(`CRC mismatch for chunk ${n}. Expected ${r}, found ${a}`)}function _6(t,e,n){for(let r=0;r<n;r++)e[r]=t[r]}function E6(t,e,n,r){let a=0;for(;a<r;a++)e[a]=t[a];for(;a<n;a++)e[a]=t[a]+e[a-r]&255}function A6(t,e,n,r){let a=0;if(n.length===0)for(;a<r;a++)e[a]=t[a];else for(;a<r;a++)e[a]=t[a]+n[a]&255}function N6(t,e,n,r,a){let s=0;if(n.length===0){for(;s<a;s++)e[s]=t[s];for(;s<r;s++)e[s]=t[s]+(e[s-a]>>1)&255}else{for(;s<a;s++)e[s]=t[s]+(n[s]>>1)&255;for(;s<r;s++)e[s]=t[s]+(e[s-a]+n[s]>>1)&255}}function C6(t,e,n,r,a){let s=0;if(n.length===0){for(;s<a;s++)e[s]=t[s];for(;s<r;s++)e[s]=t[s]+e[s-a]&255}else{for(;s<a;s++)e[s]=t[s]+n[s]&255;for(;s<r;s++)e[s]=t[s]+aB(e[s-a],n[s],n[s-a])&255}}function aB(t,e,n){const r=t+e-n,a=Math.abs(r-t),s=Math.abs(r-e),l=Math.abs(r-n);return a<=s&&a<=l?t:s<=l?e:n}function iB(t,e,n,r,a,s){switch(t){case 0:_6(e,n,a);break;case 1:E6(e,n,a,s);break;case 2:A6(e,n,r,a);break;case 3:N6(e,n,r,a,s);break;case 4:C6(e,n,r,a,s);break;default:throw new Error(`Unsupported filter: ${t}`)}}const sB=new Uint16Array([255]),oB=new Uint8Array(sB.buffer),lB=oB[0]===255;function uB(t){const{data:e,width:n,height:r,channels:a,depth:s}=t,l=[{x:0,y:0,xStep:8,yStep:8},{x:4,y:0,xStep:8,yStep:8},{x:0,y:4,xStep:4,yStep:8},{x:2,y:0,xStep:4,yStep:4},{x:0,y:2,xStep:2,yStep:4},{x:1,y:0,xStep:2,yStep:2},{x:0,y:1,xStep:1,yStep:2}],u=Math.ceil(s/8)*a,c=new Uint8Array(r*n*u);let h=0;for(let d=0;d<7;d++){const g=l[d],y=Math.ceil((n-g.x)/g.xStep),m=Math.ceil((r-g.y)/g.yStep);if(y<=0||m<=0)continue;const x=y*u,E=new Uint8Array(x);for(let A=0;A<m;A++){const N=e[h++],O=e.subarray(h,h+x);h+=x;const T=new Uint8Array(x);iB(N,O,T,E,x,u),E.set(T);for(let D=0;D<y;D++){const F=g.x+D*g.xStep,Q=g.y+A*g.yStep;if(!(F>=n||Q>=r))for(let P=0;P<u;P++)c[(Q*n+F)*u+P]=T[D*u+P]}}}if(s===16){const d=new Uint16Array(c.buffer);if(lB)for(let g=0;g<d.length;g++)d[g]=cB(d[g]);return d}else return c}function cB(t){return(t&255)<<8|t>>8&255}const fB=new Uint16Array([255]),hB=new Uint8Array(fB.buffer),dB=hB[0]===255,pB=new Uint8Array(0);function LS(t){const{data:e,width:n,height:r,channels:a,depth:s}=t,l=Math.ceil(s/8)*a,u=Math.ceil(s/8*a*n),c=new Uint8Array(r*u);let h=pB,d=0,g,y;for(let m=0;m<r;m++){switch(g=e.subarray(d+1,d+1+u),y=c.subarray(m*u,(m+1)*u),e[d]){case 0:_6(g,y,u);break;case 1:E6(g,y,u,l);break;case 2:A6(g,y,h,u);break;case 3:N6(g,y,h,u,l);break;case 4:C6(g,y,h,u,l);break;default:throw new Error(`Unsupported filter: ${e[d]}`)}h=y,d+=u+1}if(s===16){const m=new Uint16Array(c.buffer);if(dB)for(let x=0;x<m.length;x++)m[x]=mB(m[x]);return m}else return c}function mB(t){return(t&255)<<8|t>>8&255}const rm=Uint8Array.of(137,80,78,71,13,10,26,10);function OS(t){if(!gB(t.readBytes(rm.length)))throw new Error("wrong PNG signature")}function gB(t){if(t.length<rm.length)return!1;for(let e=0;e<rm.length;e++)if(t[e]!==rm[e])return!1;return!0}const vB="tEXt",yB=0,T6=new TextDecoder("latin1");function bB(t){if(xB(t),t.length===0||t.length>79)throw new Error("keyword length must be between 1 and 79")}const wB=/^[\u0000-\u00FF]*$/;function xB(t){if(!wB.test(t))throw new Error("invalid latin1 text")}function SB(t,e,n){const r=L6(e);t[r]=_B(e,n-r.length-1)}function L6(t){for(t.mark();t.readByte()!==yB;);const e=t.offset;t.reset();const n=T6.decode(t.readBytes(e-t.offset-1));return t.skip(1),bB(n),n}function _B(t,e){return T6.decode(t.readBytes(e))}const Xi={UNKNOWN:-1,GREYSCALE:0,TRUECOLOUR:2,INDEXED_COLOUR:3,GREYSCALE_ALPHA:4,TRUECOLOUR_ALPHA:6},j1={UNKNOWN:-1,DEFLATE:0},jS={UNKNOWN:-1,ADAPTIVE:0},R1={UNKNOWN:-1,NO_INTERLACE:0,ADAM7:1},qp={NONE:0,BACKGROUND:1,PREVIOUS:2},D1={SOURCE:0,OVER:1};class EB extends k2{constructor(n,r={}){super(n);tr(this,"_checkCrc");tr(this,"_inflator");tr(this,"_png");tr(this,"_apng");tr(this,"_end");tr(this,"_hasPalette");tr(this,"_palette");tr(this,"_hasTransparency");tr(this,"_transparency");tr(this,"_compressionMethod");tr(this,"_filterMethod");tr(this,"_interlaceMethod");tr(this,"_colorType");tr(this,"_isAnimated");tr(this,"_numberOfFrames");tr(this,"_numberOfPlays");tr(this,"_frames");tr(this,"_writingDataChunks");const{checkCrc:a=!1}=r;this._checkCrc=a,this._inflator=new NS,this._png={width:-1,height:-1,channels:-1,data:new Uint8Array(0),depth:1,text:{}},this._apng={width:-1,height:-1,channels:-1,depth:1,numberOfFrames:1,numberOfPlays:0,text:{},frames:[]},this._end=!1,this._hasPalette=!1,this._palette=[],this._hasTransparency=!1,this._transparency=new Uint16Array(0),this._compressionMethod=j1.UNKNOWN,this._filterMethod=jS.UNKNOWN,this._interlaceMethod=R1.UNKNOWN,this._colorType=Xi.UNKNOWN,this._isAnimated=!1,this._numberOfFrames=1,this._numberOfPlays=0,this._frames=[],this._writingDataChunks=!1,this.setBigEndian()}decode(){for(OS(this);!this._end;){const n=this.readUint32(),r=this.readChars(4);this.decodeChunk(n,r)}return this.decodeImage(),this._png}decodeApng(){for(OS(this);!this._end;){const n=this.readUint32(),r=this.readChars(4);this.decodeApngChunk(n,r)}return this.decodeApngImage(),this._apng}decodeChunk(n,r){const a=this.offset;switch(r){case"IHDR":this.decodeIHDR();break;case"PLTE":this.decodePLTE(n);break;case"IDAT":this.decodeIDAT(n);break;case"IEND":this._end=!0;break;case"tRNS":this.decodetRNS(n);break;case"iCCP":this.decodeiCCP(n);break;case vB:SB(this._png.text,this,n);break;case"pHYs":this.decodepHYs();break;default:this.skip(n);break}if(this.offset-a!==n)throw new Error(`Length mismatch while decoding chunk ${r}`);this._checkCrc?TS(this,n+4,r):this.skip(4)}decodeApngChunk(n,r){const a=this.offset;switch(r!=="fdAT"&&r!=="IDAT"&&this._writingDataChunks&&this.pushDataToFrame(),r){case"acTL":this.decodeACTL();break;case"fcTL":this.decodeFCTL();break;case"fdAT":this.decodeFDAT(n);break;default:this.decodeChunk(n,r),this.offset=a+n;break}if(this.offset-a!==n)throw new Error(`Length mismatch while decoding chunk ${r}`);this._checkCrc?TS(this,n+4,r):this.skip(4)}decodeIHDR(){const n=this._png;n.width=this.readUint32(),n.height=this.readUint32(),n.depth=AB(this.readUint8());const r=this.readUint8();this._colorType=r;let a;switch(r){case Xi.GREYSCALE:a=1;break;case Xi.TRUECOLOUR:a=3;break;case Xi.INDEXED_COLOUR:a=1;break;case Xi.GREYSCALE_ALPHA:a=2;break;case Xi.TRUECOLOUR_ALPHA:a=4;break;case Xi.UNKNOWN:default:throw new Error(`Unknown color type: ${r}`)}if(this._png.channels=a,this._compressionMethod=this.readUint8(),this._compressionMethod!==j1.DEFLATE)throw new Error(`Unsupported compression method: ${this._compressionMethod}`);this._filterMethod=this.readUint8(),this._interlaceMethod=this.readUint8()}decodeACTL(){this._numberOfFrames=this.readUint32(),this._numberOfPlays=this.readUint32(),this._isAnimated=!0}decodeFCTL(){const n={sequenceNumber:this.readUint32(),width:this.readUint32(),height:this.readUint32(),xOffset:this.readUint32(),yOffset:this.readUint32(),delayNumber:this.readUint16(),delayDenominator:this.readUint16(),disposeOp:this.readUint8(),blendOp:this.readUint8(),data:new Uint8Array(0)};this._frames.push(n)}decodePLTE(n){if(n%3!==0)throw new RangeError(`PLTE field length must be a multiple of 3. Got ${n}`);const r=n/3;this._hasPalette=!0;const a=[];this._palette=a;for(let s=0;s<r;s++)a.push([this.readUint8(),this.readUint8(),this.readUint8()])}decodeIDAT(n){this._writingDataChunks=!0;const r=n,a=this.offset+this.byteOffset;if(this._inflator.push(new Uint8Array(this.buffer,a,r)),this._inflator.err)throw new Error(`Error while decompressing the data: ${this._inflator.err}`);this.skip(n)}decodeFDAT(n){this._writingDataChunks=!0;let r=n,a=this.offset+this.byteOffset;if(a+=4,r-=4,this._inflator.push(new Uint8Array(this.buffer,a,r)),this._inflator.err)throw new Error(`Error while decompressing the data: ${this._inflator.err}`);this.skip(n)}decodetRNS(n){switch(this._colorType){case Xi.GREYSCALE:case Xi.TRUECOLOUR:{if(n%2!==0)throw new RangeError(`tRNS chunk length must be a multiple of 2. Got ${n}`);if(n/2>this._png.width*this._png.height)throw new Error(`tRNS chunk contains more alpha values than there are pixels (${n/2} vs ${this._png.width*this._png.height})`);this._hasTransparency=!0,this._transparency=new Uint16Array(n/2);for(let r=0;r<n/2;r++)this._transparency[r]=this.readUint16();break}case Xi.INDEXED_COLOUR:{if(n>this._palette.length)throw new Error(`tRNS chunk contains more alpha values than there are palette colors (${n} vs ${this._palette.length})`);let r=0;for(;r<n;r++){const a=this.readByte();this._palette[r].push(a)}for(;r<this._palette.length;r++)this._palette[r].push(255);break}case Xi.UNKNOWN:case Xi.GREYSCALE_ALPHA:case Xi.TRUECOLOUR_ALPHA:default:throw new Error(`tRNS chunk is not supported for color type ${this._colorType}`)}}decodeiCCP(n){const r=L6(this),a=this.readUint8();if(a!==j1.DEFLATE)throw new Error(`Unsupported iCCP compression method: ${a}`);const s=this.readBytes(n-r.length-2);this._png.iccEmbeddedProfile={name:r,profile:tB(s)}}decodepHYs(){const n=this.readUint32(),r=this.readUint32(),a=this.readByte();this._png.resolution={x:n,y:r,unit:a}}decodeApngImage(){this._apng.width=this._png.width,this._apng.height=this._png.height,this._apng.channels=this._png.channels,this._apng.depth=this._png.depth,this._apng.numberOfFrames=this._numberOfFrames,this._apng.numberOfPlays=this._numberOfPlays,this._apng.text=this._png.text,this._apng.resolution=this._png.resolution;for(let n=0;n<this._numberOfFrames;n++){const r={sequenceNumber:this._frames[n].sequenceNumber,delayNumber:this._frames[n].delayNumber,delayDenominator:this._frames[n].delayDenominator,data:this._apng.depth===8?new Uint8Array(this._apng.width*this._apng.height*this._apng.channels):new Uint16Array(this._apng.width*this._apng.height*this._apng.channels)},a=this._frames.at(n);if(a){if(a.data=LS({data:a.data,width:a.width,height:a.height,channels:this._apng.channels,depth:this._apng.depth}),this._hasPalette&&(this._apng.palette=this._palette),this._hasTransparency&&(this._apng.transparency=this._transparency),n===0||a.xOffset===0&&a.yOffset===0&&a.width===this._png.width&&a.height===this._png.height)r.data=a.data;else{const s=this._apng.frames.at(n-1);this.disposeFrame(a,s,r),this.addFrameDataToCanvas(r,a)}this._apng.frames.push(r)}}return this._apng}disposeFrame(n,r,a){switch(n.disposeOp){case qp.NONE:break;case qp.BACKGROUND:for(let s=0;s<this._png.height;s++)for(let l=0;l<this._png.width;l++){const u=(s*n.width+l)*this._png.channels;for(let c=0;c<this._png.channels;c++)a.data[u+c]=0}break;case qp.PREVIOUS:a.data.set(r.data);break;default:throw new Error("Unknown disposeOp")}}addFrameDataToCanvas(n,r){const a=1<<this._png.depth,s=(l,u)=>{const c=((l+r.yOffset)*this._png.width+r.xOffset+u)*this._png.channels,h=(l*r.width+u)*this._png.channels;return{index:c,frameIndex:h}};switch(r.blendOp){case D1.SOURCE:for(let l=0;l<r.height;l++)for(let u=0;u<r.width;u++){const{index:c,frameIndex:h}=s(l,u);for(let d=0;d<this._png.channels;d++)n.data[c+d]=r.data[h+d]}break;case D1.OVER:for(let l=0;l<r.height;l++)for(let u=0;u<r.width;u++){const{index:c,frameIndex:h}=s(l,u);for(let d=0;d<this._png.channels;d++){const g=r.data[h+this._png.channels-1]/a,y=d%(this._png.channels-1)===0?1:r.data[h+d],m=Math.floor(g*y+(1-g)*n.data[c+d]);n.data[c+d]+=m}}break;default:throw new Error("Unknown blendOp")}}decodeImage(){var r;if(this._inflator.err)throw new Error(`Error while decompressing the data: ${this._inflator.err}`);const n=this._isAnimated?((r=this._frames)==null?void 0:r.at(0)).data:this._inflator.result;if(this._filterMethod!==jS.ADAPTIVE)throw new Error(`Filter method ${this._filterMethod} not supported`);if(this._interlaceMethod===R1.NO_INTERLACE)this._png.data=LS({data:n,width:this._png.width,height:this._png.height,channels:this._png.channels,depth:this._png.depth});else if(this._interlaceMethod===R1.ADAM7)this._png.data=uB({data:n,width:this._png.width,height:this._png.height,channels:this._png.channels,depth:this._png.depth});else throw new Error(`Interlace method ${this._interlaceMethod} not supported`);this._hasPalette&&(this._png.palette=this._palette),this._hasTransparency&&(this._png.transparency=this._transparency)}pushDataToFrame(){const n=this._inflator.result,r=this._frames.at(-1);r?r.data=n:this._frames.push({sequenceNumber:0,width:this._png.width,height:this._png.height,xOffset:0,yOffset:0,delayNumber:0,delayDenominator:0,disposeOp:qp.NONE,blendOp:D1.SOURCE,data:n}),this._inflator=new NS,this._writingDataChunks=!1}}function AB(t){if(t!==1&&t!==2&&t!==4&&t!==8&&t!==16)throw new Error(`invalid bit depth: ${t}`);return t}var RS;(function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.METRE=1]="METRE"})(RS||(RS={}));function NB(t,e){return new EB(t,e).decode()}var tn=(function(){return typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:this})();function k1(){tn.console&&typeof tn.console.log=="function"&&tn.console.log.apply(tn.console,arguments)}var hr={log:k1,warn:function(t){tn.console&&(typeof tn.console.warn=="function"?tn.console.warn.apply(tn.console,arguments):k1.call(null,arguments))},error:function(t){tn.console&&(typeof tn.console.error=="function"?tn.console.error.apply(tn.console,arguments):k1(t))}};function M1(t,e,n){var r=new XMLHttpRequest;r.open("GET",t),r.responseType="blob",r.onload=function(){Vu(r.response,e,n)},r.onerror=function(){hr.error("could not download file")},r.send()}function DS(t){var e=new XMLHttpRequest;e.open("HEAD",t,!1);try{e.send()}catch{}return e.status>=200&&e.status<=299}function Hp(t){try{t.dispatchEvent(new MouseEvent("click"))}catch{var e=document.createEvent("MouseEvents");e.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),t.dispatchEvent(e)}}var Vu=tn.saveAs||((typeof window>"u"?"undefined":Rn(window))!=="object"||window!==tn?function(){}:typeof HTMLAnchorElement<"u"&&"download"in HTMLAnchorElement.prototype?function(t,e,n){var r=tn.URL||tn.webkitURL,a=document.createElement("a");e=e||t.name||"download",a.download=e,a.rel="noopener",typeof t=="string"?(a.href=t,a.origin!==location.origin?DS(a.href)?M1(t,e,n):Hp(a,a.target="_blank"):Hp(a)):(a.href=r.createObjectURL(t),setTimeout(function(){r.revokeObjectURL(a.href)},4e4),setTimeout(function(){Hp(a)},0))}:"msSaveOrOpenBlob"in navigator?function(t,e,n){if(e=e||t.name||"download",typeof t=="string")if(DS(t))M1(t,e,n);else{var r=document.createElement("a");r.href=t,r.target="_blank",setTimeout(function(){Hp(r)})}else navigator.msSaveOrOpenBlob((function(a,s){return s===void 0?s={autoBom:!1}:Rn(s)!=="object"&&(hr.warn("Deprecated: Expected third argument to be a object"),s={autoBom:!s}),s.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(a.type)?new Blob(["\uFEFF",a],{type:a.type}):a})(t,n),e)}:function(t,e,n,r){if((r=r||open("","_blank"))&&(r.document.title=r.document.body.innerText="downloading..."),typeof t=="string")return M1(t,e,n);var a=t.type==="application/octet-stream",s=/constructor/i.test(tn.HTMLElement)||tn.safari,l=/CriOS\/[\d]+/.test(navigator.userAgent);if((l||a&&s)&&(typeof FileReader>"u"?"undefined":Rn(FileReader))==="object"){var u=new FileReader;u.onloadend=function(){var d=u.result;d=l?d:d.replace(/^data:[^;]*;/,"data:attachment/file;"),r?r.location.href=d:location=d,r=null},u.readAsDataURL(t)}else{var c=tn.URL||tn.webkitURL,h=c.createObjectURL(t);r?r.location=h:location.href=h,r=null,setTimeout(function(){c.revokeObjectURL(h)},4e4)}});/**
201
- * A class to parse color values
202
- * @author Stoyan Stefanov <sstoo@gmail.com>
203
- * {@link http://www.phpied.com/rgb-color-parser-in-javascript/}
204
- * @license Use it if you like it
205
- */function O6(t){var e;t=t||"",this.ok=!1,t.charAt(0)=="#"&&(t=t.substr(1,6)),t={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",feldspar:"d19275",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslateblue:"8470ff",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",violetred:"d02090",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"}[t=(t=t.replace(/ /g,"")).toLowerCase()]||t;for(var n=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(u){return[parseInt(u[1]),parseInt(u[2]),parseInt(u[3])]}},{re:/^(\w{2})(\w{2})(\w{2})$/,example:["#00ff00","336699"],process:function(u){return[parseInt(u[1],16),parseInt(u[2],16),parseInt(u[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,example:["#fb0","f0f"],process:function(u){return[parseInt(u[1]+u[1],16),parseInt(u[2]+u[2],16),parseInt(u[3]+u[3],16)]}}],r=0;r<n.length;r++){var a=n[r].re,s=n[r].process,l=a.exec(t);l&&(e=s(l),this.r=e[0],this.g=e[1],this.b=e[2],this.ok=!0)}this.r=this.r<0||isNaN(this.r)?0:this.r>255?255:this.r,this.g=this.g<0||isNaN(this.g)?0:this.g>255?255:this.g,this.b=this.b<0||isNaN(this.b)?0:this.b>255?255:this.b,this.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"},this.toHex=function(){var u=this.r.toString(16),c=this.g.toString(16),h=this.b.toString(16);return u.length==1&&(u="0"+u),c.length==1&&(c="0"+c),h.length==1&&(h="0"+h),"#"+u+c+h}}var am=tn.atob.bind(tn),kS=tn.btoa.bind(tn);/**
206
- * @license
207
- * Joseph Myers does not specify a particular license for his work.
208
- *
209
- * Author: Joseph Myers
210
- * Accessed from: http://www.myersdaily.org/joseph/javascript/md5.js
211
- *
212
- * Modified by: Owen Leong
213
- */function P1(t,e){var n=t[0],r=t[1],a=t[2],s=t[3];n=ei(n,r,a,s,e[0],7,-680876936),s=ei(s,n,r,a,e[1],12,-389564586),a=ei(a,s,n,r,e[2],17,606105819),r=ei(r,a,s,n,e[3],22,-1044525330),n=ei(n,r,a,s,e[4],7,-176418897),s=ei(s,n,r,a,e[5],12,1200080426),a=ei(a,s,n,r,e[6],17,-1473231341),r=ei(r,a,s,n,e[7],22,-45705983),n=ei(n,r,a,s,e[8],7,1770035416),s=ei(s,n,r,a,e[9],12,-1958414417),a=ei(a,s,n,r,e[10],17,-42063),r=ei(r,a,s,n,e[11],22,-1990404162),n=ei(n,r,a,s,e[12],7,1804603682),s=ei(s,n,r,a,e[13],12,-40341101),a=ei(a,s,n,r,e[14],17,-1502002290),n=ti(n,r=ei(r,a,s,n,e[15],22,1236535329),a,s,e[1],5,-165796510),s=ti(s,n,r,a,e[6],9,-1069501632),a=ti(a,s,n,r,e[11],14,643717713),r=ti(r,a,s,n,e[0],20,-373897302),n=ti(n,r,a,s,e[5],5,-701558691),s=ti(s,n,r,a,e[10],9,38016083),a=ti(a,s,n,r,e[15],14,-660478335),r=ti(r,a,s,n,e[4],20,-405537848),n=ti(n,r,a,s,e[9],5,568446438),s=ti(s,n,r,a,e[14],9,-1019803690),a=ti(a,s,n,r,e[3],14,-187363961),r=ti(r,a,s,n,e[8],20,1163531501),n=ti(n,r,a,s,e[13],5,-1444681467),s=ti(s,n,r,a,e[2],9,-51403784),a=ti(a,s,n,r,e[7],14,1735328473),n=ni(n,r=ti(r,a,s,n,e[12],20,-1926607734),a,s,e[5],4,-378558),s=ni(s,n,r,a,e[8],11,-2022574463),a=ni(a,s,n,r,e[11],16,1839030562),r=ni(r,a,s,n,e[14],23,-35309556),n=ni(n,r,a,s,e[1],4,-1530992060),s=ni(s,n,r,a,e[4],11,1272893353),a=ni(a,s,n,r,e[7],16,-155497632),r=ni(r,a,s,n,e[10],23,-1094730640),n=ni(n,r,a,s,e[13],4,681279174),s=ni(s,n,r,a,e[0],11,-358537222),a=ni(a,s,n,r,e[3],16,-722521979),r=ni(r,a,s,n,e[6],23,76029189),n=ni(n,r,a,s,e[9],4,-640364487),s=ni(s,n,r,a,e[12],11,-421815835),a=ni(a,s,n,r,e[15],16,530742520),n=ri(n,r=ni(r,a,s,n,e[2],23,-995338651),a,s,e[0],6,-198630844),s=ri(s,n,r,a,e[7],10,1126891415),a=ri(a,s,n,r,e[14],15,-1416354905),r=ri(r,a,s,n,e[5],21,-57434055),n=ri(n,r,a,s,e[12],6,1700485571),s=ri(s,n,r,a,e[3],10,-1894986606),a=ri(a,s,n,r,e[10],15,-1051523),r=ri(r,a,s,n,e[1],21,-2054922799),n=ri(n,r,a,s,e[8],6,1873313359),s=ri(s,n,r,a,e[15],10,-30611744),a=ri(a,s,n,r,e[6],15,-1560198380),r=ri(r,a,s,n,e[13],21,1309151649),n=ri(n,r,a,s,e[4],6,-145523070),s=ri(s,n,r,a,e[11],10,-1120210379),a=ri(a,s,n,r,e[2],15,718787259),r=ri(r,a,s,n,e[9],21,-343485551),t[0]=du(n,t[0]),t[1]=du(r,t[1]),t[2]=du(a,t[2]),t[3]=du(s,t[3])}function pg(t,e,n,r,a,s){return e=du(du(e,t),du(r,s)),du(e<<a|e>>>32-a,n)}function ei(t,e,n,r,a,s,l){return pg(e&n|~e&r,t,e,a,s,l)}function ti(t,e,n,r,a,s,l){return pg(e&r|n&~r,t,e,a,s,l)}function ni(t,e,n,r,a,s,l){return pg(e^n^r,t,e,a,s,l)}function ri(t,e,n,r,a,s,l){return pg(n^(e|~r),t,e,a,s,l)}function j6(t){var e,n=t.length,r=[1732584193,-271733879,-1732584194,271733878];for(e=64;e<=t.length;e+=64)P1(r,CB(t.substring(e-64,e)));t=t.substring(e-64);var a=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(e=0;e<t.length;e++)a[e>>2]|=t.charCodeAt(e)<<(e%4<<3);if(a[e>>2]|=128<<(e%4<<3),e>55)for(P1(r,a),e=0;e<16;e++)a[e]=0;return a[14]=8*n,P1(r,a),r}function CB(t){var e,n=[];for(e=0;e<64;e+=4)n[e>>2]=t.charCodeAt(e)+(t.charCodeAt(e+1)<<8)+(t.charCodeAt(e+2)<<16)+(t.charCodeAt(e+3)<<24);return n}var MS="0123456789abcdef".split("");function TB(t){for(var e="",n=0;n<4;n++)e+=MS[t>>8*n+4&15]+MS[t>>8*n&15];return e}function LB(t){return String.fromCharCode(255&t,(65280&t)>>8,(16711680&t)>>16,(4278190080&t)>>24)}function Gv(t){return j6(t).map(LB).join("")}var OB=(function(t){for(var e=0;e<t.length;e++)t[e]=TB(t[e]);return t.join("")})(j6("hello"))!="5d41402abc4b2a76b9719d911017c592";function du(t,e){if(OB){var n=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(n>>16)<<16|65535&n}return t+e&4294967295}/**
214
- * @license
215
- * FPDF is released under a permissive license: there is no usage restriction.
216
- * You may embed it freely in your application (commercial or not), with or
217
- * without modifications.
218
- *
219
- * Reference: http://www.fpdf.org/en/script/script37.php
220
- */function Wv(t,e){var n,r,a,s;if(t!==n){for(var l=(a=t,s=1+(256/t.length|0),new Array(s+1).join(a)),u=[],c=0;c<256;c++)u[c]=c;var h=0;for(c=0;c<256;c++){var d=u[c];h=(h+d+l.charCodeAt(c))%256,u[c]=u[h],u[h]=d}n=t,r=u}else u=r;var g=e.length,y=0,m=0,x="";for(c=0;c<g;c++)m=(m+(d=u[y=(y+1)%256]))%256,u[y]=u[m],u[m]=d,l=u[(u[y]+u[m])%256],x+=String.fromCharCode(e.charCodeAt(c)^l);return x}/**
221
- * @license
222
- * Licensed under the MIT License.
223
- * http://opensource.org/licenses/mit-license
224
- * Author: Owen Leong (@owenl131)
225
- * Date: 15 Oct 2020
226
- * References:
227
- * https://www.cs.cmu.edu/~dst/Adobe/Gallery/anon21jul01-pdf-encryption.txt
228
- * https://github.com/foliojs/pdfkit/blob/master/lib/security.js
229
- * http://www.fpdf.org/en/script/script37.php
230
- */var PS={print:4,modify:8,copy:16,"annot-forms":32};function vf(t,e,n,r){this.v=1,this.r=2;var a=192;t.forEach(function(u){if(PS.perm!==void 0)throw new Error("Invalid permission: "+u);a+=PS[u]}),this.padding="(¿N^NuŠAd\0NVÿú\b..\0¶Ðh>€/\f©þdSiz";var s=(e+this.padding).substr(0,32),l=(n+this.padding).substr(0,32);this.O=this.processOwnerPassword(s,l),this.P=-(1+(255^a)),this.encryptionKey=Gv(s+this.O+this.lsbFirstWord(this.P)+this.hexToBytes(r)).substr(0,5),this.U=Wv(this.encryptionKey,this.padding)}function yf(t){if(/[^\u0000-\u00ff]/.test(t))throw new Error("Invalid PDF Name Object: "+t+", Only accept ASCII characters.");for(var e="",n=t.length,r=0;r<n;r++){var a=t.charCodeAt(r);e+=a<33||a===35||a===37||a===40||a===41||a===47||a===60||a===62||a===91||a===93||a===123||a===125||a>126?"#"+("0"+a.toString(16)).slice(-2):t[r]}return e}function IS(t){if(Rn(t)!=="object")throw new Error("Invalid Context passed to initialize PubSub (jsPDF-module)");var e={};this.subscribe=function(n,r,a){if(a=a||!1,typeof n!="string"||typeof r!="function"||typeof a!="boolean")throw new Error("Invalid arguments passed to PubSub.subscribe (jsPDF-module)");e.hasOwnProperty(n)||(e[n]={});var s=Math.random().toString(35);return e[n][s]=[r,!!a],s},this.unsubscribe=function(n){for(var r in e)if(e[r][n])return delete e[r][n],Object.keys(e[r]).length===0&&delete e[r],!0;return!1},this.publish=function(n){if(e.hasOwnProperty(n)){var r=Array.prototype.slice.call(arguments,1),a=[];for(var s in e[n]){var l=e[n][s];try{l[0].apply(t,r)}catch(u){tn.console&&hr.error("jsPDF PubSub Error",u.message,u)}l[1]&&a.push(s)}a.length&&a.forEach(this.unsubscribe)}},this.getTopics=function(){return e}}function Pm(t){if(!(this instanceof Pm))return new Pm(t);var e="opacity,stroke-opacity".split(",");for(var n in t)t.hasOwnProperty(n)&&e.indexOf(n)>=0&&(this[n]=t[n]);this.id="",this.objectNumber=-1}function R6(t,e){this.gState=t,this.matrix=e,this.id="",this.objectNumber=-1}function Wu(t,e,n,r,a){if(!(this instanceof Wu))return new Wu(t,e,n,r,a);this.type=t==="axial"?2:3,this.coords=e,this.colors=n,R6.call(this,r,a)}function xf(t,e,n,r,a){if(!(this instanceof xf))return new xf(t,e,n,r,a);this.boundingBox=t,this.xStep=e,this.yStep=n,this.stream="",this.cloneIndex=0,R6.call(this,r,a)}function Lt(t){var e,n=typeof arguments[0]=="string"?arguments[0]:"p",r=arguments[1],a=arguments[2],s=arguments[3],l=[],u=1,c=16,h="S",d=null;Rn(t=t||{})==="object"&&(n=t.orientation,r=t.unit||r,a=t.format||a,s=t.compress||t.compressPdf||s,(d=t.encryption||null)!==null&&(d.userPassword=d.userPassword||"",d.ownerPassword=d.ownerPassword||"",d.userPermissions=d.userPermissions||[]),u=typeof t.userUnit=="number"?Math.abs(t.userUnit):1,t.precision!==void 0&&(e=t.precision),t.floatPrecision!==void 0&&(c=t.floatPrecision),h=t.defaultPathOperation||"S"),l=t.filters||(s===!0?["FlateEncode"]:l),r=r||"mm",n=(""+(n||"P")).toLowerCase();var g=t.putOnlyUsedFonts||!1,y={},m={internal:{},__private__:{}};m.__private__.PubSub=IS;var x="1.3",E=m.__private__.getPdfVersion=function(){return x};m.__private__.setPdfVersion=function(C){x=C};var A={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};m.__private__.getPageFormats=function(){return A};var N=m.__private__.getPageFormat=function(C){return A[C]};a=a||"a4";var O="compat",T="advanced",D=O;function F(){this.saveGraphicsState(),ee(new Et(Xt,0,0,-Xt,0,ks()*Xt).toString()+" cm"),this.setFontSize(this.getFontSize()/Xt),h="n",D=T}function Q(){this.restoreGraphicsState(),h="S",D=O}var P=m.__private__.combineFontStyleAndFontWeight=function(C,q){if(C=="bold"&&q=="normal"||C=="bold"&&q==400||C=="normal"&&q=="italic"||C=="bold"&&q=="italic")throw new Error("Invalid Combination of fontweight and fontstyle");return q&&(C=q==400||q==="normal"?C==="italic"?"italic":"normal":q!=700&&q!=="bold"||C!=="normal"?(q==700?"bold":q)+""+C:"bold"),C};m.advancedAPI=function(C){var q=D===O;return q&&F.call(this),typeof C!="function"||(C(this),q&&Q.call(this)),this},m.compatAPI=function(C){var q=D===T;return q&&Q.call(this),typeof C!="function"||(C(this),q&&F.call(this)),this},m.isAdvancedAPI=function(){return D===T};var $,B=function(C){if(D!==T)throw new Error(C+" is only available in 'advanced' API mode. You need to call advancedAPI() first.")},ne=m.roundToPrecision=m.__private__.roundToPrecision=function(C,q){var fe=e||q;if(isNaN(C)||isNaN(fe))throw new Error("Invalid argument passed to jsPDF.roundToPrecision");return C.toFixed(fe).replace(/0+$/,"")};$=m.hpf=m.__private__.hpf=typeof c=="number"?function(C){if(isNaN(C))throw new Error("Invalid argument passed to jsPDF.hpf");return ne(C,c)}:c==="smart"?function(C){if(isNaN(C))throw new Error("Invalid argument passed to jsPDF.hpf");return ne(C,C>-1&&C<1?16:5)}:function(C){if(isNaN(C))throw new Error("Invalid argument passed to jsPDF.hpf");return ne(C,16)};var I=m.f2=m.__private__.f2=function(C){if(isNaN(C))throw new Error("Invalid argument passed to jsPDF.f2");return ne(C,2)},z=m.__private__.f3=function(C){if(isNaN(C))throw new Error("Invalid argument passed to jsPDF.f3");return ne(C,3)},J=m.scale=m.__private__.scale=function(C){if(isNaN(C))throw new Error("Invalid argument passed to jsPDF.scale");return D===O?C*Xt:D===T?C:void 0},ae=function(C){return J((function(q){return D===O?ks()-q:D===T?q:void 0})(C))};m.__private__.setPrecision=m.setPrecision=function(C){typeof parseInt(C,10)=="number"&&(e=parseInt(C,10))};var me,Z="00000000000000000000000000000000",ce=m.__private__.getFileId=function(){return Z},oe=m.__private__.setFileId=function(C){return Z=C!==void 0&&/^[a-fA-F0-9]{32}$/.test(C)?C.toUpperCase():Z.split("").map(function(){return"ABCDEF0123456789".charAt(Math.floor(16*Math.random()))}).join(""),d!==null&&(Jr=new vf(d.userPermissions,d.userPassword,d.ownerPassword,Z)),Z};m.setFileId=function(C){return oe(C),this},m.getFileId=function(){return ce()};var ge=m.__private__.convertDateToPDFDate=function(C){var q=C.getTimezoneOffset(),fe=q<0?"+":"-",ve=Math.floor(Math.abs(q/60)),Ee=Math.abs(q%60),$e=[fe,K(ve),"'",K(Ee),"'"].join("");return["D:",C.getFullYear(),K(C.getMonth()+1),K(C.getDate()),K(C.getHours()),K(C.getMinutes()),K(C.getSeconds()),$e].join("")},he=m.__private__.convertPDFDateToDate=function(C){var q=parseInt(C.substr(2,4),10),fe=parseInt(C.substr(6,2),10)-1,ve=parseInt(C.substr(8,2),10),Ee=parseInt(C.substr(10,2),10),$e=parseInt(C.substr(12,2),10),Je=parseInt(C.substr(14,2),10);return new Date(q,fe,ve,Ee,$e,Je,0)},U=m.__private__.setCreationDate=function(C){var q;if(C===void 0&&(C=new Date),C instanceof Date)q=ge(C);else{if(!/^D:(20[0-2][0-9]|203[0-7]|19[7-9][0-9])(0[0-9]|1[0-2])([0-2][0-9]|3[0-1])(0[0-9]|1[0-9]|2[0-3])(0[0-9]|[1-5][0-9])(0[0-9]|[1-5][0-9])(\+0[0-9]|\+1[0-4]|-0[0-9]|-1[0-1])'(0[0-9]|[1-5][0-9])'?$/.test(C))throw new Error("Invalid argument passed to jsPDF.setCreationDate");q=C}return me=q},j=m.__private__.getCreationDate=function(C){var q=me;return C==="jsDate"&&(q=he(me)),q};m.setCreationDate=function(C){return U(C),this},m.getCreationDate=function(C){return j(C)};var Y,K=m.__private__.padd2=function(C){return("0"+parseInt(C)).slice(-2)},ie=m.__private__.padd2Hex=function(C){return("00"+(C=C.toString())).substr(C.length)},V=0,se=[],be=[],xe=0,Oe=[],Me=[],Ue=!1,Be=be;m.__private__.setCustomOutputDestination=function(C){Ue=!0,Be=C};var Ke=function(C){Ue||(Be=C)};m.__private__.resetCustomOutputDestination=function(){Ue=!1,Be=be};var ee=m.__private__.out=function(C){return C=C.toString(),xe+=C.length+1,Be.push(C),Be},qe=m.__private__.write=function(C){return ee(arguments.length===1?C.toString():Array.prototype.join.call(arguments," "))},ct=m.__private__.getArrayBuffer=function(C){for(var q=C.length,fe=new ArrayBuffer(q),ve=new Uint8Array(fe);q--;)ve[q]=C.charCodeAt(q);return fe},tt=[["Helvetica","helvetica","normal","WinAnsiEncoding"],["Helvetica-Bold","helvetica","bold","WinAnsiEncoding"],["Helvetica-Oblique","helvetica","italic","WinAnsiEncoding"],["Helvetica-BoldOblique","helvetica","bolditalic","WinAnsiEncoding"],["Courier","courier","normal","WinAnsiEncoding"],["Courier-Bold","courier","bold","WinAnsiEncoding"],["Courier-Oblique","courier","italic","WinAnsiEncoding"],["Courier-BoldOblique","courier","bolditalic","WinAnsiEncoding"],["Times-Roman","times","normal","WinAnsiEncoding"],["Times-Bold","times","bold","WinAnsiEncoding"],["Times-Italic","times","italic","WinAnsiEncoding"],["Times-BoldItalic","times","bolditalic","WinAnsiEncoding"],["ZapfDingbats","zapfdingbats","normal",null],["Symbol","symbol","normal",null]];m.__private__.getStandardFonts=function(){return tt};var Ye=t.fontSize||16;m.__private__.setFontSize=m.setFontSize=function(C){return Ye=D===T?C/Xt:C,this};var gt,ot=m.__private__.getFontSize=m.getFontSize=function(){return D===O?Ye:Ye*Xt},Ot=t.R2L||!1;m.__private__.setR2L=m.setR2L=function(C){return Ot=C,this},m.__private__.getR2L=m.getR2L=function(){return Ot};var At,Ft=m.__private__.setZoomMode=function(C){if(/^(?:\d+\.\d*|\d*\.\d+|\d+)%$/.test(C))gt=C;else if(isNaN(C)){if([void 0,null,"fullwidth","fullheight","fullpage","original"].indexOf(C)===-1)throw new Error('zoom must be Integer (e.g. 2), a percentage Value (e.g. 300%) or fullwidth, fullheight, fullpage, original. "'+C+'" is not recognized.');gt=C}else gt=parseInt(C,10)};m.__private__.getZoomMode=function(){return gt};var rn,Jt=m.__private__.setPageMode=function(C){if([void 0,null,"UseNone","UseOutlines","UseThumbs","FullScreen"].indexOf(C)==-1)throw new Error('Page mode must be one of UseNone, UseOutlines, UseThumbs, or FullScreen. "'+C+'" is not recognized.');At=C};m.__private__.getPageMode=function(){return At};var fn=m.__private__.setLayoutMode=function(C){if([void 0,null,"continuous","single","twoleft","tworight","two"].indexOf(C)==-1)throw new Error('Layout mode must be one of continuous, single, twoleft, tworight. "'+C+'" is not recognized.');rn=C};m.__private__.getLayoutMode=function(){return rn},m.__private__.setDisplayMode=m.setDisplayMode=function(C,q,fe){return Ft(C),fn(q),Jt(fe),this};var zt={title:"",subject:"",author:"",keywords:"",creator:""};m.__private__.getDocumentProperty=function(C){if(Object.keys(zt).indexOf(C)===-1)throw new Error("Invalid argument passed to jsPDF.getDocumentProperty");return zt[C]},m.__private__.getDocumentProperties=function(){return zt},m.__private__.setDocumentProperties=m.setProperties=m.setDocumentProperties=function(C){for(var q in zt)zt.hasOwnProperty(q)&&C[q]&&(zt[q]=C[q]);return this},m.__private__.setDocumentProperty=function(C,q){if(Object.keys(zt).indexOf(C)===-1)throw new Error("Invalid arguments passed to jsPDF.setDocumentProperty");return zt[C]=q};var at,Xt,wt,lr,dn,bt={},qt={},pn=[],Nt={},Gn={},Pt={},It={},Mn=null,Qt=0,_t=[],bn=new IS(m),si=t.hotfixes||[],Wr={},ka={},ha=[],Et=function C(q,fe,ve,Ee,$e,Je){if(!(this instanceof C))return new C(q,fe,ve,Ee,$e,Je);isNaN(q)&&(q=1),isNaN(fe)&&(fe=0),isNaN(ve)&&(ve=0),isNaN(Ee)&&(Ee=1),isNaN($e)&&($e=0),isNaN(Je)&&(Je=0),this._matrix=[q,fe,ve,Ee,$e,Je]};Object.defineProperty(Et.prototype,"sx",{get:function(){return this._matrix[0]},set:function(C){this._matrix[0]=C}}),Object.defineProperty(Et.prototype,"shy",{get:function(){return this._matrix[1]},set:function(C){this._matrix[1]=C}}),Object.defineProperty(Et.prototype,"shx",{get:function(){return this._matrix[2]},set:function(C){this._matrix[2]=C}}),Object.defineProperty(Et.prototype,"sy",{get:function(){return this._matrix[3]},set:function(C){this._matrix[3]=C}}),Object.defineProperty(Et.prototype,"tx",{get:function(){return this._matrix[4]},set:function(C){this._matrix[4]=C}}),Object.defineProperty(Et.prototype,"ty",{get:function(){return this._matrix[5]},set:function(C){this._matrix[5]=C}}),Object.defineProperty(Et.prototype,"a",{get:function(){return this._matrix[0]},set:function(C){this._matrix[0]=C}}),Object.defineProperty(Et.prototype,"b",{get:function(){return this._matrix[1]},set:function(C){this._matrix[1]=C}}),Object.defineProperty(Et.prototype,"c",{get:function(){return this._matrix[2]},set:function(C){this._matrix[2]=C}}),Object.defineProperty(Et.prototype,"d",{get:function(){return this._matrix[3]},set:function(C){this._matrix[3]=C}}),Object.defineProperty(Et.prototype,"e",{get:function(){return this._matrix[4]},set:function(C){this._matrix[4]=C}}),Object.defineProperty(Et.prototype,"f",{get:function(){return this._matrix[5]},set:function(C){this._matrix[5]=C}}),Object.defineProperty(Et.prototype,"rotation",{get:function(){return Math.atan2(this.shx,this.sx)}}),Object.defineProperty(Et.prototype,"scaleX",{get:function(){return this.decompose().scale.sx}}),Object.defineProperty(Et.prototype,"scaleY",{get:function(){return this.decompose().scale.sy}}),Object.defineProperty(Et.prototype,"isIdentity",{get:function(){return this.sx===1&&this.shy===0&&this.shx===0&&this.sy===1&&this.tx===0&&this.ty===0}}),Et.prototype.join=function(C){return[this.sx,this.shy,this.shx,this.sy,this.tx,this.ty].map($).join(C)},Et.prototype.multiply=function(C){var q=C.sx*this.sx+C.shy*this.shx,fe=C.sx*this.shy+C.shy*this.sy,ve=C.shx*this.sx+C.sy*this.shx,Ee=C.shx*this.shy+C.sy*this.sy,$e=C.tx*this.sx+C.ty*this.shx+this.tx,Je=C.tx*this.shy+C.ty*this.sy+this.ty;return new Et(q,fe,ve,Ee,$e,Je)},Et.prototype.decompose=function(){var C=this.sx,q=this.shy,fe=this.shx,ve=this.sy,Ee=this.tx,$e=this.ty,Je=Math.sqrt(C*C+q*q),pt=(C/=Je)*fe+(q/=Je)*ve;fe-=C*pt,ve-=q*pt;var xt=Math.sqrt(fe*fe+ve*ve);return pt/=xt,C*(ve/=xt)<q*(fe/=xt)&&(C=-C,q=-q,pt=-pt,Je=-Je),{scale:new Et(Je,0,0,xt,0,0),translate:new Et(1,0,0,1,Ee,$e),rotate:new Et(C,q,-q,C,0,0),skew:new Et(1,0,pt,1,0,0)}},Et.prototype.toString=function(C){return this.join(" ")},Et.prototype.inversed=function(){var C=this.sx,q=this.shy,fe=this.shx,ve=this.sy,Ee=this.tx,$e=this.ty,Je=1/(C*ve-q*fe),pt=ve*Je,xt=-q*Je,Yt=-fe*Je,an=C*Je;return new Et(pt,xt,Yt,an,-pt*Ee-Yt*$e,-xt*Ee-an*$e)},Et.prototype.applyToPoint=function(C){var q=C.x*this.sx+C.y*this.shx+this.tx,fe=C.x*this.shy+C.y*this.sy+this.ty;return new bi(q,fe)},Et.prototype.applyToRectangle=function(C){var q=this.applyToPoint(C),fe=this.applyToPoint(new bi(C.x+C.w,C.y+C.h));return new Ls(q.x,q.y,fe.x-q.x,fe.y-q.y)},Et.prototype.clone=function(){var C=this.sx,q=this.shy,fe=this.shx,ve=this.sy,Ee=this.tx,$e=this.ty;return new Et(C,q,fe,ve,Ee,$e)},m.Matrix=Et;var Ui=m.matrixMult=function(C,q){return q.multiply(C)},vi=new Et(1,0,0,1,0,0);m.unitMatrix=m.identityMatrix=vi;var de=function(C,q){if(!Gn[C]){var fe=(q instanceof Wu?"Sh":"P")+(Object.keys(Nt).length+1).toString(10);q.id=fe,Gn[C]=fe,Nt[fe]=q,bn.publish("addPattern",q)}};m.ShadingPattern=Wu,m.TilingPattern=xf,m.addShadingPattern=function(C,q){return B("addShadingPattern()"),de(C,q),this},m.beginTilingPattern=function(C){B("beginTilingPattern()"),$o(C.boundingBox[0],C.boundingBox[1],C.boundingBox[2]-C.boundingBox[0],C.boundingBox[3]-C.boundingBox[1],C.matrix)},m.endTilingPattern=function(C,q){B("endTilingPattern()"),q.stream=Me[Y].join(`
231
- `),de(C,q),bn.publish("endTilingPattern",q),ha.pop().restore()};var Se,Ne=m.__private__.newObject=function(){var C=He();return Xe(C,!0),C},He=m.__private__.newObjectDeferred=function(){return V++,se[V]=function(){return xe},V},Xe=function(C,q){return q=typeof q=="boolean"&&q,se[C]=xe,q&&ee(C+" 0 obj"),C},ht=m.__private__.newAdditionalObject=function(){var C={objId:He(),content:""};return Oe.push(C),C},it=He(),Qe=He(),et=m.__private__.decodeColorString=function(C){var q=C.split(" ");if(q.length!==2||q[1]!=="g"&&q[1]!=="G")q.length!==5||q[4]!=="k"&&q[4]!=="K"||(q=[(1-q[0])*(1-q[3]),(1-q[1])*(1-q[3]),(1-q[2])*(1-q[3]),"r"]);else{var fe=parseFloat(q[0]);q=[fe,fe,fe,"r"]}for(var ve="#",Ee=0;Ee<3;Ee++)ve+=("0"+Math.floor(255*parseFloat(q[Ee])).toString(16)).slice(-2);return ve},rt=m.__private__.encodeColorString=function(C){var q;typeof C=="string"&&(C={ch1:C});var fe=C.ch1,ve=C.ch2,Ee=C.ch3,$e=C.ch4,Je=C.pdfColorType==="draw"?["G","RG","K"]:["g","rg","k"];if(typeof fe=="string"&&fe.charAt(0)!=="#"){var pt=new O6(fe);if(pt.ok)fe=pt.toHex();else if(!/^\d*\.?\d*$/.test(fe))throw new Error('Invalid color "'+fe+'" passed to jsPDF.encodeColorString.')}if(typeof fe=="string"&&/^#[0-9A-Fa-f]{3}$/.test(fe)&&(fe="#"+fe[1]+fe[1]+fe[2]+fe[2]+fe[3]+fe[3]),typeof fe=="string"&&/^#[0-9A-Fa-f]{6}$/.test(fe)){var xt=parseInt(fe.substr(1),16);fe=xt>>16&255,ve=xt>>8&255,Ee=255&xt}if(ve===void 0||$e===void 0&&fe===ve&&ve===Ee)q=typeof fe=="string"?fe+" "+Je[0]:C.precision===2?I(fe/255)+" "+Je[0]:z(fe/255)+" "+Je[0];else if($e===void 0||Rn($e)==="object"){if($e&&!isNaN($e.a)&&$e.a===0)return["1.","1.","1.",Je[1]].join(" ");q=typeof fe=="string"?[fe,ve,Ee,Je[1]].join(" "):C.precision===2?[I(fe/255),I(ve/255),I(Ee/255),Je[1]].join(" "):[z(fe/255),z(ve/255),z(Ee/255),Je[1]].join(" ")}else q=typeof fe=="string"?[fe,ve,Ee,$e,Je[2]].join(" "):C.precision===2?[I(fe),I(ve),I(Ee),I($e),Je[2]].join(" "):[z(fe),z(ve),z(Ee),z($e),Je[2]].join(" ");return q},Ct=m.__private__.getFilters=function(){return l},st=m.__private__.putStream=function(C){var q=(C=C||{}).data||"",fe=C.filters||Ct(),ve=C.alreadyAppliedFilters||[],Ee=C.addLength1||!1,$e=q.length,Je=C.objectId,pt=function(Xr){return Xr};if(d!==null&&Je===void 0)throw new Error("ObjectId must be passed to putStream for file encryption");d!==null&&(pt=Jr.encryptor(Je,0));var xt={};fe===!0&&(fe=["FlateEncode"]);var Yt=C.additionalKeyValues||[],an=(xt=Lt.API.processDataByFilters!==void 0?Lt.API.processDataByFilters(q,fe):{data:q,reverseChain:[]}).reverseChain+(Array.isArray(ve)?ve.join(" "):ve.toString());if(xt.data.length!==0&&(Yt.push({key:"Length",value:xt.data.length}),Ee===!0&&Yt.push({key:"Length1",value:$e})),an.length!=0)if(an.split("/").length-1==1)Yt.push({key:"Filter",value:an});else{Yt.push({key:"Filter",value:"["+an+"]"});for(var Nn=0;Nn<Yt.length;Nn+=1)if(Yt[Nn].key==="DecodeParms"){for(var mr=[],Cr=0;Cr<xt.reverseChain.split("/").length-1;Cr+=1)mr.push("null");mr.push(Yt[Nn].value),Yt[Nn].value="["+mr.join(" ")+"]"}}ee("<<");for(var nr=0;nr<Yt.length;nr++)ee("/"+Yt[nr].key+" "+Yt[nr].value);ee(">>"),xt.data.length!==0&&(ee("stream"),ee(pt(xt.data)),ee("endstream"))},Ht=m.__private__.putPage=function(C){var q=C.number,fe=C.data,ve=C.objId,Ee=C.contentsObjId;Xe(ve,!0),ee("<</Type /Page"),ee("/Parent "+C.rootDictionaryObjId+" 0 R"),ee("/Resources "+C.resourceDictionaryObjId+" 0 R"),ee("/MediaBox ["+parseFloat($(C.mediaBox.bottomLeftX))+" "+parseFloat($(C.mediaBox.bottomLeftY))+" "+$(C.mediaBox.topRightX)+" "+$(C.mediaBox.topRightY)+"]"),C.cropBox!==null&&ee("/CropBox ["+$(C.cropBox.bottomLeftX)+" "+$(C.cropBox.bottomLeftY)+" "+$(C.cropBox.topRightX)+" "+$(C.cropBox.topRightY)+"]"),C.bleedBox!==null&&ee("/BleedBox ["+$(C.bleedBox.bottomLeftX)+" "+$(C.bleedBox.bottomLeftY)+" "+$(C.bleedBox.topRightX)+" "+$(C.bleedBox.topRightY)+"]"),C.trimBox!==null&&ee("/TrimBox ["+$(C.trimBox.bottomLeftX)+" "+$(C.trimBox.bottomLeftY)+" "+$(C.trimBox.topRightX)+" "+$(C.trimBox.topRightY)+"]"),C.artBox!==null&&ee("/ArtBox ["+$(C.artBox.bottomLeftX)+" "+$(C.artBox.bottomLeftY)+" "+$(C.artBox.topRightX)+" "+$(C.artBox.topRightY)+"]"),typeof C.userUnit=="number"&&C.userUnit!==1&&ee("/UserUnit "+C.userUnit),bn.publish("putPage",{objId:ve,pageContext:_t[q],pageNumber:q,page:fe}),ee("/Contents "+Ee+" 0 R"),ee(">>"),ee("endobj");var $e=fe.join(`
232
- `);return D===T&&($e+=`
233
- Q`),Xe(Ee,!0),st({data:$e,filters:Ct(),objectId:Ee}),ee("endobj"),ve},Zt=m.__private__.putPages=function(){var C,q,fe=[];for(C=1;C<=Qt;C++)_t[C].objId=He(),_t[C].contentsObjId=He();for(C=1;C<=Qt;C++)fe.push(Ht({number:C,data:Me[C],objId:_t[C].objId,contentsObjId:_t[C].contentsObjId,mediaBox:_t[C].mediaBox,cropBox:_t[C].cropBox,bleedBox:_t[C].bleedBox,trimBox:_t[C].trimBox,artBox:_t[C].artBox,userUnit:_t[C].userUnit,rootDictionaryObjId:it,resourceDictionaryObjId:Qe}));Xe(it,!0),ee("<</Type /Pages");var ve="/Kids [";for(q=0;q<Qt;q++)ve+=fe[q]+" 0 R ";ee(ve+"]"),ee("/Count "+Qt),ee(">>"),ee("endobj"),bn.publish("postPutPages")},Bn=function(C){bn.publish("putFont",{font:C,out:ee,newObject:Ne,putStream:st}),C.isAlreadyPutted!==!0&&(C.objectNumber=Ne(),ee("<<"),ee("/Type /Font"),ee("/BaseFont /"+yf(C.postScriptName)),ee("/Subtype /Type1"),typeof C.encoding=="string"&&ee("/Encoding /"+C.encoding),ee("/FirstChar 32"),ee("/LastChar 255"),ee(">>"),ee("endobj"))},Kn=function(C){C.objectNumber=Ne();var q=[];q.push({key:"Type",value:"/XObject"}),q.push({key:"Subtype",value:"/Form"}),q.push({key:"BBox",value:"["+[$(C.x),$(C.y),$(C.x+C.width),$(C.y+C.height)].join(" ")+"]"}),q.push({key:"Matrix",value:"["+C.matrix.toString()+"]"});var fe=C.pages[1].join(`
234
- `);st({data:fe,additionalKeyValues:q,objectId:C.objectNumber}),ee("endobj")},Jn=function(C,q){q||(q=21);var fe=Ne(),ve=(function(Je,pt){var xt,Yt=[],an=1/(pt-1);for(xt=0;xt<1;xt+=an)Yt.push(xt);if(Yt.push(1),Je[0].offset!=0){var Nn={offset:0,color:Je[0].color};Je.unshift(Nn)}if(Je[Je.length-1].offset!=1){var mr={offset:1,color:Je[Je.length-1].color};Je.push(mr)}for(var Cr="",nr=0,Xr=0;Xr<Yt.length;Xr++){for(xt=Yt[Xr];xt>Je[nr+1].offset;)nr++;var Ir=Je[nr].offset,pa=(xt-Ir)/(Je[nr+1].offset-Ir),Ms=Je[nr].color,zi=Je[nr+1].color;Cr+=ie(Math.round((1-pa)*Ms[0]+pa*zi[0]).toString(16))+ie(Math.round((1-pa)*Ms[1]+pa*zi[1]).toString(16))+ie(Math.round((1-pa)*Ms[2]+pa*zi[2]).toString(16))}return Cr.trim()})(C.colors,q),Ee=[];Ee.push({key:"FunctionType",value:"0"}),Ee.push({key:"Domain",value:"[0.0 1.0]"}),Ee.push({key:"Size",value:"["+q+"]"}),Ee.push({key:"BitsPerSample",value:"8"}),Ee.push({key:"Range",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),Ee.push({key:"Decode",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),st({data:ve,additionalKeyValues:Ee,alreadyAppliedFilters:["/ASCIIHexDecode"],objectId:fe}),ee("endobj"),C.objectNumber=Ne(),ee("<< /ShadingType "+C.type),ee("/ColorSpace /DeviceRGB");var $e="/Coords ["+$(parseFloat(C.coords[0]))+" "+$(parseFloat(C.coords[1]))+" ";C.type===2?$e+=$(parseFloat(C.coords[2]))+" "+$(parseFloat(C.coords[3])):$e+=$(parseFloat(C.coords[2]))+" "+$(parseFloat(C.coords[3]))+" "+$(parseFloat(C.coords[4]))+" "+$(parseFloat(C.coords[5])),ee($e+="]"),C.matrix&&ee("/Matrix ["+C.matrix.toString()+"]"),ee("/Function "+fe+" 0 R"),ee("/Extend [true true]"),ee(">>"),ee("endobj")},hn=function(C,q){var fe=He(),ve=Ne();q.push({resourcesOid:fe,objectOid:ve}),C.objectNumber=ve;var Ee=[];Ee.push({key:"Type",value:"/Pattern"}),Ee.push({key:"PatternType",value:"1"}),Ee.push({key:"PaintType",value:"1"}),Ee.push({key:"TilingType",value:"1"}),Ee.push({key:"BBox",value:"["+C.boundingBox.map($).join(" ")+"]"}),Ee.push({key:"XStep",value:$(C.xStep)}),Ee.push({key:"YStep",value:$(C.yStep)}),Ee.push({key:"Resources",value:fe+" 0 R"}),C.matrix&&Ee.push({key:"Matrix",value:"["+C.matrix.toString()+"]"}),st({data:C.stream,additionalKeyValues:Ee,objectId:C.objectNumber}),ee("endobj")},Mr=function(C){for(var q in C.objectNumber=Ne(),ee("<<"),C)switch(q){case"opacity":ee("/ca "+I(C[q]));break;case"stroke-opacity":ee("/CA "+I(C[q]))}ee(">>"),ee("endobj")},ra=function(C){Xe(C.resourcesOid,!0),ee("<<"),ee("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"),(function(){for(var q in ee("/Font <<"),bt)bt.hasOwnProperty(q)&&(g===!1||g===!0&&y.hasOwnProperty(q))&&ee("/"+q+" "+bt[q].objectNumber+" 0 R");ee(">>")})(),(function(){if(Object.keys(Nt).length>0){for(var q in ee("/Shading <<"),Nt)Nt.hasOwnProperty(q)&&Nt[q]instanceof Wu&&Nt[q].objectNumber>=0&&ee("/"+q+" "+Nt[q].objectNumber+" 0 R");bn.publish("putShadingPatternDict"),ee(">>")}})(),(function(q){if(Object.keys(Nt).length>0){for(var fe in ee("/Pattern <<"),Nt)Nt.hasOwnProperty(fe)&&Nt[fe]instanceof m.TilingPattern&&Nt[fe].objectNumber>=0&&Nt[fe].objectNumber<q&&ee("/"+fe+" "+Nt[fe].objectNumber+" 0 R");bn.publish("putTilingPatternDict"),ee(">>")}})(C.objectOid),(function(){if(Object.keys(Pt).length>0){var q;for(q in ee("/ExtGState <<"),Pt)Pt.hasOwnProperty(q)&&Pt[q].objectNumber>=0&&ee("/"+q+" "+Pt[q].objectNumber+" 0 R");bn.publish("putGStateDict"),ee(">>")}})(),(function(){for(var q in ee("/XObject <<"),Wr)Wr.hasOwnProperty(q)&&Wr[q].objectNumber>=0&&ee("/"+q+" "+Wr[q].objectNumber+" 0 R");bn.publish("putXobjectDict"),ee(">>")})(),ee(">>"),ee("endobj")},Xn=function(C){qt[C.fontName]=qt[C.fontName]||{},qt[C.fontName][C.fontStyle]=C.id},Ka=function(C,q,fe,ve,Ee){var $e={id:"F"+(Object.keys(bt).length+1).toString(10),postScriptName:C,fontName:q,fontStyle:fe,encoding:ve,isStandardFont:Ee||!1,metadata:{}};return bn.publish("addFont",{font:$e,instance:this}),bt[$e.id]=$e,Xn($e),$e.id},dr=m.__private__.pdfEscape=m.pdfEscape=function(C,q){return(function(fe,ve){var Ee,$e,Je,pt,xt,Yt,an,Nn,mr;if(Je=(ve=ve||{}).sourceEncoding||"Unicode",xt=ve.outputEncoding,(ve.autoencode||xt)&&bt[at].metadata&&bt[at].metadata[Je]&&bt[at].metadata[Je].encoding&&(pt=bt[at].metadata[Je].encoding,!xt&&bt[at].encoding&&(xt=bt[at].encoding),!xt&&pt.codePages&&(xt=pt.codePages[0]),typeof xt=="string"&&(xt=pt[xt]),xt)){for(an=!1,Yt=[],Ee=0,$e=fe.length;Ee<$e;Ee++)(Nn=xt[fe.charCodeAt(Ee)])?Yt.push(String.fromCharCode(Nn)):Yt.push(fe[Ee]),Yt[Ee].charCodeAt(0)>>8&&(an=!0);fe=Yt.join("")}for(Ee=fe.length;an===void 0&&Ee!==0;)fe.charCodeAt(Ee-1)>>8&&(an=!0),Ee--;if(!an)return fe;for(Yt=ve.noBOM?[]:[254,255],Ee=0,$e=fe.length;Ee<$e;Ee++){if((mr=(Nn=fe.charCodeAt(Ee))>>8)>>8)throw new Error("Character at position "+Ee+" of string '"+fe+"' exceeds 16bits. Cannot be encoded into UCS-2 BE");Yt.push(mr),Yt.push(Nn-(mr<<8))}return String.fromCharCode.apply(void 0,Yt)})(C,q).replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},Ma=m.__private__.beginPage=function(C){Me[++Qt]=[],_t[Qt]={objId:0,contentsObjId:0,userUnit:Number(u),artBox:null,bleedBox:null,cropBox:null,trimBox:null,mediaBox:{bottomLeftX:0,bottomLeftY:0,topRightX:Number(C[0]),topRightY:Number(C[1])}},is(Qt),Ke(Me[Y])},Pa=function(C,q){var fe,ve,Ee;switch(n=q||n,typeof C=="string"&&(fe=N(C.toLowerCase()),Array.isArray(fe)&&(ve=fe[0],Ee=fe[1])),Array.isArray(C)&&(ve=C[0]*Xt,Ee=C[1]*Xt),isNaN(ve)&&(ve=a[0],Ee=a[1]),(ve>14400||Ee>14400)&&(hr.warn("A page in a PDF can not be wider or taller than 14400 userUnit. jsPDF limits the width/height to 14400"),ve=Math.min(14400,ve),Ee=Math.min(14400,Ee)),a=[ve,Ee],n.substr(0,1)){case"l":Ee>ve&&(a=[Ee,ve]);break;case"p":ve>Ee&&(a=[Ee,ve])}Ma(a),Ut(Fo),ee(ci),Nl!==0&&ee(Nl+" J"),aa!==0&&ee(aa+" j"),bn.publish("addPage",{pageNumber:Qt})},oi=function(C){C>0&&C<=Qt&&(Me.splice(C,1),_t.splice(C,1),Qt--,Y>Qt&&(Y=Qt),this.setPage(Y))},is=function(C){C>0&&C<=Qt&&(Y=C)},ss=m.__private__.getNumberOfPages=m.getNumberOfPages=function(){return Me.length-1},gn=function(C,q,fe){var ve,Ee=void 0;return fe=fe||{},C=C!==void 0?C:bt[at].fontName,q=q!==void 0?q:bt[at].fontStyle,ve=C.toLowerCase(),qt[ve]!==void 0&&qt[ve][q]!==void 0?Ee=qt[ve][q]:qt[C]!==void 0&&qt[C][q]!==void 0?Ee=qt[C][q]:fe.disableWarning===!1&&hr.warn("Unable to look up font label for font '"+C+"', '"+q+"'. Refer to getFontList() for available fonts."),Ee||fe.noFallback||(Ee=qt.times[q])==null&&(Ee=qt.times.normal),Ee},Pn=m.__private__.putInfo=function(){var C=Ne(),q=function(ve){return ve};for(var fe in d!==null&&(q=Jr.encryptor(C,0)),ee("<<"),ee("/Producer ("+dr(q("jsPDF "+Lt.version))+")"),zt)zt.hasOwnProperty(fe)&&zt[fe]&&ee("/"+fe.substr(0,1).toUpperCase()+fe.substr(1)+" ("+dr(q(zt[fe]))+")");ee("/CreationDate ("+dr(q(me))+")"),ee(">>"),ee("endobj")},Na=m.__private__.putCatalog=function(C){var q=(C=C||{}).rootDictionaryObjId||it;switch(Ne(),ee("<<"),ee("/Type /Catalog"),ee("/Pages "+q+" 0 R"),gt||(gt="fullwidth"),gt){case"fullwidth":ee("/OpenAction [3 0 R /FitH null]");break;case"fullheight":ee("/OpenAction [3 0 R /FitV null]");break;case"fullpage":ee("/OpenAction [3 0 R /Fit]");break;case"original":ee("/OpenAction [3 0 R /XYZ null null 1]");break;default:var fe=""+gt;fe.substr(fe.length-1)==="%"&&(gt=parseInt(gt)/100),typeof gt=="number"&&ee("/OpenAction [3 0 R /XYZ null null "+I(gt)+"]")}switch(rn||(rn="continuous"),rn){case"continuous":ee("/PageLayout /OneColumn");break;case"single":ee("/PageLayout /SinglePage");break;case"two":case"twoleft":ee("/PageLayout /TwoColumnLeft");break;case"tworight":ee("/PageLayout /TwoColumnRight")}At&&ee("/PageMode /"+At),bn.publish("putCatalog"),ee(">>"),ee("endobj")},Kr=m.__private__.putTrailer=function(){ee("trailer"),ee("<<"),ee("/Size "+(V+1)),ee("/Root "+V+" 0 R"),ee("/Info "+(V-1)+" 0 R"),d!==null&&ee("/Encrypt "+Jr.oid+" 0 R"),ee("/ID [ <"+Z+"> <"+Z+"> ]"),ee(">>")},jt=m.__private__.putHeader=function(){ee("%PDF-"+x),ee("%ºß¬à")},os=m.__private__.putXRef=function(){var C="0000000000";ee("xref"),ee("0 "+(V+1)),ee("0000000000 65535 f ");for(var q=1;q<=V;q++)typeof se[q]=="function"?ee((C+se[q]()).slice(-10)+" 00000 n "):se[q]!==void 0?ee((C+se[q]).slice(-10)+" 00000 n "):ee("0000000000 00000 n ")},li=m.__private__.buildDocument=function(){var C;V=0,xe=0,be=[],se=[],Oe=[],it=He(),Qe=He(),Ke(be),bn.publish("buildDocument"),jt(),Zt(),(function(){bn.publish("putAdditionalObjects");for(var fe=0;fe<Oe.length;fe++){var ve=Oe[fe];Xe(ve.objId,!0),ee(ve.content),ee("endobj")}bn.publish("postPutAdditionalObjects")})(),C=[],(function(){for(var fe in bt)bt.hasOwnProperty(fe)&&(g===!1||g===!0&&y.hasOwnProperty(fe))&&Bn(bt[fe])})(),(function(){var fe;for(fe in Pt)Pt.hasOwnProperty(fe)&&Mr(Pt[fe])})(),(function(){for(var fe in Wr)Wr.hasOwnProperty(fe)&&Kn(Wr[fe])})(),(function(fe){var ve;for(ve in Nt)Nt.hasOwnProperty(ve)&&(Nt[ve]instanceof Wu?Jn(Nt[ve]):Nt[ve]instanceof xf&&hn(Nt[ve],fe))})(C),bn.publish("putResources"),C.forEach(ra),ra({resourcesOid:Qe,objectOid:Number.MAX_SAFE_INTEGER}),bn.publish("postPutResources"),d!==null&&(Jr.oid=Ne(),ee("<<"),ee("/Filter /Standard"),ee("/V "+Jr.v),ee("/R "+Jr.r),ee("/U <"+Jr.toHexString(Jr.U)+">"),ee("/O <"+Jr.toHexString(Jr.O)+">"),ee("/P "+Jr.P),ee(">>"),ee("endobj")),Pn(),Na();var q=xe;return os(),Kr(),ee("startxref"),ee(""+q),ee("%%EOF"),Ke(Me[Y]),be.join(`
235
- `)},ls=m.__private__.getBlob=function(C){return new Blob([ct(C)],{type:"application/pdf"})},mu=m.output=m.__private__.output=(Se=function(C,q){switch(typeof(q=q||{})=="string"?q={filename:q}:q.filename=q.filename||"generated.pdf",C){case void 0:return li();case"save":m.save(q.filename);break;case"arraybuffer":return ct(li());case"blob":return ls(li());case"bloburi":case"bloburl":if(tn.URL!==void 0&&typeof tn.URL.createObjectURL=="function")return tn.URL&&tn.URL.createObjectURL(ls(li()))||void 0;hr.warn("bloburl is not supported by your system, because URL.createObjectURL is not supported by your browser.");break;case"datauristring":case"dataurlstring":var fe="",ve=li();try{fe=kS(ve)}catch{fe=kS(unescape(encodeURIComponent(ve)))}return"data:application/pdf;filename="+q.filename+";base64,"+fe;case"pdfobjectnewwindow":if(Object.prototype.toString.call(tn)==="[object Window]"){var Ee="https://cdnjs.cloudflare.com/ajax/libs/pdfobject/2.1.1/pdfobject.min.js",$e=' integrity="sha512-4ze/a9/4jqu+tX9dfOqJYSvyYd5M6qum/3HpCLr+/Jqf0whc37VUbkpNGHR7/8pSnCFw47T1fmIpwBV7UySh3g==" crossorigin="anonymous"';q.pdfObjectUrl&&(Ee=q.pdfObjectUrl,$e="");var Je='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><script src="'+Ee+'"'+$e+'><\/script><script >PDFObject.embed("'+this.output("dataurlstring")+'", '+JSON.stringify(q)+");<\/script></body></html>",pt=tn.open();return pt!==null&&pt.document.write(Je),pt}throw new Error("The option pdfobjectnewwindow just works in a browser-environment.");case"pdfjsnewwindow":if(Object.prototype.toString.call(tn)==="[object Window]"){var xt='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><iframe id="pdfViewer" src="'+(q.pdfJsUrl||"examples/PDF.js/web/viewer.html")+"?file=&downloadName="+q.filename+'" width="500px" height="400px" /></body></html>',Yt=tn.open();if(Yt!==null){Yt.document.write(xt);var an=this;Yt.document.documentElement.querySelector("#pdfViewer").onload=function(){Yt.document.title=q.filename,Yt.document.documentElement.querySelector("#pdfViewer").contentWindow.PDFViewerApplication.open(an.output("bloburl"))}}return Yt}throw new Error("The option pdfjsnewwindow just works in a browser-environment.");case"dataurlnewwindow":if(Object.prototype.toString.call(tn)!=="[object Window]")throw new Error("The option dataurlnewwindow just works in a browser-environment.");var Nn='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><iframe src="'+this.output("datauristring",q)+'"></iframe></body></html>',mr=tn.open();if(mr!==null&&(mr.document.write(Nn),mr.document.title=q.filename),mr||typeof safari>"u")return mr;break;case"datauri":case"dataurl":return tn.document.location.href=this.output("datauristring",q);default:return null}},Se.foo=function(){try{return Se.apply(this,arguments)}catch(fe){var C=fe.stack||"";~C.indexOf(" at ")&&(C=C.split(" at ")[1]);var q="Error in function "+C.split(`
236
- `)[0].split("<")[0]+": "+fe.message;if(!tn.console)throw new Error(q);tn.console.error(q,fe),tn.alert&&alert(q)}},Se.foo.bar=Se,Se.foo),Ia=function(C){return Array.isArray(si)===!0&&si.indexOf(C)>-1};switch(r){case"pt":Xt=1;break;case"mm":Xt=72/25.4;break;case"cm":Xt=72/2.54;break;case"in":Xt=72;break;case"px":Xt=Ia("px_scaling")==1?.75:96/72;break;case"pc":case"em":Xt=12;break;case"ex":Xt=6;break;default:if(typeof r!="number")throw new Error("Invalid unit: "+r);Xt=r}var Jr=null;U(),oe();var Pr=m.__private__.getPageInfo=m.getPageInfo=function(C){if(isNaN(C)||C%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfo");return{objId:_t[C].objId,pageNumber:C,pageContext:_t[C]}},El=m.__private__.getPageInfoByObjId=function(C){if(isNaN(C)||C%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfoByObjId");for(var q in _t)if(_t[q].objId===C)break;return Pr(q)},lc=m.__private__.getCurrentPageInfo=m.getCurrentPageInfo=function(){return{objId:_t[Y].objId,pageNumber:Y,pageContext:_t[Y]}};m.addPage=function(){return Pa.apply(this,arguments),this},m.setPage=function(){return is.apply(this,arguments),Ke.call(this,Me[Y]),this},m.insertPage=function(C){return this.addPage(),this.movePage(Y,C),this},m.movePage=function(C,q){var fe,ve;if(C>q){fe=Me[C],ve=_t[C];for(var Ee=C;Ee>q;Ee--)Me[Ee]=Me[Ee-1],_t[Ee]=_t[Ee-1];Me[q]=fe,_t[q]=ve,this.setPage(q)}else if(C<q){fe=Me[C],ve=_t[C];for(var $e=C;$e<q;$e++)Me[$e]=Me[$e+1],_t[$e]=_t[$e+1];Me[q]=fe,_t[q]=ve,this.setPage(q)}return this},m.deletePage=function(){return oi.apply(this,arguments),this},m.__private__.text=m.text=function(C,q,fe,ve,Ee){var $e,Je,pt,xt,Yt,an,Nn,mr,Cr,nr=(ve=ve||{}).scope||this;if(typeof C=="number"&&typeof q=="number"&&(typeof fe=="string"||Array.isArray(fe))){var Xr=fe;fe=q,q=C,C=Xr}if(arguments[3]instanceof Et==0?(pt=arguments[4],xt=arguments[5],Rn(Nn=arguments[3])==="object"&&Nn!==null||(typeof pt=="string"&&(xt=pt,pt=null),typeof Nn=="string"&&(xt=Nn,Nn=null),typeof Nn=="number"&&(pt=Nn,Nn=null),ve={flags:Nn,angle:pt,align:xt})):(B("The transform parameter of text() with a Matrix value"),Cr=Ee),isNaN(q)||isNaN(fe)||C==null)throw new Error("Invalid arguments passed to jsPDF.text");if(C.length===0)return nr;var Ir,pa="",Ms=typeof ve.lineHeightFactor=="number"?ve.lineHeightFactor:Ts,zi=nr.internal.scaleFactor;function Ps(Dn){return Dn=Dn.split(" ").join(Array(ve.TabLen||9).join(" ")),dr(Dn,Nn)}function Eu(Dn){for(var Cn,rr=Dn.concat(),Lr=[],ys=rr.length;ys--;)typeof(Cn=rr.shift())=="string"?Lr.push(Cn):Array.isArray(Dn)&&(Cn.length===1||Cn[1]===void 0&&Cn[2]===void 0)?Lr.push(Cn[0]):Lr.push([Cn[0],Cn[1],Cn[2]]);return Lr}function Tl(Dn,Cn){var rr;if(typeof Dn=="string")rr=Cn(Dn)[0];else if(Array.isArray(Dn)){for(var Lr,ys,Yi=Dn.concat(),Vo=[],Cu=Yi.length;Cu--;)typeof(Lr=Yi.shift())=="string"?Vo.push(Cn(Lr)[0]):Array.isArray(Lr)&&typeof Lr[0]=="string"&&(ys=Cn(Lr[0],Lr[1],Lr[2]),Vo.push([ys[0],ys[1],ys[2]]));rr=Vo}return rr}var fs=!1,qi=!0;if(typeof C=="string")fs=!0;else if(Array.isArray(C)){var qo=C.concat();Je=[];for(var Is,ia=qo.length;ia--;)(typeof(Is=qo.shift())!="string"||Array.isArray(Is)&&typeof Is[0]!="string")&&(qi=!1);fs=qi}if(fs===!1)throw new Error('Type of text must be string or Array. "'+C+'" is not recognized.');typeof C=="string"&&(C=C.match(/[\r?\n]/)?C.split(/\r\n|\r|\n/g):[C]);var uo=Ye/nr.internal.scaleFactor,co=uo*(Ms-1);switch(ve.baseline){case"bottom":fe-=co;break;case"top":fe+=uo-co;break;case"hanging":fe+=uo-2*co;break;case"middle":fe+=uo/2-co}if((an=ve.maxWidth||0)>0&&(typeof C=="string"?C=nr.splitTextToSize(C,an):Object.prototype.toString.call(C)==="[object Array]"&&(C=C.reduce(function(Dn,Cn){return Dn.concat(nr.splitTextToSize(Cn,an))},[]))),$e={text:C,x:q,y:fe,options:ve,mutex:{pdfEscape:dr,activeFontKey:at,fonts:bt,activeFontSize:Ye}},bn.publish("preProcessText",$e),C=$e.text,pt=(ve=$e.options).angle,Cr instanceof Et==0&&pt&&typeof pt=="number"){pt*=Math.PI/180,ve.rotationDirection===0&&(pt=-pt),D===T&&(pt=-pt);var Ll=Math.cos(pt),hs=Math.sin(pt);Cr=new Et(Ll,hs,-hs,Ll,0,0)}else pt&&pt instanceof Et&&(Cr=pt);D!==T||Cr||(Cr=vi),(Yt=ve.charSpace||yi)!==void 0&&(pa+=$(J(Yt))+` Tc
237
- `,this.setCharSpace(this.getCharSpace()||0)),(mr=ve.horizontalScale)!==void 0&&(pa+=$(100*mr)+` Tz
238
- `),ve.lang;var Ua=-1,Fs=ve.renderingMode!==void 0?ve.renderingMode:ve.stroke,Ol=nr.internal.getCurrentPageInfo().pageContext;switch(Fs){case 0:case!1:case"fill":Ua=0;break;case 1:case!0:case"stroke":Ua=1;break;case 2:case"fillThenStroke":Ua=2;break;case 3:case"invisible":Ua=3;break;case 4:case"fillAndAddForClipping":Ua=4;break;case 5:case"strokeAndAddPathForClipping":Ua=5;break;case 6:case"fillThenStrokeAndAddToPathForClipping":Ua=6;break;case 7:case"addToPathForClipping":Ua=7}var Au=Ol.usedRenderingMode!==void 0?Ol.usedRenderingMode:-1;Ua!==-1?pa+=Ua+` Tr
239
- `:Au!==-1&&(pa+=`0 Tr
240
- `),Ua!==-1&&(Ol.usedRenderingMode=Ua),xt=ve.align||"left";var fi,Hi=Ye*Ms,Us=nr.internal.pageSize.getWidth(),Nu=bt[at];Yt=ve.charSpace||yi,an=ve.maxWidth||0,Nn=Object.assign({autoencode:!0,noBOM:!0},ve.flags);var Vi=[],fo=function(Dn){return nr.getStringUnitWidth(Dn,{font:Nu,charSpace:Yt,fontSize:Ye,doKerning:!1})*Ye/zi};if(Object.prototype.toString.call(C)==="[object Array]"){var Xa;Je=Eu(C),xt!=="left"&&(fi=Je.map(fo));var Ba,ds=0;if(xt==="right"){q-=fi[0],C=[],ia=Je.length;for(var ps=0;ps<ia;ps++)ps===0?(Ba=ui(q),Xa=da(fe)):(Ba=J(ds-fi[ps]),Xa=-Hi),C.push([Je[ps],Ba,Xa]),ds=fi[ps]}else if(xt==="center"){q-=fi[0]/2,C=[],ia=Je.length;for(var Bs=0;Bs<ia;Bs++)Bs===0?(Ba=ui(q),Xa=da(fe)):(Ba=J((ds-fi[Bs])/2),Xa=-Hi),C.push([Je[Bs],Ba,Xa]),ds=fi[Bs]}else if(xt==="left"){C=[],ia=Je.length;for(var jl=0;jl<ia;jl++)C.push(Je[jl])}else if(xt==="justify"&&Nu.encoding==="Identity-H"){C=[],ia=Je.length,an=an!==0?an:Us;for(var Rl=0,Tr=0;Tr<ia;Tr++)if(Xa=Tr===0?da(fe):-Hi,Ba=Tr===0?ui(q):Rl,Tr<ia-1){var vc=J((an-fi[Tr])/(Je[Tr].split(" ").length-1)),ms=Je[Tr].split(" ");C.push([ms[0]+" ",Ba,Xa]),Rl=0;for(var gs=1;gs<ms.length;gs++){var ma=(fo(ms[gs-1]+" "+ms[gs])-fo(ms[gs]))*zi+vc;gs==ms.length-1?C.push([ms[gs],ma,0]):C.push([ms[gs]+" ",ma,0]),Rl-=ma}}else C.push([Je[Tr],Ba,Xa]);C.push(["",Rl,0])}else{if(xt!=="justify")throw new Error('Unrecognized alignment option, use "left", "center", "right" or "justify".');for(C=[],ia=Je.length,an=an!==0?an:Us,Tr=0;Tr<ia;Tr++){Xa=Tr===0?da(fe):-Hi,Ba=Tr===0?ui(q):0;var $s=Je[Tr].split(" ").length-1,Dl=$s>0?(an-fi[Tr])/$s:0;Tr<ia-1?Vi.push($(J(Dl))):Vi.push(0),C.push([Je[Tr],Ba,Xa])}}}(typeof ve.R2L=="boolean"?ve.R2L:Ot)===!0&&(C=Tl(C,function(Dn,Cn,rr){return[Dn.split("").reverse().join(""),Cn,rr]})),$e={text:C,x:q,y:fe,options:ve,mutex:{pdfEscape:dr,activeFontKey:at,fonts:bt,activeFontSize:Ye}},bn.publish("postProcessText",$e),C=$e.text,Ir=$e.mutex.isHex||!1;var kl=bt[at].encoding;kl!=="WinAnsiEncoding"&&kl!=="StandardEncoding"||(C=Tl(C,function(Dn,Cn,rr){return[Ps(Dn),Cn,rr]})),Je=Eu(C),C=[];for(var zs,qs,vs,Ho=Array.isArray(Je[0])?1:0,hi="",Hs=function(Dn,Cn,rr){var Lr="";return rr instanceof Et?(rr=typeof ve.angle=="number"?Ui(rr,new Et(1,0,0,1,Dn,Cn)):Ui(new Et(1,0,0,1,Dn,Cn),rr),D===T&&(rr=Ui(new Et(1,0,0,-1,0,0),rr)),Lr=rr.join(" ")+` Tm
241
- `):Lr=$(Dn)+" "+$(Cn)+` Td
242
- `,Lr},Ca=0;Ca<Je.length;Ca++){switch(hi="",Ho){case 1:vs=(Ir?"<":"(")+Je[Ca][0]+(Ir?">":")"),zs=parseFloat(Je[Ca][1]),qs=parseFloat(Je[Ca][2]);break;case 0:vs=(Ir?"<":"(")+Je[Ca]+(Ir?">":")"),zs=ui(q),qs=da(fe)}Vi!==void 0&&Vi[Ca]!==void 0&&(hi=Vi[Ca]+` Tw
243
- `),Ca===0?C.push(hi+Hs(zs,qs,Cr)+vs):Ho===0?C.push(hi+vs):Ho===1&&C.push(hi+Hs(zs,qs,Cr)+vs)}C=Ho===0?C.join(` Tj
244
- T* `):C.join(` Tj
245
- `),C+=` Tj
246
- `;var wi=`BT
247
- /`;return wi+=at+" "+Ye+` Tf
248
- `,wi+=$(Ye*Ms)+` TL
249
- `,wi+=us+`
250
- `,wi+=pa,wi+=C,ee(wi+="ET"),y[at]=!0,nr};var gu=m.__private__.clip=m.clip=function(C){return ee(C==="evenodd"?"W*":"W"),this};m.clipEvenOdd=function(){return gu("evenodd")},m.__private__.discardPath=m.discardPath=function(){return ee("n"),this};var Fa=m.__private__.isValidStyle=function(C){var q=!1;return[void 0,null,"S","D","F","DF","FD","f","f*","B","B*","n"].indexOf(C)!==-1&&(q=!0),q};m.__private__.setDefaultPathOperation=m.setDefaultPathOperation=function(C){return Fa(C)&&(h=C),this};var vu=m.__private__.getStyle=m.getStyle=function(C){var q=h;switch(C){case"D":case"S":q="S";break;case"F":q="f";break;case"FD":case"DF":q="B";break;case"f":case"f*":case"B":case"B*":q=C}return q},yu=m.close=function(){return ee("h"),this};m.stroke=function(){return ee("S"),this},m.fill=function(C){return Bi("f",C),this},m.fillEvenOdd=function(C){return Bi("f*",C),this},m.fillStroke=function(C){return Bi("B",C),this},m.fillStrokeEvenOdd=function(C){return Bi("B*",C),this};var Bi=function(C,q){Rn(q)==="object"?cc(q,C):ee(C)},Io=function(C){C===null||D===T&&C===void 0||(C=vu(C),ee(C))};function uc(C,q,fe,ve,Ee){var $e=new xf(q||this.boundingBox,fe||this.xStep,ve||this.yStep,this.gState,Ee||this.matrix);$e.stream=this.stream;var Je=C+"$$"+this.cloneIndex+++"$$";return de(Je,$e),$e}var cc=function(C,q){var fe=Gn[C.key],ve=Nt[fe];if(ve instanceof Wu)ee("q"),ee(bu(q)),ve.gState&&m.setGState(ve.gState),ee(C.matrix.toString()+" cm"),ee("/"+fe+" sh"),ee("Q");else if(ve instanceof xf){var Ee=new Et(1,0,0,-1,0,ks());C.matrix&&(Ee=Ee.multiply(C.matrix||vi),fe=uc.call(ve,C.key,C.boundingBox,C.xStep,C.yStep,Ee).id),ee("q"),ee("/Pattern cs"),ee("/"+fe+" scn"),ve.gState&&m.setGState(ve.gState),ee(q),ee("Q")}},bu=function(C){switch(C){case"f":case"F":case"n":return"W n";case"f*":return"W* n";case"B":case"S":return"W S";case"B*":return"W* S"}},wu=m.moveTo=function(C,q){return ee($(J(C))+" "+$(ae(q))+" m"),this},fc=m.lineTo=function(C,q){return ee($(J(C))+" "+$(ae(q))+" l"),this},Ja=m.curveTo=function(C,q,fe,ve,Ee,$e){return ee([$(J(C)),$(ae(q)),$(J(fe)),$(ae(ve)),$(J(Ee)),$(ae($e)),"c"].join(" ")),this};m.__private__.line=m.line=function(C,q,fe,ve,Ee){if(isNaN(C)||isNaN(q)||isNaN(fe)||isNaN(ve)||!Fa(Ee))throw new Error("Invalid arguments passed to jsPDF.line");return D===O?this.lines([[fe-C,ve-q]],C,q,[1,1],Ee||"S"):this.lines([[fe-C,ve-q]],C,q,[1,1]).stroke()},m.__private__.lines=m.lines=function(C,q,fe,ve,Ee,$e){var Je,pt,xt,Yt,an,Nn,mr,Cr,nr,Xr,Ir,pa;if(typeof C=="number"&&(pa=fe,fe=q,q=C,C=pa),ve=ve||[1,1],$e=$e||!1,isNaN(q)||isNaN(fe)||!Array.isArray(C)||!Array.isArray(ve)||!Fa(Ee)||typeof $e!="boolean")throw new Error("Invalid arguments passed to jsPDF.lines");for(wu(q,fe),Je=ve[0],pt=ve[1],Yt=C.length,Xr=q,Ir=fe,xt=0;xt<Yt;xt++)(an=C[xt]).length===2?(Xr=an[0]*Je+Xr,Ir=an[1]*pt+Ir,fc(Xr,Ir)):(Nn=an[0]*Je+Xr,mr=an[1]*pt+Ir,Cr=an[2]*Je+Xr,nr=an[3]*pt+Ir,Xr=an[4]*Je+Xr,Ir=an[5]*pt+Ir,Ja(Nn,mr,Cr,nr,Xr,Ir));return $e&&yu(),Io(Ee),this},m.path=function(C){for(var q=0;q<C.length;q++){var fe=C[q],ve=fe.c;switch(fe.op){case"m":wu(ve[0],ve[1]);break;case"l":fc(ve[0],ve[1]);break;case"c":Ja.apply(this,ve);break;case"h":yu()}}return this},m.__private__.rect=m.rect=function(C,q,fe,ve,Ee){if(isNaN(C)||isNaN(q)||isNaN(fe)||isNaN(ve)||!Fa(Ee))throw new Error("Invalid arguments passed to jsPDF.rect");return D===O&&(ve=-ve),ee([$(J(C)),$(ae(q)),$(J(fe)),$(J(ve)),"re"].join(" ")),Io(Ee),this},m.__private__.triangle=m.triangle=function(C,q,fe,ve,Ee,$e,Je){if(isNaN(C)||isNaN(q)||isNaN(fe)||isNaN(ve)||isNaN(Ee)||isNaN($e)||!Fa(Je))throw new Error("Invalid arguments passed to jsPDF.triangle");return this.lines([[fe-C,ve-q],[Ee-fe,$e-ve],[C-Ee,q-$e]],C,q,[1,1],Je,!0),this},m.__private__.roundedRect=m.roundedRect=function(C,q,fe,ve,Ee,$e,Je){if(isNaN(C)||isNaN(q)||isNaN(fe)||isNaN(ve)||isNaN(Ee)||isNaN($e)||!Fa(Je))throw new Error("Invalid arguments passed to jsPDF.roundedRect");var pt=4/3*(Math.SQRT2-1);return Ee=Math.min(Ee,.5*fe),$e=Math.min($e,.5*ve),this.lines([[fe-2*Ee,0],[Ee*pt,0,Ee,$e-$e*pt,Ee,$e],[0,ve-2*$e],[0,$e*pt,-Ee*pt,$e,-Ee,$e],[2*Ee-fe,0],[-Ee*pt,0,-Ee,-$e*pt,-Ee,-$e],[0,2*$e-ve],[0,-$e*pt,Ee*pt,-$e,Ee,-$e]],C+Ee,q,[1,1],Je,!0),this},m.__private__.ellipse=m.ellipse=function(C,q,fe,ve,Ee){if(isNaN(C)||isNaN(q)||isNaN(fe)||isNaN(ve)||!Fa(Ee))throw new Error("Invalid arguments passed to jsPDF.ellipse");var $e=4/3*(Math.SQRT2-1)*fe,Je=4/3*(Math.SQRT2-1)*ve;return wu(C+fe,q),Ja(C+fe,q-Je,C+$e,q-ve,C,q-ve),Ja(C-$e,q-ve,C-fe,q-Je,C-fe,q),Ja(C-fe,q+Je,C-$e,q+ve,C,q+ve),Ja(C+$e,q+ve,C+fe,q+Je,C+fe,q),Io(Ee),this},m.__private__.circle=m.circle=function(C,q,fe,ve){if(isNaN(C)||isNaN(q)||isNaN(fe)||!Fa(ve))throw new Error("Invalid arguments passed to jsPDF.circle");return this.ellipse(C,q,fe,fe,ve)},m.setFont=function(C,q,fe){return fe&&(q=P(q,fe)),at=gn(C,q,{disableWarning:!1}),this};var $i=m.__private__.getFont=m.getFont=function(){return bt[gn.apply(m,arguments)]};m.__private__.getFontList=m.getFontList=function(){var C,q,fe={};for(C in qt)if(qt.hasOwnProperty(C))for(q in fe[C]=[],qt[C])qt[C].hasOwnProperty(q)&&fe[C].push(q);return fe},m.addFont=function(C,q,fe,ve,Ee){var $e=["StandardEncoding","MacRomanEncoding","Identity-H","WinAnsiEncoding"];return arguments[3]&&$e.indexOf(arguments[3])!==-1?Ee=arguments[3]:arguments[3]&&$e.indexOf(arguments[3])==-1&&(fe=P(fe,ve)),Ka.call(this,C,q,fe,Ee=Ee||"Identity-H")};var Ts,Fo=t.lineWidth||.200025,lo=m.__private__.getLineWidth=m.getLineWidth=function(){return Fo},Ut=m.__private__.setLineWidth=m.setLineWidth=function(C){return Fo=C,ee($(J(C))+" w"),this};m.__private__.setLineDash=Lt.API.setLineDash=Lt.API.setLineDashPattern=function(C,q){if(C=C||[],q=q||0,isNaN(q)||!Array.isArray(C))throw new Error("Invalid arguments passed to jsPDF.setLineDash");return C=C.map(function(fe){return $(J(fe))}).join(" "),q=$(J(q)),ee("["+C+"] "+q+" d"),this};var hc=m.__private__.getLineHeight=m.getLineHeight=function(){return Ye*Ts};m.__private__.getLineHeight=m.getLineHeight=function(){return Ye*Ts};var xu=m.__private__.setLineHeightFactor=m.setLineHeightFactor=function(C){return typeof(C=C||1.15)=="number"&&(Ts=C),this},dc=m.__private__.getLineHeightFactor=m.getLineHeightFactor=function(){return Ts};xu(t.lineHeight);var ui=m.__private__.getHorizontalCoordinate=function(C){return J(C)},da=m.__private__.getVerticalCoordinate=function(C){return D===T?C:_t[Y].mediaBox.topRightY-_t[Y].mediaBox.bottomLeftY-J(C)},Su=m.__private__.getHorizontalCoordinateString=m.getHorizontalCoordinateString=function(C){return $(ui(C))},Uo=m.__private__.getVerticalCoordinateString=m.getVerticalCoordinateString=function(C){return $(da(C))},ci=t.strokeColor||"0 G";m.__private__.getStrokeColor=m.getDrawColor=function(){return et(ci)},m.__private__.setStrokeColor=m.setDrawColor=function(C,q,fe,ve){return ci=rt({ch1:C,ch2:q,ch3:fe,ch4:ve,pdfColorType:"draw",precision:2}),ee(ci),this};var Bo=t.fillColor||"0 g";m.__private__.getFillColor=m.getFillColor=function(){return et(Bo)},m.__private__.setFillColor=m.setFillColor=function(C,q,fe,ve){return Bo=rt({ch1:C,ch2:q,ch3:fe,ch4:ve,pdfColorType:"fill",precision:2}),ee(Bo),this};var us=t.textColor||"0 g",pc=m.__private__.getTextColor=m.getTextColor=function(){return et(us)};m.__private__.setTextColor=m.setTextColor=function(C,q,fe,ve){return us=rt({ch1:C,ch2:q,ch3:fe,ch4:ve,pdfColorType:"text",precision:3}),this};var yi=t.charSpace,Al=m.__private__.getCharSpace=m.getCharSpace=function(){return parseFloat(yi||0)};m.__private__.setCharSpace=m.setCharSpace=function(C){if(isNaN(C))throw new Error("Invalid argument passed to jsPDF.setCharSpace");return yi=C,this};var Nl=0;m.CapJoinStyles={0:0,butt:0,but:0,miter:0,1:1,round:1,rounded:1,circle:1,2:2,projecting:2,project:2,square:2,bevel:2},m.__private__.setLineCap=m.setLineCap=function(C){var q=m.CapJoinStyles[C];if(q===void 0)throw new Error("Line cap style of '"+C+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return Nl=q,ee(q+" J"),this};var aa=0;m.__private__.setLineJoin=m.setLineJoin=function(C){var q=m.CapJoinStyles[C];if(q===void 0)throw new Error("Line join style of '"+C+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return aa=q,ee(q+" j"),this},m.__private__.setLineMiterLimit=m.__private__.setMiterLimit=m.setLineMiterLimit=m.setMiterLimit=function(C){if(C=C||0,isNaN(C))throw new Error("Invalid argument passed to jsPDF.setLineMiterLimit");return ee($(J(C))+" M"),this},m.GState=Pm,m.setGState=function(C){(C=typeof C=="string"?Pt[It[C]]:cs(null,C)).equals(Mn)||(ee("/"+C.id+" gs"),Mn=C)};var cs=function(C,q){if(!C||!It[C]){var fe=!1;for(var ve in Pt)if(Pt.hasOwnProperty(ve)&&Pt[ve].equals(q)){fe=!0;break}if(fe)q=Pt[ve];else{var Ee="GS"+(Object.keys(Pt).length+1).toString(10);Pt[Ee]=q,q.id=Ee}return C&&(It[C]=q.id),bn.publish("addGState",q),q}};m.addGState=function(C,q){return cs(C,q),this},m.saveGraphicsState=function(){return ee("q"),pn.push({key:at,size:Ye,color:us}),this},m.restoreGraphicsState=function(){ee("Q");var C=pn.pop();return at=C.key,Ye=C.size,us=C.color,Mn=null,this},m.setCurrentTransformationMatrix=function(C){return ee(C.toString()+" cm"),this},m.comment=function(C){return ee("#"+C),this};var bi=function(C,q){var fe=C||0;Object.defineProperty(this,"x",{enumerable:!0,get:function(){return fe},set:function($e){isNaN($e)||(fe=parseFloat($e))}});var ve=q||0;Object.defineProperty(this,"y",{enumerable:!0,get:function(){return ve},set:function($e){isNaN($e)||(ve=parseFloat($e))}});var Ee="pt";return Object.defineProperty(this,"type",{enumerable:!0,get:function(){return Ee},set:function($e){Ee=$e.toString()}}),this},Ls=function(C,q,fe,ve){bi.call(this,C,q),this.type="rect";var Ee=fe||0;Object.defineProperty(this,"w",{enumerable:!0,get:function(){return Ee},set:function(Je){isNaN(Je)||(Ee=parseFloat(Je))}});var $e=ve||0;return Object.defineProperty(this,"h",{enumerable:!0,get:function(){return $e},set:function(Je){isNaN(Je)||($e=parseFloat(Je))}}),this},Cl=function(){this.page=Qt,this.currentPage=Y,this.pages=Me.slice(0),this.pagesContext=_t.slice(0),this.x=wt,this.y=lr,this.matrix=dn,this.width=js(Y),this.height=_u(Y),this.outputDestination=Be,this.id="",this.objectNumber=-1};Cl.prototype.restore=function(){Qt=this.page,Y=this.currentPage,_t=this.pagesContext,Me=this.pages,wt=this.x,lr=this.y,dn=this.matrix,zo(Y,this.width),Rs(Y,this.height),Be=this.outputDestination};var $o=function(C,q,fe,ve,Ee){ha.push(new Cl),Qt=Y=0,Me=[],wt=C,lr=q,dn=Ee,Ma([fe,ve])};for(var Os in m.beginFormObject=function(C,q,fe,ve,Ee){return $o(C,q,fe,ve,Ee),this},m.endFormObject=function(C){return(function(q){if(ka[q])ha.pop().restore();else{var fe=new Cl,ve="Xo"+(Object.keys(Wr).length+1).toString(10);fe.id=ve,ka[q]=ve,Wr[ve]=fe,bn.publish("addFormObject",fe),ha.pop().restore()}})(C),this},m.doFormObject=function(C,q){var fe=Wr[ka[C]];return ee("q"),ee(q.toString()+" cm"),ee("/"+fe.id+" Do"),ee("Q"),this},m.getFormObject=function(C){var q=Wr[ka[C]];return{x:q.x,y:q.y,width:q.width,height:q.height,matrix:q.matrix}},m.save=function(C,q){return C=C||"generated.pdf",(q=q||{}).returnPromise=q.returnPromise||!1,q.returnPromise===!1?(Vu(ls(li()),C),typeof Vu.unload=="function"&&tn.setTimeout&&setTimeout(Vu.unload,911),this):new Promise(function(fe,ve){try{var Ee=Vu(ls(li()),C);typeof Vu.unload=="function"&&tn.setTimeout&&setTimeout(Vu.unload,911),fe(Ee)}catch($e){ve($e.message)}})},Lt.API)Lt.API.hasOwnProperty(Os)&&(Os==="events"&&Lt.API.events.length?(function(C,q){var fe,ve,Ee;for(Ee=q.length-1;Ee!==-1;Ee--)fe=q[Ee][0],ve=q[Ee][1],C.subscribe.apply(C,[fe].concat(typeof ve=="function"?[ve]:ve))})(bn,Lt.API.events):m[Os]=Lt.API[Os]);function js(C){return _t[C].mediaBox.topRightX-_t[C].mediaBox.bottomLeftX}function zo(C,q){_t[C].mediaBox.topRightX=q+_t[C].mediaBox.bottomLeftX}function _u(C){return _t[C].mediaBox.topRightY-_t[C].mediaBox.bottomLeftY}function Rs(C,q){_t[C].mediaBox.topRightY=q+_t[C].mediaBox.bottomLeftY}var Ds=m.getPageWidth=function(C){return js(C=C||Y)/Xt},mc=m.setPageWidth=function(C,q){zo(C,q*Xt)},ks=m.getPageHeight=function(C){return _u(C=C||Y)/Xt},gc=m.setPageHeight=function(C,q){Rs(C,q*Xt)};return m.internal={pdfEscape:dr,getStyle:vu,getFont:$i,getFontSize:ot,getCharSpace:Al,getTextColor:pc,getLineHeight:hc,getLineHeightFactor:dc,getLineWidth:lo,write:qe,getHorizontalCoordinate:ui,getVerticalCoordinate:da,getCoordinateString:Su,getVerticalCoordinateString:Uo,collections:{},newObject:Ne,newAdditionalObject:ht,newObjectDeferred:He,newObjectDeferredBegin:Xe,getFilters:Ct,putStream:st,events:bn,scaleFactor:Xt,pageSize:{getWidth:function(){return Ds(Y)},setWidth:function(C){mc(Y,C)},getHeight:function(){return ks(Y)},setHeight:function(C){gc(Y,C)}},encryptionOptions:d,encryption:Jr,getEncryptor:function(C){return d!==null?Jr.encryptor(C,0):function(q){return q}},output:mu,getNumberOfPages:ss,get pages(){return Me},out:ee,f2:I,f3:z,getPageInfo:Pr,getPageInfoByObjId:El,getCurrentPageInfo:lc,getPDFVersion:E,Point:bi,Rectangle:Ls,Matrix:Et,hasHotfix:Ia},Object.defineProperty(m.internal.pageSize,"width",{get:function(){return Ds(Y)},set:function(C){mc(Y,C)},enumerable:!0,configurable:!0}),Object.defineProperty(m.internal.pageSize,"height",{get:function(){return ks(Y)},set:function(C){gc(Y,C)},enumerable:!0,configurable:!0}),(function(C){for(var q=0,fe=tt.length;q<fe;q++){var ve=Ka.call(this,C[q][0],C[q][1],C[q][2],tt[q][3],!0);g===!1&&(y[ve]=!0);var Ee=C[q][0].split("-");Xn({id:ve,fontName:Ee[0],fontStyle:Ee[1]||""})}bn.publish("addFonts",{fonts:bt,dictionary:qt})}).call(m,tt),at="F1",Pa(a,n),bn.publish("initialized"),m}vf.prototype.lsbFirstWord=function(t){return String.fromCharCode(255&t,t>>8&255,t>>16&255,t>>24&255)},vf.prototype.toHexString=function(t){return t.split("").map(function(e){return("0"+(255&e.charCodeAt(0)).toString(16)).slice(-2)}).join("")},vf.prototype.hexToBytes=function(t){for(var e=[],n=0;n<t.length;n+=2)e.push(String.fromCharCode(parseInt(t.substr(n,2),16)));return e.join("")},vf.prototype.processOwnerPassword=function(t,e){return Wv(Gv(e).substr(0,5),t)},vf.prototype.encryptor=function(t,e){var n=Gv(this.encryptionKey+String.fromCharCode(255&t,t>>8&255,t>>16&255,255&e,e>>8&255)).substr(0,10);return function(r){return Wv(n,r)}},Pm.prototype.equals=function(t){var e,n="id,objectNumber,equals";if(!t||Rn(t)!==Rn(this))return!1;var r=0;for(e in this)if(!(n.indexOf(e)>=0)){if(this.hasOwnProperty(e)&&!t.hasOwnProperty(e)||this[e]!==t[e])return!1;r++}for(e in t)t.hasOwnProperty(e)&&n.indexOf(e)<0&&r--;return r===0},Lt.API={events:[]},Lt.version="4.0.0";var Hr=Lt.API,M2=1,oc=function(t){return t.replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},ff=function(t){return t.replace(/\\\\/g,"\\").replace(/\\\(/g,"(").replace(/\\\)/g,")")},ln=function(t){return t.toFixed(2)},su=function(t){return t.toFixed(5)};Hr.__acroform__={};var Fi=function(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t},FS=function(t){return t*M2},Co=function(t){var e=new k6,n=yt.internal.getHeight(t)||0,r=yt.internal.getWidth(t)||0;return e.BBox=[0,0,Number(ln(r)),Number(ln(n))],e},jB=Hr.__acroform__.setBit=function(t,e){if(t=t||0,e=e||0,isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBit");return t|1<<e},RB=Hr.__acroform__.clearBit=function(t,e){if(t=t||0,e=e||0,isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBit");return t&~(1<<e)},DB=Hr.__acroform__.getBit=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBit");return t&1<<e?1:0},ea=Hr.__acroform__.getBitForPdf=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBitForPdf");return DB(t,e-1)},ta=Hr.__acroform__.setBitForPdf=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBitForPdf");return jB(t,e-1)},na=Hr.__acroform__.clearBitForPdf=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBitForPdf");return RB(t,e-1)},kB=Hr.__acroform__.calculateCoordinates=function(t,e){var n=e.internal.getHorizontalCoordinate,r=e.internal.getVerticalCoordinate,a=t[0],s=t[1],l=t[2],u=t[3],c={};return c.lowerLeft_X=n(a)||0,c.lowerLeft_Y=r(s+u)||0,c.upperRight_X=n(a+l)||0,c.upperRight_Y=r(s)||0,[Number(ln(c.lowerLeft_X)),Number(ln(c.lowerLeft_Y)),Number(ln(c.upperRight_X)),Number(ln(c.upperRight_Y))]},MB=function(t){if(t.appearanceStreamContent)return t.appearanceStreamContent;if(t.V||t.DV){var e=[],n=t._V||t.DV,r=Kv(t,n),a=t.scope.internal.getFont(t.fontName,t.fontStyle).id;e.push("/Tx BMC"),e.push("q"),e.push("BT"),e.push(t.scope.__private__.encodeColorString(t.color)),e.push("/"+a+" "+ln(r.fontSize)+" Tf"),e.push("1 0 0 1 0 0 Tm"),e.push(r.text),e.push("ET"),e.push("Q"),e.push("EMC");var s=Co(t);return s.scope=t.scope,s.stream=e.join(`
251
- `),s}},Kv=function(t,e){var n=t.fontSize===0?t.maxFontSize:t.fontSize,r={text:"",fontSize:""},a=(e=(e=e.substr(0,1)=="("?e.substr(1):e).substr(e.length-1)==")"?e.substr(0,e.length-1):e).split(" ");a=t.multiline?a.map(function(I){return I.split(`
252
- `)}):a.map(function(I){return[I]});var s=n,l=yt.internal.getHeight(t)||0;l=l<0?-l:l;var u=yt.internal.getWidth(t)||0;u=u<0?-u:u;var c=function(I,z,J){if(I+1<a.length){var ae=z+" "+a[I+1][0];return Vp(ae,t,J).width<=u-4}return!1};s++;e:for(;s>0;){e="",s--;var h,d,g=Vp("3",t,s).height,y=t.multiline?l-s:(l-g)/2,m=y+=2,x=0,E=0,A=0;if(s<=0){e=`(...) Tj
253
- `,e+="% Width of Text: "+Vp(e,t,s=12).width+", FieldWidth:"+u+`
254
- `;break}for(var N="",O=0,T=0;T<a.length;T++)if(a.hasOwnProperty(T)){var D=!1;if(a[T].length!==1&&A!==a[T].length-1){if((g+2)*(O+2)+2>l)continue e;N+=a[T][A],D=!0,E=T,T--}else{N=(N+=a[T][A]+" ").substr(N.length-1)==" "?N.substr(0,N.length-1):N;var F=parseInt(T),Q=c(F,N,s),P=T>=a.length-1;if(Q&&!P){N+=" ",A=0;continue}if(Q||P){if(P)E=F;else if(t.multiline&&(g+2)*(O+2)+2>l)continue e}else{if(!t.multiline||(g+2)*(O+2)+2>l)continue e;E=F}}for(var $="",B=x;B<=E;B++){var ne=a[B];if(t.multiline){if(B===E){$+=ne[A]+" ",A=(A+1)%ne.length;continue}if(B===x){$+=ne[ne.length-1]+" ";continue}}$+=ne[0]+" "}switch($=$.substr($.length-1)==" "?$.substr(0,$.length-1):$,d=Vp($,t,s).width,t.textAlign){case"right":h=u-d-2;break;case"center":h=(u-d)/2;break;default:h=2}e+=ln(h)+" "+ln(m)+` Td
255
- `,e+="("+oc($)+`) Tj
256
- `,e+=-ln(h)+` 0 Td
257
- `,m=-(s+2),d=0,x=D?E:E+1,O++,N=""}break}return r.text=e,r.fontSize=s,r},Vp=function(t,e,n){var r=e.scope.internal.getFont(e.fontName,e.fontStyle),a=e.scope.getStringUnitWidth(t,{font:r,fontSize:parseFloat(n),charSpace:0})*parseFloat(n);return{height:e.scope.getStringUnitWidth("3",{font:r,fontSize:parseFloat(n),charSpace:0})*parseFloat(n)*1.5,width:a}},PB={fields:[],xForms:[],acroFormDictionaryRoot:null,printedOut:!1,internal:null,isInitialized:!1},IB=function(t,e){var n={type:"reference",object:t};e.internal.getPageInfo(t.page).pageContext.annotations.find(function(r){return r.type===n.type&&r.object===n.object})===void 0&&e.internal.getPageInfo(t.page).pageContext.annotations.push(n)},FB=function(t,e){if(e.scope=t,t.internal!==void 0&&(t.internal.acroformPlugin===void 0||t.internal.acroformPlugin.isInitialized===!1)){if(so.FieldNum=0,t.internal.acroformPlugin=JSON.parse(JSON.stringify(PB)),t.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error("Exception while creating AcroformDictionary");M2=t.internal.scaleFactor,t.internal.acroformPlugin.acroFormDictionaryRoot=new M6,t.internal.acroformPlugin.acroFormDictionaryRoot.scope=t,t.internal.acroformPlugin.acroFormDictionaryRoot._eventID=t.internal.events.subscribe("postPutResources",function(){(function(n){n.internal.events.unsubscribe(n.internal.acroformPlugin.acroFormDictionaryRoot._eventID),delete n.internal.acroformPlugin.acroFormDictionaryRoot._eventID,n.internal.acroformPlugin.printedOut=!0})(t)}),t.internal.events.subscribe("buildDocument",function(){(function(n){n.internal.acroformPlugin.acroFormDictionaryRoot.objId=void 0;var r=n.internal.acroformPlugin.acroFormDictionaryRoot.Fields;for(var a in r)if(r.hasOwnProperty(a)){var s=r[a];s.objId=void 0,s.hasAnnotation&&IB(s,n)}})(t)}),t.internal.events.subscribe("putCatalog",function(){(function(n){if(n.internal.acroformPlugin.acroFormDictionaryRoot===void 0)throw new Error("putCatalogCallback: Root missing.");n.internal.write("/AcroForm "+n.internal.acroformPlugin.acroFormDictionaryRoot.objId+" 0 R")})(t)}),t.internal.events.subscribe("postPutPages",function(n){(function(r,a){var s=!r;for(var l in r||(a.internal.newObjectDeferredBegin(a.internal.acroformPlugin.acroFormDictionaryRoot.objId,!0),a.internal.acroformPlugin.acroFormDictionaryRoot.putStream()),r=r||a.internal.acroformPlugin.acroFormDictionaryRoot.Kids)if(r.hasOwnProperty(l)){var u=r[l],c=[],h=u.Rect;if(u.Rect&&(u.Rect=kB(u.Rect,a)),a.internal.newObjectDeferredBegin(u.objId,!0),u.DA=yt.createDefaultAppearanceStream(u),Rn(u)==="object"&&typeof u.getKeyValueListForStream=="function"&&(c=u.getKeyValueListForStream()),u.Rect=h,u.hasAppearanceStream&&!u.appearanceStreamContent){var d=MB(u);c.push({key:"AP",value:"<</N "+d+">>"}),a.internal.acroformPlugin.xForms.push(d)}if(u.appearanceStreamContent){var g="";for(var y in u.appearanceStreamContent)if(u.appearanceStreamContent.hasOwnProperty(y)){var m=u.appearanceStreamContent[y];if(g+="/"+y+" ",g+="<<",Object.keys(m).length>=1||Array.isArray(m)){for(var l in m)if(m.hasOwnProperty(l)){var x=m[l];typeof x=="function"&&(x=x.call(a,u)),g+="/"+l+" "+x+" ",a.internal.acroformPlugin.xForms.indexOf(x)>=0||a.internal.acroformPlugin.xForms.push(x)}}else typeof(x=m)=="function"&&(x=x.call(a,u)),g+="/"+l+" "+x,a.internal.acroformPlugin.xForms.indexOf(x)>=0||a.internal.acroformPlugin.xForms.push(x);g+=">>"}c.push({key:"AP",value:`<<
258
- `+g+">>"})}a.internal.putStream({additionalKeyValues:c,objectId:u.objId}),a.internal.out("endobj")}s&&(function(E,A){for(var N in E)if(E.hasOwnProperty(N)){var O=N,T=E[N];A.internal.newObjectDeferredBegin(T.objId,!0),Rn(T)==="object"&&typeof T.putStream=="function"&&T.putStream(),delete E[O]}})(a.internal.acroformPlugin.xForms,a)})(n,t)}),t.internal.acroformPlugin.isInitialized=!0}},D6=Hr.__acroform__.arrayToPdfArray=function(t,e,n){var r=function(l){return l};if(Array.isArray(t)){for(var a="[",s=0;s<t.length;s++)switch(s!==0&&(a+=" "),Rn(t[s])){case"boolean":case"number":case"object":a+=t[s].toString();break;case"string":t[s].substr(0,1)!=="/"?(e!==void 0&&n&&(r=n.internal.getEncryptor(e)),a+="("+oc(r(t[s].toString()))+")"):a+=t[s].toString()}return a+"]"}throw new Error("Invalid argument passed to jsPDF.__acroform__.arrayToPdfArray")},I1=function(t,e,n){var r=function(a){return a};return e!==void 0&&n&&(r=n.internal.getEncryptor(e)),(t=t||"").toString(),"("+oc(r(t))+")"},jo=function(){this._objId=void 0,this._scope=void 0,Object.defineProperty(this,"objId",{get:function(){if(this._objId===void 0){if(this.scope===void 0)return;this._objId=this.scope.internal.newObjectDeferred()}return this._objId},set:function(t){this._objId=t}}),Object.defineProperty(this,"scope",{value:this._scope,writable:!0})};jo.prototype.toString=function(){return this.objId+" 0 R"},jo.prototype.putStream=function(){var t=this.getKeyValueListForStream();this.scope.internal.putStream({data:this.stream,additionalKeyValues:t,objectId:this.objId}),this.scope.internal.out("endobj")},jo.prototype.getKeyValueListForStream=function(){var t=[],e=Object.getOwnPropertyNames(this).filter(function(s){return s!="content"&&s!="appearanceStreamContent"&&s!="scope"&&s!="objId"&&s.substring(0,1)!="_"});for(var n in e)if(Object.getOwnPropertyDescriptor(this,e[n]).configurable===!1){var r=e[n],a=this[r];a&&(Array.isArray(a)?t.push({key:r,value:D6(a,this.objId,this.scope)}):a instanceof jo?(a.scope=this.scope,t.push({key:r,value:a.objId+" 0 R"})):typeof a!="function"&&t.push({key:r,value:a}))}return t};var k6=function(){jo.call(this),Object.defineProperty(this,"Type",{value:"/XObject",configurable:!1,writable:!0}),Object.defineProperty(this,"Subtype",{value:"/Form",configurable:!1,writable:!0}),Object.defineProperty(this,"FormType",{value:1,configurable:!1,writable:!0});var t,e=[];Object.defineProperty(this,"BBox",{configurable:!1,get:function(){return e},set:function(n){e=n}}),Object.defineProperty(this,"Resources",{value:"2 0 R",configurable:!1,writable:!0}),Object.defineProperty(this,"stream",{enumerable:!1,configurable:!0,set:function(n){t=n.trim()},get:function(){return t||null}})};Fi(k6,jo);var M6=function(){jo.call(this);var t,e=[];Object.defineProperty(this,"Kids",{enumerable:!1,configurable:!0,get:function(){return e.length>0?e:void 0}}),Object.defineProperty(this,"Fields",{enumerable:!1,configurable:!1,get:function(){return e}}),Object.defineProperty(this,"DA",{enumerable:!1,configurable:!1,get:function(){if(t){var n=function(r){return r};return this.scope&&(n=this.scope.internal.getEncryptor(this.objId)),"("+oc(n(t))+")"}},set:function(n){t=n}})};Fi(M6,jo);var so=function t(){jo.call(this);var e=4;Object.defineProperty(this,"F",{enumerable:!1,configurable:!1,get:function(){return e},set:function(N){if(isNaN(N))throw new Error('Invalid value "'+N+'" for attribute F supplied.');e=N}}),Object.defineProperty(this,"showWhenPrinted",{enumerable:!0,configurable:!0,get:function(){return!!ea(e,3)},set:function(N){N?this.F=ta(e,3):this.F=na(e,3)}});var n=0;Object.defineProperty(this,"Ff",{enumerable:!1,configurable:!1,get:function(){return n},set:function(N){if(isNaN(N))throw new Error('Invalid value "'+N+'" for attribute Ff supplied.');n=N}});var r=[];Object.defineProperty(this,"Rect",{enumerable:!1,configurable:!1,get:function(){if(r.length!==0)return r},set:function(N){r=N!==void 0?N:[]}}),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[0])?0:r[0]},set:function(N){r[0]=N}}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[1])?0:r[1]},set:function(N){r[1]=N}}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[2])?0:r[2]},set:function(N){r[2]=N}}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[3])?0:r[3]},set:function(N){r[3]=N}});var a="";Object.defineProperty(this,"FT",{enumerable:!0,configurable:!1,get:function(){return a},set:function(N){switch(N){case"/Btn":case"/Tx":case"/Ch":case"/Sig":a=N;break;default:throw new Error('Invalid value "'+N+'" for attribute FT supplied.')}}});var s=null;Object.defineProperty(this,"T",{enumerable:!0,configurable:!1,get:function(){if(!s||s.length<1){if(this instanceof Im)return;s="FieldObject"+t.FieldNum++}var N=function(O){return O};return this.scope&&(N=this.scope.internal.getEncryptor(this.objId)),"("+oc(N(s))+")"},set:function(N){s=N.toString()}}),Object.defineProperty(this,"fieldName",{configurable:!0,enumerable:!0,get:function(){return s},set:function(N){s=N}});var l="helvetica";Object.defineProperty(this,"fontName",{enumerable:!0,configurable:!0,get:function(){return l},set:function(N){l=N}});var u="normal";Object.defineProperty(this,"fontStyle",{enumerable:!0,configurable:!0,get:function(){return u},set:function(N){u=N}});var c=0;Object.defineProperty(this,"fontSize",{enumerable:!0,configurable:!0,get:function(){return c},set:function(N){c=N}});var h=void 0;Object.defineProperty(this,"maxFontSize",{enumerable:!0,configurable:!0,get:function(){return h===void 0?50/M2:h},set:function(N){h=N}});var d="black";Object.defineProperty(this,"color",{enumerable:!0,configurable:!0,get:function(){return d},set:function(N){d=N}});var g="/F1 0 Tf 0 g";Object.defineProperty(this,"DA",{enumerable:!0,configurable:!1,get:function(){if(!(!g||this instanceof Im||this instanceof tc))return I1(g,this.objId,this.scope)},set:function(N){N=N.toString(),g=N}});var y=null;Object.defineProperty(this,"DV",{enumerable:!1,configurable:!1,get:function(){if(y)return this instanceof Da==0?I1(y,this.objId,this.scope):y},set:function(N){N=N.toString(),y=this instanceof Da==0?N.substr(0,1)==="("?ff(N.substr(1,N.length-2)):ff(N):N}}),Object.defineProperty(this,"defaultValue",{enumerable:!0,configurable:!0,get:function(){return this instanceof Da==1?ff(y.substr(1,y.length-1)):y},set:function(N){N=N.toString(),y=this instanceof Da==1?"/"+N:N}});var m=null;Object.defineProperty(this,"_V",{enumerable:!1,configurable:!1,get:function(){if(m)return m},set:function(N){this.V=N}}),Object.defineProperty(this,"V",{enumerable:!1,configurable:!1,get:function(){if(m)return this instanceof Da==0?I1(m,this.objId,this.scope):m},set:function(N){N=N.toString(),m=this instanceof Da==0?N.substr(0,1)==="("?ff(N.substr(1,N.length-2)):ff(N):N}}),Object.defineProperty(this,"value",{enumerable:!0,configurable:!0,get:function(){return this instanceof Da==1?ff(m.substr(1,m.length-1)):m},set:function(N){N=N.toString(),m=this instanceof Da==1?"/"+N:N}}),Object.defineProperty(this,"hasAnnotation",{enumerable:!0,configurable:!0,get:function(){return this.Rect}}),Object.defineProperty(this,"Type",{enumerable:!0,configurable:!1,get:function(){return this.hasAnnotation?"/Annot":null}}),Object.defineProperty(this,"Subtype",{enumerable:!0,configurable:!1,get:function(){return this.hasAnnotation?"/Widget":null}});var x,E=!1;Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return E},set:function(N){N=!!N,E=N}}),Object.defineProperty(this,"page",{enumerable:!0,configurable:!0,get:function(){if(x)return x},set:function(N){x=N}}),Object.defineProperty(this,"readOnly",{enumerable:!0,configurable:!0,get:function(){return!!ea(this.Ff,1)},set:function(N){N?this.Ff=ta(this.Ff,1):this.Ff=na(this.Ff,1)}}),Object.defineProperty(this,"required",{enumerable:!0,configurable:!0,get:function(){return!!ea(this.Ff,2)},set:function(N){N?this.Ff=ta(this.Ff,2):this.Ff=na(this.Ff,2)}}),Object.defineProperty(this,"noExport",{enumerable:!0,configurable:!0,get:function(){return!!ea(this.Ff,3)},set:function(N){N?this.Ff=ta(this.Ff,3):this.Ff=na(this.Ff,3)}});var A=null;Object.defineProperty(this,"Q",{enumerable:!0,configurable:!1,get:function(){if(A!==null)return A},set:function(N){if([0,1,2].indexOf(N)===-1)throw new Error('Invalid value "'+N+'" for attribute Q supplied.');A=N}}),Object.defineProperty(this,"textAlign",{get:function(){var N;switch(A){case 0:default:N="left";break;case 1:N="center";break;case 2:N="right"}return N},configurable:!0,enumerable:!0,set:function(N){switch(N){case"right":case 2:A=2;break;case"center":case 1:A=1;break;default:A=0}}})};Fi(so,jo);var Lf=function(){so.call(this),this.FT="/Ch",this.V="()",this.fontName="zapfdingbats";var t=0;Object.defineProperty(this,"TI",{enumerable:!0,configurable:!1,get:function(){return t},set:function(n){t=n}}),Object.defineProperty(this,"topIndex",{enumerable:!0,configurable:!0,get:function(){return t},set:function(n){t=n}});var e=[];Object.defineProperty(this,"Opt",{enumerable:!0,configurable:!1,get:function(){return D6(e,this.objId,this.scope)},set:function(n){var r,a;a=[],typeof(r=n)=="string"&&(a=(function(s,l,u){u||(u=1);for(var c,h=[];c=l.exec(s);)h.push(c[u]);return h})(r,/\((.*?)\)/g)),e=a}}),this.getOptions=function(){return e},this.setOptions=function(n){e=n,this.sort&&e.sort()},this.addOption=function(n){n=(n=n||"").toString(),e.push(n),this.sort&&e.sort()},this.removeOption=function(n,r){for(r=r||!1,n=(n=n||"").toString();e.indexOf(n)!==-1&&(e.splice(e.indexOf(n),1),r!==!1););},Object.defineProperty(this,"combo",{enumerable:!0,configurable:!0,get:function(){return!!ea(this.Ff,18)},set:function(n){n?this.Ff=ta(this.Ff,18):this.Ff=na(this.Ff,18)}}),Object.defineProperty(this,"edit",{enumerable:!0,configurable:!0,get:function(){return!!ea(this.Ff,19)},set:function(n){this.combo===!0&&(n?this.Ff=ta(this.Ff,19):this.Ff=na(this.Ff,19))}}),Object.defineProperty(this,"sort",{enumerable:!0,configurable:!0,get:function(){return!!ea(this.Ff,20)},set:function(n){n?(this.Ff=ta(this.Ff,20),e.sort()):this.Ff=na(this.Ff,20)}}),Object.defineProperty(this,"multiSelect",{enumerable:!0,configurable:!0,get:function(){return!!ea(this.Ff,22)},set:function(n){n?this.Ff=ta(this.Ff,22):this.Ff=na(this.Ff,22)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return!!ea(this.Ff,23)},set:function(n){n?this.Ff=ta(this.Ff,23):this.Ff=na(this.Ff,23)}}),Object.defineProperty(this,"commitOnSelChange",{enumerable:!0,configurable:!0,get:function(){return!!ea(this.Ff,27)},set:function(n){n?this.Ff=ta(this.Ff,27):this.Ff=na(this.Ff,27)}}),this.hasAppearanceStream=!1};Fi(Lf,so);var Of=function(){Lf.call(this),this.fontName="helvetica",this.combo=!1};Fi(Of,Lf);var jf=function(){Of.call(this),this.combo=!0};Fi(jf,Of);var im=function(){jf.call(this),this.edit=!0};Fi(im,jf);var Da=function(){so.call(this),this.FT="/Btn",Object.defineProperty(this,"noToggleToOff",{enumerable:!0,configurable:!0,get:function(){return!!ea(this.Ff,15)},set:function(n){n?this.Ff=ta(this.Ff,15):this.Ff=na(this.Ff,15)}}),Object.defineProperty(this,"radio",{enumerable:!0,configurable:!0,get:function(){return!!ea(this.Ff,16)},set:function(n){n?this.Ff=ta(this.Ff,16):this.Ff=na(this.Ff,16)}}),Object.defineProperty(this,"pushButton",{enumerable:!0,configurable:!0,get:function(){return!!ea(this.Ff,17)},set:function(n){n?this.Ff=ta(this.Ff,17):this.Ff=na(this.Ff,17)}}),Object.defineProperty(this,"radioIsUnison",{enumerable:!0,configurable:!0,get:function(){return!!ea(this.Ff,26)},set:function(n){n?this.Ff=ta(this.Ff,26):this.Ff=na(this.Ff,26)}});var t,e={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var n=function(s){return s};if(this.scope&&(n=this.scope.internal.getEncryptor(this.objId)),Object.keys(e).length!==0){var r,a=[];for(r in a.push("<<"),e)a.push("/"+r+" ("+oc(n(e[r]))+")");return a.push(">>"),a.join(`
259
- `)}},set:function(n){Rn(n)==="object"&&(e=n)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return e.CA||""},set:function(n){typeof n=="string"&&(e.CA=n)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return t},set:function(n){t=n}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return t.substr(1,t.length-1)},set:function(n){t="/"+n}})};Fi(Da,so);var sm=function(){Da.call(this),this.pushButton=!0};Fi(sm,Da);var Rf=function(){Da.call(this),this.radio=!0,this.pushButton=!1;var t=[];Object.defineProperty(this,"Kids",{enumerable:!0,configurable:!1,get:function(){return t},set:function(e){t=e!==void 0?e:[]}})};Fi(Rf,Da);var Im=function(){var t,e;so.call(this),Object.defineProperty(this,"Parent",{enumerable:!1,configurable:!1,get:function(){return t},set:function(a){t=a}}),Object.defineProperty(this,"optionName",{enumerable:!1,configurable:!0,get:function(){return e},set:function(a){e=a}});var n,r={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var a=function(u){return u};this.scope&&(a=this.scope.internal.getEncryptor(this.objId));var s,l=[];for(s in l.push("<<"),r)l.push("/"+s+" ("+oc(a(r[s]))+")");return l.push(">>"),l.join(`
260
- `)},set:function(a){Rn(a)==="object"&&(r=a)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return r.CA||""},set:function(a){typeof a=="string"&&(r.CA=a)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return n},set:function(a){n=a}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return n.substr(1,n.length-1)},set:function(a){n="/"+a}}),this.caption="l",this.appearanceState="Off",this._AppearanceType=yt.RadioButton.Circle,this.appearanceStreamContent=this._AppearanceType.createAppearanceStream(this.optionName)};Fi(Im,so),Rf.prototype.setAppearance=function(t){if(!("createAppearanceStream"in t)||!("getCA"in t))throw new Error("Couldn't assign Appearance to RadioButton. Appearance was Invalid!");for(var e in this.Kids)if(this.Kids.hasOwnProperty(e)){var n=this.Kids[e];n.appearanceStreamContent=t.createAppearanceStream(n.optionName),n.caption=t.getCA()}},Rf.prototype.createOption=function(t){var e=new Im;return e.Parent=this,e.optionName=t,this.Kids.push(e),UB.call(this.scope,e),e};var om=function(){Da.call(this),this.fontName="zapfdingbats",this.caption="3",this.appearanceState="On",this.value="On",this.textAlign="center",this.appearanceStreamContent=yt.CheckBox.createAppearanceStream()};Fi(om,Da);var tc=function(){so.call(this),this.FT="/Tx",Object.defineProperty(this,"multiline",{enumerable:!0,configurable:!0,get:function(){return!!ea(this.Ff,13)},set:function(e){e?this.Ff=ta(this.Ff,13):this.Ff=na(this.Ff,13)}}),Object.defineProperty(this,"fileSelect",{enumerable:!0,configurable:!0,get:function(){return!!ea(this.Ff,21)},set:function(e){e?this.Ff=ta(this.Ff,21):this.Ff=na(this.Ff,21)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return!!ea(this.Ff,23)},set:function(e){e?this.Ff=ta(this.Ff,23):this.Ff=na(this.Ff,23)}}),Object.defineProperty(this,"doNotScroll",{enumerable:!0,configurable:!0,get:function(){return!!ea(this.Ff,24)},set:function(e){e?this.Ff=ta(this.Ff,24):this.Ff=na(this.Ff,24)}}),Object.defineProperty(this,"comb",{enumerable:!0,configurable:!0,get:function(){return!!ea(this.Ff,25)},set:function(e){e?this.Ff=ta(this.Ff,25):this.Ff=na(this.Ff,25)}}),Object.defineProperty(this,"richText",{enumerable:!0,configurable:!0,get:function(){return!!ea(this.Ff,26)},set:function(e){e?this.Ff=ta(this.Ff,26):this.Ff=na(this.Ff,26)}});var t=null;Object.defineProperty(this,"MaxLen",{enumerable:!0,configurable:!1,get:function(){return t},set:function(e){t=e}}),Object.defineProperty(this,"maxLength",{enumerable:!0,configurable:!0,get:function(){return t},set:function(e){Number.isInteger(e)&&(t=e)}}),Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return this.V||this.DV}})};Fi(tc,so);var lm=function(){tc.call(this),Object.defineProperty(this,"password",{enumerable:!0,configurable:!0,get:function(){return!!ea(this.Ff,14)},set:function(t){t?this.Ff=ta(this.Ff,14):this.Ff=na(this.Ff,14)}}),this.password=!0};Fi(lm,tc);var yt={CheckBox:{createAppearanceStream:function(){return{N:{On:yt.CheckBox.YesNormal},D:{On:yt.CheckBox.YesPushDown,Off:yt.CheckBox.OffPushDown}}},YesPushDown:function(t){var e=Co(t);e.scope=t.scope;var n=[],r=t.scope.internal.getFont(t.fontName,t.fontStyle).id,a=t.scope.__private__.encodeColorString(t.color),s=Kv(t,t.caption);return n.push("0.749023 g"),n.push("0 0 "+ln(yt.internal.getWidth(t))+" "+ln(yt.internal.getHeight(t))+" re"),n.push("f"),n.push("BMC"),n.push("q"),n.push("0 0 1 rg"),n.push("/"+r+" "+ln(s.fontSize)+" Tf "+a),n.push("BT"),n.push(s.text),n.push("ET"),n.push("Q"),n.push("EMC"),e.stream=n.join(`
261
- `),e},YesNormal:function(t){var e=Co(t);e.scope=t.scope;var n=t.scope.internal.getFont(t.fontName,t.fontStyle).id,r=t.scope.__private__.encodeColorString(t.color),a=[],s=yt.internal.getHeight(t),l=yt.internal.getWidth(t),u=Kv(t,t.caption);return a.push("1 g"),a.push("0 0 "+ln(l)+" "+ln(s)+" re"),a.push("f"),a.push("q"),a.push("0 0 1 rg"),a.push("0 0 "+ln(l-1)+" "+ln(s-1)+" re"),a.push("W"),a.push("n"),a.push("0 g"),a.push("BT"),a.push("/"+n+" "+ln(u.fontSize)+" Tf "+r),a.push(u.text),a.push("ET"),a.push("Q"),e.stream=a.join(`
262
- `),e},OffPushDown:function(t){var e=Co(t);e.scope=t.scope;var n=[];return n.push("0.749023 g"),n.push("0 0 "+ln(yt.internal.getWidth(t))+" "+ln(yt.internal.getHeight(t))+" re"),n.push("f"),e.stream=n.join(`
263
- `),e}},RadioButton:{Circle:{createAppearanceStream:function(t){var e={D:{Off:yt.RadioButton.Circle.OffPushDown},N:{}};return e.N[t]=yt.RadioButton.Circle.YesNormal,e.D[t]=yt.RadioButton.Circle.YesPushDown,e},getCA:function(){return"l"},YesNormal:function(t){var e=Co(t);e.scope=t.scope;var n=[],r=yt.internal.getWidth(t)<=yt.internal.getHeight(t)?yt.internal.getWidth(t)/4:yt.internal.getHeight(t)/4;r=Number((.9*r).toFixed(5));var a=yt.internal.Bezier_C,s=Number((r*a).toFixed(5));return n.push("q"),n.push("1 0 0 1 "+su(yt.internal.getWidth(t)/2)+" "+su(yt.internal.getHeight(t)/2)+" cm"),n.push(r+" 0 m"),n.push(r+" "+s+" "+s+" "+r+" 0 "+r+" c"),n.push("-"+s+" "+r+" -"+r+" "+s+" -"+r+" 0 c"),n.push("-"+r+" -"+s+" -"+s+" -"+r+" 0 -"+r+" c"),n.push(s+" -"+r+" "+r+" -"+s+" "+r+" 0 c"),n.push("f"),n.push("Q"),e.stream=n.join(`
264
- `),e},YesPushDown:function(t){var e=Co(t);e.scope=t.scope;var n=[],r=yt.internal.getWidth(t)<=yt.internal.getHeight(t)?yt.internal.getWidth(t)/4:yt.internal.getHeight(t)/4;r=Number((.9*r).toFixed(5));var a=Number((2*r).toFixed(5)),s=Number((a*yt.internal.Bezier_C).toFixed(5)),l=Number((r*yt.internal.Bezier_C).toFixed(5));return n.push("0.749023 g"),n.push("q"),n.push("1 0 0 1 "+su(yt.internal.getWidth(t)/2)+" "+su(yt.internal.getHeight(t)/2)+" cm"),n.push(a+" 0 m"),n.push(a+" "+s+" "+s+" "+a+" 0 "+a+" c"),n.push("-"+s+" "+a+" -"+a+" "+s+" -"+a+" 0 c"),n.push("-"+a+" -"+s+" -"+s+" -"+a+" 0 -"+a+" c"),n.push(s+" -"+a+" "+a+" -"+s+" "+a+" 0 c"),n.push("f"),n.push("Q"),n.push("0 g"),n.push("q"),n.push("1 0 0 1 "+su(yt.internal.getWidth(t)/2)+" "+su(yt.internal.getHeight(t)/2)+" cm"),n.push(r+" 0 m"),n.push(r+" "+l+" "+l+" "+r+" 0 "+r+" c"),n.push("-"+l+" "+r+" -"+r+" "+l+" -"+r+" 0 c"),n.push("-"+r+" -"+l+" -"+l+" -"+r+" 0 -"+r+" c"),n.push(l+" -"+r+" "+r+" -"+l+" "+r+" 0 c"),n.push("f"),n.push("Q"),e.stream=n.join(`
265
- `),e},OffPushDown:function(t){var e=Co(t);e.scope=t.scope;var n=[],r=yt.internal.getWidth(t)<=yt.internal.getHeight(t)?yt.internal.getWidth(t)/4:yt.internal.getHeight(t)/4;r=Number((.9*r).toFixed(5));var a=Number((2*r).toFixed(5)),s=Number((a*yt.internal.Bezier_C).toFixed(5));return n.push("0.749023 g"),n.push("q"),n.push("1 0 0 1 "+su(yt.internal.getWidth(t)/2)+" "+su(yt.internal.getHeight(t)/2)+" cm"),n.push(a+" 0 m"),n.push(a+" "+s+" "+s+" "+a+" 0 "+a+" c"),n.push("-"+s+" "+a+" -"+a+" "+s+" -"+a+" 0 c"),n.push("-"+a+" -"+s+" -"+s+" -"+a+" 0 -"+a+" c"),n.push(s+" -"+a+" "+a+" -"+s+" "+a+" 0 c"),n.push("f"),n.push("Q"),e.stream=n.join(`
266
- `),e}},Cross:{createAppearanceStream:function(t){var e={D:{Off:yt.RadioButton.Cross.OffPushDown},N:{}};return e.N[t]=yt.RadioButton.Cross.YesNormal,e.D[t]=yt.RadioButton.Cross.YesPushDown,e},getCA:function(){return"8"},YesNormal:function(t){var e=Co(t);e.scope=t.scope;var n=[],r=yt.internal.calculateCross(t);return n.push("q"),n.push("1 1 "+ln(yt.internal.getWidth(t)-2)+" "+ln(yt.internal.getHeight(t)-2)+" re"),n.push("W"),n.push("n"),n.push(ln(r.x1.x)+" "+ln(r.x1.y)+" m"),n.push(ln(r.x2.x)+" "+ln(r.x2.y)+" l"),n.push(ln(r.x4.x)+" "+ln(r.x4.y)+" m"),n.push(ln(r.x3.x)+" "+ln(r.x3.y)+" l"),n.push("s"),n.push("Q"),e.stream=n.join(`
267
- `),e},YesPushDown:function(t){var e=Co(t);e.scope=t.scope;var n=yt.internal.calculateCross(t),r=[];return r.push("0.749023 g"),r.push("0 0 "+ln(yt.internal.getWidth(t))+" "+ln(yt.internal.getHeight(t))+" re"),r.push("f"),r.push("q"),r.push("1 1 "+ln(yt.internal.getWidth(t)-2)+" "+ln(yt.internal.getHeight(t)-2)+" re"),r.push("W"),r.push("n"),r.push(ln(n.x1.x)+" "+ln(n.x1.y)+" m"),r.push(ln(n.x2.x)+" "+ln(n.x2.y)+" l"),r.push(ln(n.x4.x)+" "+ln(n.x4.y)+" m"),r.push(ln(n.x3.x)+" "+ln(n.x3.y)+" l"),r.push("s"),r.push("Q"),e.stream=r.join(`
268
- `),e},OffPushDown:function(t){var e=Co(t);e.scope=t.scope;var n=[];return n.push("0.749023 g"),n.push("0 0 "+ln(yt.internal.getWidth(t))+" "+ln(yt.internal.getHeight(t))+" re"),n.push("f"),e.stream=n.join(`
269
- `),e}}},createDefaultAppearanceStream:function(t){var e=t.scope.internal.getFont(t.fontName,t.fontStyle).id,n=t.scope.__private__.encodeColorString(t.color);return"/"+e+" "+t.fontSize+" Tf "+n}};yt.internal={Bezier_C:.551915024494,calculateCross:function(t){var e=yt.internal.getWidth(t),n=yt.internal.getHeight(t),r=Math.min(e,n);return{x1:{x:(e-r)/2,y:(n-r)/2+r},x2:{x:(e-r)/2+r,y:(n-r)/2},x3:{x:(e-r)/2,y:(n-r)/2},x4:{x:(e-r)/2+r,y:(n-r)/2+r}}}},yt.internal.getWidth=function(t){var e=0;return Rn(t)==="object"&&(e=FS(t.Rect[2])),e},yt.internal.getHeight=function(t){var e=0;return Rn(t)==="object"&&(e=FS(t.Rect[3])),e};var UB=Hr.addField=function(t){if(FB(this,t),!(t instanceof so))throw new Error("Invalid argument passed to jsPDF.addField.");var e;return(e=t).scope.internal.acroformPlugin.printedOut&&(e.scope.internal.acroformPlugin.printedOut=!1,e.scope.internal.acroformPlugin.acroFormDictionaryRoot=null),e.scope.internal.acroformPlugin.acroFormDictionaryRoot.Fields.push(e),t.page=t.scope.internal.getCurrentPageInfo().pageNumber,this};Hr.AcroFormChoiceField=Lf,Hr.AcroFormListBox=Of,Hr.AcroFormComboBox=jf,Hr.AcroFormEditBox=im,Hr.AcroFormButton=Da,Hr.AcroFormPushButton=sm,Hr.AcroFormRadioButton=Rf,Hr.AcroFormCheckBox=om,Hr.AcroFormTextField=tc,Hr.AcroFormPasswordField=lm,Hr.AcroFormAppearance=yt,Hr.AcroForm={ChoiceField:Lf,ListBox:Of,ComboBox:jf,EditBox:im,Button:Da,PushButton:sm,RadioButton:Rf,CheckBox:om,TextField:tc,PasswordField:lm,Appearance:yt},Lt.AcroForm={ChoiceField:Lf,ListBox:Of,ComboBox:jf,EditBox:im,Button:Da,PushButton:sm,RadioButton:Rf,CheckBox:om,TextField:tc,PasswordField:lm,Appearance:yt};Lt.AcroForm;function P6(t){return t.reduce(function(e,n,r){return e[n]=r,e},{})}(function(t){var e="addImage_";t.__addimage__={};var n="UNKNOWN",r={PNG:[[137,80,78,71]],TIFF:[[77,77,0,42],[73,73,42,0]],JPEG:[[255,216,255,224,void 0,void 0,74,70,73,70,0],[255,216,255,225,void 0,void 0,69,120,105,102,0,0],[255,216,255,219],[255,216,255,238]],JPEG2000:[[0,0,0,12,106,80,32,32]],GIF87a:[[71,73,70,56,55,97]],GIF89a:[[71,73,70,56,57,97]],WEBP:[[82,73,70,70,void 0,void 0,void 0,void 0,87,69,66,80]],BMP:[[66,77],[66,65],[67,73],[67,80],[73,67],[80,84]]},a=t.__addimage__.getImageFileTypeByImageData=function(I,z){var J,ae,me,Z,ce,oe=n;if((z=z||n)==="RGBA"||I.data!==void 0&&I.data instanceof Uint8ClampedArray&&"height"in I&&"width"in I)return"RGBA";if(Q(I))for(ce in r)for(me=r[ce],J=0;J<me.length;J+=1){for(Z=!0,ae=0;ae<me[J].length;ae+=1)if(me[J][ae]!==void 0&&me[J][ae]!==I[ae]){Z=!1;break}if(Z===!0){oe=ce;break}}else for(ce in r)for(me=r[ce],J=0;J<me.length;J+=1){for(Z=!0,ae=0;ae<me[J].length;ae+=1)if(me[J][ae]!==void 0&&me[J][ae]!==I.charCodeAt(ae)){Z=!1;break}if(Z===!0){oe=ce;break}}return oe===n&&z!==n&&(oe=z),oe},s=function I(z){for(var J=this.internal.write,ae=this.internal.putStream,me=(0,this.internal.getFilters)();me.indexOf("FlateEncode")!==-1;)me.splice(me.indexOf("FlateEncode"),1);z.objectId=this.internal.newObject();var Z=[];if(Z.push({key:"Type",value:"/XObject"}),Z.push({key:"Subtype",value:"/Image"}),Z.push({key:"Width",value:z.width}),Z.push({key:"Height",value:z.height}),z.colorSpace===N.INDEXED?Z.push({key:"ColorSpace",value:"[/Indexed /DeviceRGB "+(z.palette.length/3-1)+" "+("sMask"in z&&z.sMask!==void 0?z.objectId+2:z.objectId+1)+" 0 R]"}):(Z.push({key:"ColorSpace",value:"/"+z.colorSpace}),z.colorSpace===N.DEVICE_CMYK&&Z.push({key:"Decode",value:"[1 0 1 0 1 0 1 0]"})),Z.push({key:"BitsPerComponent",value:z.bitsPerComponent}),"decodeParameters"in z&&z.decodeParameters!==void 0&&Z.push({key:"DecodeParms",value:"<<"+z.decodeParameters+">>"}),"transparency"in z&&Array.isArray(z.transparency)&&z.transparency.length>0){for(var ce="",oe=0,ge=z.transparency.length;oe<ge;oe++)ce+=z.transparency[oe]+" "+z.transparency[oe]+" ";Z.push({key:"Mask",value:"["+ce+"]"})}z.sMask!==void 0&&Z.push({key:"SMask",value:z.objectId+1+" 0 R"});var he=z.filter!==void 0?["/"+z.filter]:void 0;if(ae({data:z.data,additionalKeyValues:Z,alreadyAppliedFilters:he,objectId:z.objectId}),J("endobj"),"sMask"in z&&z.sMask!==void 0){var U,j=(U=z.sMaskBitsPerComponent)!==null&&U!==void 0?U:z.bitsPerComponent,Y={width:z.width,height:z.height,colorSpace:"DeviceGray",bitsPerComponent:j,data:z.sMask};"filter"in z&&(Y.decodeParameters="/Predictor ".concat(z.predictor," /Colors 1 /BitsPerComponent ").concat(j," /Columns ").concat(z.width),Y.filter=z.filter),I.call(this,Y)}if(z.colorSpace===N.INDEXED){var K=this.internal.newObject();ae({data:$(new Uint8Array(z.palette)),objectId:K}),J("endobj")}},l=function(){var I=this.internal.collections[e+"images"];for(var z in I)s.call(this,I[z])},u=function(){var I,z=this.internal.collections[e+"images"],J=this.internal.write;for(var ae in z)J("/I"+(I=z[ae]).index,I.objectId,"0","R")},c=function(){this.internal.collections[e+"images"]||(this.internal.collections[e+"images"]={},this.internal.events.subscribe("putResources",l),this.internal.events.subscribe("putXobjectDict",u))},h=function(){var I=this.internal.collections[e+"images"];return c.call(this),I},d=function(){return Object.keys(this.internal.collections[e+"images"]).length},g=function(I){return typeof t["process"+I.toUpperCase()]=="function"},y=function(I){return Rn(I)==="object"&&I.nodeType===1},m=function(I,z){if(I.nodeName==="IMG"&&I.hasAttribute("src")){var J=""+I.getAttribute("src");if(J.indexOf("data:image/")===0)return am(unescape(J).split("base64,").pop());var ae=t.loadFile(J,!0);if(ae!==void 0)return ae}if(I.nodeName==="CANVAS"){if(I.width===0||I.height===0)throw new Error("Given canvas must have data. Canvas width: "+I.width+", height: "+I.height);var me;switch(z){case"PNG":me="image/png";break;case"WEBP":me="image/webp";break;default:me="image/jpeg"}return am(I.toDataURL(me,1).split("base64,").pop())}},x=function(I){var z=this.internal.collections[e+"images"];if(z){for(var J in z)if(I===z[J].alias)return z[J]}},E=function(I,z,J){return I||z||(I=-96,z=-96),I<0&&(I=-1*J.width*72/I/this.internal.scaleFactor),z<0&&(z=-1*J.height*72/z/this.internal.scaleFactor),I===0&&(I=z*J.width/J.height),z===0&&(z=I*J.height/J.width),[I,z]},A=function(I,z,J,ae,me,Z){var ce=E.call(this,J,ae,me),oe=this.internal.getCoordinateString,ge=this.internal.getVerticalCoordinateString,he=h.call(this);if(J=ce[0],ae=ce[1],he[me.index]=me,Z){Z*=Math.PI/180;var U=Math.cos(Z),j=Math.sin(Z),Y=function(ie){return ie.toFixed(4)},K=[Y(U),Y(j),Y(-1*j),Y(U),0,0,"cm"]}this.internal.write("q"),Z?(this.internal.write([1,"0","0",1,oe(I),ge(z+ae),"cm"].join(" ")),this.internal.write(K.join(" ")),this.internal.write([oe(J),"0","0",oe(ae),"0","0","cm"].join(" "))):this.internal.write([oe(J),"0","0",oe(ae),oe(I),ge(z+ae),"cm"].join(" ")),this.isAdvancedAPI()&&this.internal.write([1,0,0,-1,0,0,"cm"].join(" ")),this.internal.write("/I"+me.index+" Do"),this.internal.write("Q")},N=t.color_spaces={DEVICE_RGB:"DeviceRGB",DEVICE_GRAY:"DeviceGray",DEVICE_CMYK:"DeviceCMYK",CAL_GREY:"CalGray",CAL_RGB:"CalRGB",LAB:"Lab",ICC_BASED:"ICCBased",INDEXED:"Indexed",PATTERN:"Pattern",SEPARATION:"Separation",DEVICE_N:"DeviceN"};t.decode={DCT_DECODE:"DCTDecode",FLATE_DECODE:"FlateDecode",LZW_DECODE:"LZWDecode",JPX_DECODE:"JPXDecode",JBIG2_DECODE:"JBIG2Decode",ASCII85_DECODE:"ASCII85Decode",ASCII_HEX_DECODE:"ASCIIHexDecode",RUN_LENGTH_DECODE:"RunLengthDecode",CCITT_FAX_DECODE:"CCITTFaxDecode"};var O=t.image_compression={NONE:"NONE",FAST:"FAST",MEDIUM:"MEDIUM",SLOW:"SLOW"},T=t.__addimage__.sHashCode=function(I){var z,J,ae=0;if(typeof I=="string")for(J=I.length,z=0;z<J;z++)ae=(ae<<5)-ae+I.charCodeAt(z),ae|=0;else if(Q(I))for(J=I.byteLength/2,z=0;z<J;z++)ae=(ae<<5)-ae+I[z],ae|=0;return ae},D=t.__addimage__.validateStringAsBase64=function(I){(I=I||"").toString().trim();var z=!0;return I.length===0&&(z=!1),I.length%4!=0&&(z=!1),/^[A-Za-z0-9+/]+$/.test(I.substr(0,I.length-2))===!1&&(z=!1),/^[A-Za-z0-9/][A-Za-z0-9+/]|[A-Za-z0-9+/]=|==$/.test(I.substr(-2))===!1&&(z=!1),z},F=t.__addimage__.extractImageFromDataUrl=function(I){if(I==null||!(I=I.trim()).startsWith("data:"))return null;var z=I.indexOf(",");return z<0?null:I.substring(0,z).trim().endsWith("base64")?I.substring(z+1):null};t.__addimage__.isArrayBuffer=function(I){return I instanceof ArrayBuffer};var Q=t.__addimage__.isArrayBufferView=function(I){return I instanceof Int8Array||I instanceof Uint8Array||I instanceof Uint8ClampedArray||I instanceof Int16Array||I instanceof Uint16Array||I instanceof Int32Array||I instanceof Uint32Array||I instanceof Float32Array||I instanceof Float64Array},P=t.__addimage__.binaryStringToUint8Array=function(I){for(var z=I.length,J=new Uint8Array(z),ae=0;ae<z;ae++)J[ae]=I.charCodeAt(ae);return J},$=t.__addimage__.arrayBufferToBinaryString=function(I){for(var z="",J=Q(I)?I:new Uint8Array(I),ae=0;ae<J.length;ae+=8192)z+=String.fromCharCode.apply(null,J.subarray(ae,ae+8192));return z};t.addImage=function(){var I,z,J,ae,me,Z,ce,oe,ge;if(typeof arguments[1]=="number"?(z=n,J=arguments[1],ae=arguments[2],me=arguments[3],Z=arguments[4],ce=arguments[5],oe=arguments[6],ge=arguments[7]):(z=arguments[1],J=arguments[2],ae=arguments[3],me=arguments[4],Z=arguments[5],ce=arguments[6],oe=arguments[7],ge=arguments[8]),Rn(I=arguments[0])==="object"&&!y(I)&&"imageData"in I){var he=I;I=he.imageData,z=he.format||z||n,J=he.x||J||0,ae=he.y||ae||0,me=he.w||he.width||me,Z=he.h||he.height||Z,ce=he.alias||ce,oe=he.compression||oe,ge=he.rotation||he.angle||ge}var U=this.internal.getFilters();if(oe===void 0&&U.indexOf("FlateEncode")!==-1&&(oe="SLOW"),isNaN(J)||isNaN(ae))throw new Error("Invalid coordinates passed to jsPDF.addImage");c.call(this);var j=B.call(this,I,z,ce,oe);return A.call(this,J,ae,me,Z,j,ge),this};var B=function(I,z,J,ae){var me,Z,ce;if(typeof I=="string"&&a(I)===n){I=unescape(I);var oe=ne(I,!1);(oe!==""||(oe=t.loadFile(I,!0))!==void 0)&&(I=oe)}if(y(I)&&(I=m(I,z)),z=a(I,z),!g(z))throw new Error("addImage does not support files of type '"+z+"', please ensure that a plugin for '"+z+"' support is added.");if(((ce=J)==null||ce.length===0)&&(J=(function(ge){return typeof ge=="string"||Q(ge)?T(ge):Q(ge.data)?T(ge.data):null})(I)),(me=x.call(this,J))||(I instanceof Uint8Array||z==="RGBA"||(Z=I,I=P(I)),me=this["process"+z.toUpperCase()](I,d.call(this),J,(function(ge){return ge&&typeof ge=="string"&&(ge=ge.toUpperCase()),ge in t.image_compression?ge:O.NONE})(ae),Z)),!me)throw new Error("An unknown error occurred whilst processing the image.");return me},ne=t.__addimage__.convertBase64ToBinaryString=function(I,z){z=typeof z!="boolean"||z;var J,ae="";if(typeof I=="string"){var me;J=(me=F(I))!==null&&me!==void 0?me:I;try{ae=am(J)}catch(Z){if(z)throw D(J)?new Error("atob-Error in jsPDF.convertBase64ToBinaryString "+Z.message):new Error("Supplied Data is not a valid base64-String jsPDF.convertBase64ToBinaryString ")}}return ae};t.getImageProperties=function(I){var z,J,ae="";if(y(I)&&(I=m(I)),typeof I=="string"&&a(I)===n&&((ae=ne(I,!1))===""&&(ae=t.loadFile(I)||""),I=ae),J=a(I),!g(J))throw new Error("addImage does not support files of type '"+J+"', please ensure that a plugin for '"+J+"' support is added.");if(I instanceof Uint8Array||(I=P(I)),!(z=this["process"+J.toUpperCase()](I)))throw new Error("An unknown error occurred whilst processing the image");return z.fileType=J,z}})(Lt.API),(function(t){var e=function(n){if(n!==void 0&&n!="")return!0};Lt.API.events.push(["addPage",function(n){this.internal.getPageInfo(n.pageNumber).pageContext.annotations=[]}]),t.events.push(["putPage",function(n){for(var r,a,s,l=this.internal.getCoordinateString,u=this.internal.getVerticalCoordinateString,c=this.internal.getPageInfoByObjId(n.objId),h=n.pageContext.annotations,d=!1,g=0;g<h.length&&!d;g++)switch((r=h[g]).type){case"link":(e(r.options.url)||e(r.options.pageNumber))&&(d=!0);break;case"reference":case"text":case"freetext":d=!0}if(d!=0){this.internal.write("/Annots [");for(var y=0;y<h.length;y++){r=h[y];var m=this.internal.pdfEscape,x=this.internal.getEncryptor(n.objId);switch(r.type){case"reference":this.internal.write(" "+r.object.objId+" 0 R ");break;case"text":var E=this.internal.newAdditionalObject(),A=this.internal.newAdditionalObject(),N=this.internal.getEncryptor(E.objId),O=r.title||"Note";s="<</Type /Annot /Subtype /Text "+(a="/Rect ["+l(r.bounds.x)+" "+u(r.bounds.y+r.bounds.h)+" "+l(r.bounds.x+r.bounds.w)+" "+u(r.bounds.y)+"] ")+"/Contents ("+m(N(r.contents))+")",s+=" /Popup "+A.objId+" 0 R",s+=" /P "+c.objId+" 0 R",s+=" /T ("+m(N(O))+") >>",E.content=s;var T=E.objId+" 0 R";s="<</Type /Annot /Subtype /Popup "+(a="/Rect ["+l(r.bounds.x+30)+" "+u(r.bounds.y+r.bounds.h)+" "+l(r.bounds.x+r.bounds.w+30)+" "+u(r.bounds.y)+"] ")+" /Parent "+T,r.open&&(s+=" /Open true"),s+=" >>",A.content=s,this.internal.write(E.objId,"0 R",A.objId,"0 R");break;case"freetext":a="/Rect ["+l(r.bounds.x)+" "+u(r.bounds.y)+" "+l(r.bounds.x+r.bounds.w)+" "+u(r.bounds.y+r.bounds.h)+"] ";var D=r.color||"#000000";s="<</Type /Annot /Subtype /FreeText "+a+"/Contents ("+m(x(r.contents))+")",s+=" /DS(font: Helvetica,sans-serif 12.0pt; text-align:left; color:#"+D+")",s+=" /Border [0 0 0]",s+=" >>",this.internal.write(s);break;case"link":if(r.options.name){var F=this.annotations._nameMap[r.options.name];r.options.pageNumber=F.page,r.options.top=F.y}else r.options.top||(r.options.top=0);if(a="/Rect ["+r.finalBounds.x+" "+r.finalBounds.y+" "+r.finalBounds.w+" "+r.finalBounds.h+"] ",s="",r.options.url)s="<</Type /Annot /Subtype /Link "+a+"/Border [0 0 0] /A <</S /URI /URI ("+m(x(r.options.url))+") >>";else if(r.options.pageNumber)switch(s="<</Type /Annot /Subtype /Link "+a+"/Border [0 0 0] /Dest ["+this.internal.getPageInfo(r.options.pageNumber).objId+" 0 R",r.options.magFactor=r.options.magFactor||"XYZ",r.options.magFactor){case"Fit":s+=" /Fit]";break;case"FitH":s+=" /FitH "+r.options.top+"]";break;case"FitV":r.options.left=r.options.left||0,s+=" /FitV "+r.options.left+"]";break;default:var Q=u(r.options.top);r.options.left=r.options.left||0,r.options.zoom===void 0&&(r.options.zoom=0),s+=" /XYZ "+r.options.left+" "+Q+" "+r.options.zoom+"]"}s!=""&&(s+=" >>",this.internal.write(s))}}this.internal.write("]")}}]),t.createAnnotation=function(n){var r=this.internal.getCurrentPageInfo();switch(n.type){case"link":this.link(n.bounds.x,n.bounds.y,n.bounds.w,n.bounds.h,n);break;case"text":case"freetext":r.pageContext.annotations.push(n)}},t.link=function(n,r,a,s,l){var u=this.internal.getCurrentPageInfo(),c=this.internal.getCoordinateString,h=this.internal.getVerticalCoordinateString;u.pageContext.annotations.push({finalBounds:{x:c(n),y:h(r),w:c(n+a),h:h(r+s)},options:l,type:"link"})},t.textWithLink=function(n,r,a,s){var l,u,c=this.getTextWidth(n),h=this.internal.getLineHeight()/this.internal.scaleFactor;if(s.maxWidth!==void 0){u=s.maxWidth;var d=this.splitTextToSize(n,u).length;l=Math.ceil(h*d)}else u=c,l=h;return this.text(n,r,a,s),a+=.2*h,s.align==="center"&&(r-=c/2),s.align==="right"&&(r-=c),this.link(r,a-h,u,l,s),c},t.getTextWidth=function(n){var r=this.internal.getFontSize();return this.getStringUnitWidth(n)*r/this.internal.scaleFactor}})(Lt.API),(function(t){var e={1569:[65152],1570:[65153,65154],1571:[65155,65156],1572:[65157,65158],1573:[65159,65160],1574:[65161,65162,65163,65164],1575:[65165,65166],1576:[65167,65168,65169,65170],1577:[65171,65172],1578:[65173,65174,65175,65176],1579:[65177,65178,65179,65180],1580:[65181,65182,65183,65184],1581:[65185,65186,65187,65188],1582:[65189,65190,65191,65192],1583:[65193,65194],1584:[65195,65196],1585:[65197,65198],1586:[65199,65200],1587:[65201,65202,65203,65204],1588:[65205,65206,65207,65208],1589:[65209,65210,65211,65212],1590:[65213,65214,65215,65216],1591:[65217,65218,65219,65220],1592:[65221,65222,65223,65224],1593:[65225,65226,65227,65228],1594:[65229,65230,65231,65232],1601:[65233,65234,65235,65236],1602:[65237,65238,65239,65240],1603:[65241,65242,65243,65244],1604:[65245,65246,65247,65248],1605:[65249,65250,65251,65252],1606:[65253,65254,65255,65256],1607:[65257,65258,65259,65260],1608:[65261,65262],1609:[65263,65264,64488,64489],1610:[65265,65266,65267,65268],1649:[64336,64337],1655:[64477],1657:[64358,64359,64360,64361],1658:[64350,64351,64352,64353],1659:[64338,64339,64340,64341],1662:[64342,64343,64344,64345],1663:[64354,64355,64356,64357],1664:[64346,64347,64348,64349],1667:[64374,64375,64376,64377],1668:[64370,64371,64372,64373],1670:[64378,64379,64380,64381],1671:[64382,64383,64384,64385],1672:[64392,64393],1676:[64388,64389],1677:[64386,64387],1678:[64390,64391],1681:[64396,64397],1688:[64394,64395],1700:[64362,64363,64364,64365],1702:[64366,64367,64368,64369],1705:[64398,64399,64400,64401],1709:[64467,64468,64469,64470],1711:[64402,64403,64404,64405],1713:[64410,64411,64412,64413],1715:[64406,64407,64408,64409],1722:[64414,64415],1723:[64416,64417,64418,64419],1726:[64426,64427,64428,64429],1728:[64420,64421],1729:[64422,64423,64424,64425],1733:[64480,64481],1734:[64473,64474],1735:[64471,64472],1736:[64475,64476],1737:[64482,64483],1739:[64478,64479],1740:[64508,64509,64510,64511],1744:[64484,64485,64486,64487],1746:[64430,64431],1747:[64432,64433]},n={65247:{65154:65269,65156:65271,65160:65273,65166:65275},65248:{65154:65270,65156:65272,65160:65274,65166:65276},65165:{65247:{65248:{65258:65010}}},1617:{1612:64606,1613:64607,1614:64608,1615:64609,1616:64610}},r={1612:64606,1613:64607,1614:64608,1615:64609,1616:64610},a=[1570,1571,1573,1575];t.__arabicParser__={};var s=t.__arabicParser__.isInArabicSubstitutionA=function(E){return e[E.charCodeAt(0)]!==void 0},l=t.__arabicParser__.isArabicLetter=function(E){return typeof E=="string"&&/^[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]+$/.test(E)},u=t.__arabicParser__.isArabicEndLetter=function(E){return l(E)&&s(E)&&e[E.charCodeAt(0)].length<=2},c=t.__arabicParser__.isArabicAlfLetter=function(E){return l(E)&&a.indexOf(E.charCodeAt(0))>=0};t.__arabicParser__.arabicLetterHasIsolatedForm=function(E){return l(E)&&s(E)&&e[E.charCodeAt(0)].length>=1};var h=t.__arabicParser__.arabicLetterHasFinalForm=function(E){return l(E)&&s(E)&&e[E.charCodeAt(0)].length>=2};t.__arabicParser__.arabicLetterHasInitialForm=function(E){return l(E)&&s(E)&&e[E.charCodeAt(0)].length>=3};var d=t.__arabicParser__.arabicLetterHasMedialForm=function(E){return l(E)&&s(E)&&e[E.charCodeAt(0)].length==4},g=t.__arabicParser__.resolveLigatures=function(E){var A=0,N=n,O="",T=0;for(A=0;A<E.length;A+=1)N[E.charCodeAt(A)]!==void 0?(T++,typeof(N=N[E.charCodeAt(A)])=="number"&&(O+=String.fromCharCode(N),N=n,T=0),A===E.length-1&&(N=n,O+=E.charAt(A-(T-1)),A-=T-1,T=0)):(N=n,O+=E.charAt(A-T),A-=T,T=0);return O};t.__arabicParser__.isArabicDiacritic=function(E){return E!==void 0&&r[E.charCodeAt(0)]!==void 0};var y=t.__arabicParser__.getCorrectForm=function(E,A,N){return l(E)?s(E)===!1?-1:!h(E)||!l(A)&&!l(N)||!l(N)&&u(A)||u(E)&&!l(A)||u(E)&&c(A)||u(E)&&u(A)?0:d(E)&&l(A)&&!u(A)&&l(N)&&h(N)?3:u(E)||!l(N)?1:2:-1},m=function(E){var A=0,N=0,O=0,T="",D="",F="",Q=(E=E||"").split("\\s+"),P=[];for(A=0;A<Q.length;A+=1){for(P.push(""),N=0;N<Q[A].length;N+=1)T=Q[A][N],D=Q[A][N-1],F=Q[A][N+1],l(T)?(O=y(T,D,F),P[A]+=O!==-1?String.fromCharCode(e[T.charCodeAt(0)][O]):T):P[A]+=T;P[A]=g(P[A])}return P.join(" ")},x=t.__arabicParser__.processArabic=t.processArabic=function(){var E,A=typeof arguments[0]=="string"?arguments[0]:arguments[0].text,N=[];if(Array.isArray(A)){var O=0;for(N=[],O=0;O<A.length;O+=1)Array.isArray(A[O])?N.push([m(A[O][0]),A[O][1],A[O][2]]):N.push([m(A[O])]);E=N}else E=m(A);return typeof arguments[0]=="string"?E:(arguments[0].text=E,arguments[0])};t.events.push(["preProcessText",x])})(Lt.API),Lt.API.autoPrint=function(t){var e;return(t=t||{}).variant=t.variant||"non-conform",t.variant==="javascript"?this.addJS("print({});"):(this.internal.events.subscribe("postPutResources",function(){e=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /Named"),this.internal.out("/Type /Action"),this.internal.out("/N /Print"),this.internal.out(">>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){this.internal.out("/OpenAction "+e+" 0 R")})),this},(function(t){var e=function(){var n=void 0;Object.defineProperty(this,"pdf",{get:function(){return n},set:function(u){n=u}});var r=150;Object.defineProperty(this,"width",{get:function(){return r},set:function(u){r=isNaN(u)||Number.isInteger(u)===!1||u<0?150:u,this.getContext("2d").pageWrapXEnabled&&(this.getContext("2d").pageWrapX=r+1)}});var a=300;Object.defineProperty(this,"height",{get:function(){return a},set:function(u){a=isNaN(u)||Number.isInteger(u)===!1||u<0?300:u,this.getContext("2d").pageWrapYEnabled&&(this.getContext("2d").pageWrapY=a+1)}});var s=[];Object.defineProperty(this,"childNodes",{get:function(){return s},set:function(u){s=u}});var l={};Object.defineProperty(this,"style",{get:function(){return l},set:function(u){l=u}}),Object.defineProperty(this,"parentNode",{})};e.prototype.getContext=function(n,r){var a;if((n=n||"2d")!=="2d")return null;for(a in r)this.pdf.context2d.hasOwnProperty(a)&&(this.pdf.context2d[a]=r[a]);return this.pdf.context2d._canvas=this,this.pdf.context2d},e.prototype.toDataURL=function(){throw new Error("toDataURL is not implemented.")},t.events.push(["initialized",function(){this.canvas=new e,this.canvas.pdf=this}])})(Lt.API),(function(t){var e={left:0,top:0,bottom:0,right:0},n=!1,r=function(){this.internal.__cell__===void 0&&(this.internal.__cell__={},this.internal.__cell__.padding=3,this.internal.__cell__.headerFunction=void 0,this.internal.__cell__.margins=Object.assign({},e),this.internal.__cell__.margins.width=this.getPageWidth(),a.call(this))},a=function(){this.internal.__cell__.lastCell=new s,this.internal.__cell__.pages=1},s=function(){var c=arguments[0];Object.defineProperty(this,"x",{enumerable:!0,get:function(){return c},set:function(E){c=E}});var h=arguments[1];Object.defineProperty(this,"y",{enumerable:!0,get:function(){return h},set:function(E){h=E}});var d=arguments[2];Object.defineProperty(this,"width",{enumerable:!0,get:function(){return d},set:function(E){d=E}});var g=arguments[3];Object.defineProperty(this,"height",{enumerable:!0,get:function(){return g},set:function(E){g=E}});var y=arguments[4];Object.defineProperty(this,"text",{enumerable:!0,get:function(){return y},set:function(E){y=E}});var m=arguments[5];Object.defineProperty(this,"lineNumber",{enumerable:!0,get:function(){return m},set:function(E){m=E}});var x=arguments[6];return Object.defineProperty(this,"align",{enumerable:!0,get:function(){return x},set:function(E){x=E}}),this};s.prototype.clone=function(){return new s(this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align)},s.prototype.toArray=function(){return[this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align]},t.setHeaderFunction=function(c){return r.call(this),this.internal.__cell__.headerFunction=typeof c=="function"?c:void 0,this},t.getTextDimensions=function(c,h){r.call(this);var d=(h=h||{}).fontSize||this.getFontSize(),g=h.font||this.getFont(),y=h.scaleFactor||this.internal.scaleFactor,m=0,x=0,E=0,A=this;if(!Array.isArray(c)&&typeof c!="string"){if(typeof c!="number")throw new Error("getTextDimensions expects text-parameter to be of type String or type Number or an Array of Strings.");c=String(c)}var N=h.maxWidth;N>0?typeof c=="string"?c=this.splitTextToSize(c,N):Object.prototype.toString.call(c)==="[object Array]"&&(c=c.reduce(function(T,D){return T.concat(A.splitTextToSize(D,N))},[])):c=Array.isArray(c)?c:[c];for(var O=0;O<c.length;O++)m<(E=this.getStringUnitWidth(c[O],{font:g})*d)&&(m=E);return m!==0&&(x=c.length),{w:m/=y,h:Math.max((x*d*this.getLineHeightFactor()-d*(this.getLineHeightFactor()-1))/y,0)}},t.cellAddPage=function(){r.call(this),this.addPage();var c=this.internal.__cell__.margins||e;return this.internal.__cell__.lastCell=new s(c.left,c.top,void 0,void 0),this.internal.__cell__.pages+=1,this};var l=t.cell=function(){var c;c=arguments[0]instanceof s?arguments[0]:new s(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5],arguments[6]),r.call(this);var h=this.internal.__cell__.lastCell,d=this.internal.__cell__.padding,g=this.internal.__cell__.margins||e,y=this.internal.__cell__.tableHeaderRow,m=this.internal.__cell__.printHeaders;return h.lineNumber!==void 0&&(h.lineNumber===c.lineNumber?(c.x=(h.x||0)+(h.width||0),c.y=h.y||0):h.y+h.height+c.height+g.bottom>this.getPageHeight()?(this.cellAddPage(),c.y=g.top,m&&y&&(this.printHeaderRow(c.lineNumber,!0),c.y+=y[0].height)):c.y=h.y+h.height||c.y),c.text[0]!==void 0&&(this.rect(c.x,c.y,c.width,c.height,n===!0?"FD":void 0),c.align==="right"?this.text(c.text,c.x+c.width-d,c.y+d,{align:"right",baseline:"top"}):c.align==="center"?this.text(c.text,c.x+c.width/2,c.y+d,{align:"center",baseline:"top",maxWidth:c.width-d-d}):this.text(c.text,c.x+d,c.y+d,{align:"left",baseline:"top",maxWidth:c.width-d-d})),this.internal.__cell__.lastCell=c,this};t.table=function(c,h,d,g,y){if(r.call(this),!d)throw new Error("No data for PDF table.");var m,x,E,A,N=[],O=[],T=[],D={},F={},Q=[],P=[],$=(y=y||{}).autoSize||!1,B=y.printHeaders!==!1,ne=y.css&&y.css["font-size"]!==void 0?16*y.css["font-size"]:y.fontSize||12,I=y.margins||Object.assign({width:this.getPageWidth()},e),z=typeof y.padding=="number"?y.padding:3,J=y.headerBackgroundColor||"#c8c8c8",ae=y.headerTextColor||"#000";if(a.call(this),this.internal.__cell__.printHeaders=B,this.internal.__cell__.margins=I,this.internal.__cell__.table_font_size=ne,this.internal.__cell__.padding=z,this.internal.__cell__.headerBackgroundColor=J,this.internal.__cell__.headerTextColor=ae,this.setFontSize(ne),g==null)O=N=Object.keys(d[0]),T=N.map(function(){return"left"});else if(Array.isArray(g)&&Rn(g[0])==="object")for(N=g.map(function(he){return he.name}),O=g.map(function(he){return he.prompt||he.name||""}),T=g.map(function(he){return he.align||"left"}),m=0;m<g.length;m+=1)F[g[m].name]=.7499990551181103*g[m].width;else Array.isArray(g)&&typeof g[0]=="string"&&(O=N=g,T=N.map(function(){return"left"}));if($||Array.isArray(g)&&typeof g[0]=="string")for(m=0;m<N.length;m+=1){for(D[A=N[m]]=d.map(function(he){return he[A]}),this.setFont(void 0,"bold"),Q.push(this.getTextDimensions(O[m],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w),x=D[A],this.setFont(void 0,"normal"),E=0;E<x.length;E+=1)Q.push(this.getTextDimensions(x[E],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w);F[A]=Math.max.apply(null,Q)+z+z,Q=[]}if(B){var me={};for(m=0;m<N.length;m+=1)me[N[m]]={},me[N[m]].text=O[m],me[N[m]].align=T[m];var Z=u.call(this,me,F);P=N.map(function(he){return new s(c,h,F[he],Z,me[he].text,void 0,me[he].align)}),this.setTableHeaderRow(P),this.printHeaderRow(1,!1)}var ce=g.reduce(function(he,U){return he[U.name]=U.align,he},{});for(m=0;m<d.length;m+=1){"rowStart"in y&&y.rowStart instanceof Function&&y.rowStart({row:m,data:d[m]},this);var oe=u.call(this,d[m],F);for(E=0;E<N.length;E+=1){var ge=d[m][N[E]];"cellStart"in y&&y.cellStart instanceof Function&&y.cellStart({row:m,col:E,data:ge},this),l.call(this,new s(c,h,F[N[E]],oe,ge,m+2,ce[N[E]]))}}return this.internal.__cell__.table_x=c,this.internal.__cell__.table_y=h,this};var u=function(c,h){var d=this.internal.__cell__.padding,g=this.internal.__cell__.table_font_size,y=this.internal.scaleFactor;return Object.keys(c).map(function(m){var x=c[m];return this.splitTextToSize(x.hasOwnProperty("text")?x.text:x,h[m]-d-d)},this).map(function(m){return this.getLineHeightFactor()*m.length*g/y+d+d},this).reduce(function(m,x){return Math.max(m,x)},0)};t.setTableHeaderRow=function(c){r.call(this),this.internal.__cell__.tableHeaderRow=c},t.printHeaderRow=function(c,h){if(r.call(this),!this.internal.__cell__.tableHeaderRow)throw new Error("Property tableHeaderRow does not exist.");var d;if(n=!0,typeof this.internal.__cell__.headerFunction=="function"){var g=this.internal.__cell__.headerFunction(this,this.internal.__cell__.pages);this.internal.__cell__.lastCell=new s(g[0],g[1],g[2],g[3],void 0,-1)}this.setFont(void 0,"bold");for(var y=[],m=0;m<this.internal.__cell__.tableHeaderRow.length;m+=1){d=this.internal.__cell__.tableHeaderRow[m].clone(),h&&(d.y=this.internal.__cell__.margins.top||0,y.push(d)),d.lineNumber=c;var x=this.getTextColor();this.setTextColor(this.internal.__cell__.headerTextColor),this.setFillColor(this.internal.__cell__.headerBackgroundColor),l.call(this,d),this.setTextColor(x)}y.length>0&&this.setTableHeaderRow(y),this.setFont(void 0,"normal"),n=!1}})(Lt.API);var I6={italic:["italic","oblique","normal"],oblique:["oblique","italic","normal"],normal:["normal","oblique","italic"]},F6=["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded"],Jv=P6(F6),U6=[100,200,300,400,500,600,700,800,900],BB=P6(U6);function F1(t){var e=t.family.replace(/"|'/g,"").toLowerCase(),n=(function(s){return I6[s=s||"normal"]?s:"normal"})(t.style),r=(function(s){return s?typeof s=="number"?s>=100&&s<=900&&s%100==0?s:400:/^\d00$/.test(s)?parseInt(s):s==="bold"?700:400:400})(t.weight),a=(function(s){return typeof Jv[s=s||"normal"]=="number"?s:"normal"})(t.stretch);return{family:e,style:n,weight:r,stretch:a,src:t.src||[],ref:t.ref||{name:e,style:[a,n,r].join(" ")}}}function US(t,e,n,r){var a;for(a=n;a>=0&&a<e.length;a+=r)if(t[e[a]])return t[e[a]];for(a=n;a>=0&&a<e.length;a-=r)if(t[e[a]])return t[e[a]]}var $B={"sans-serif":"helvetica",fixed:"courier",monospace:"courier",terminal:"courier",cursive:"times",fantasy:"times",serif:"times"},BS={caption:"times",icon:"times",menu:"times","message-box":"times","small-caption":"times","status-bar":"times"};function $S(t){return[t.stretch,t.style,t.weight,t.family].join(" ")}function zS(t){return t.trimLeft()}function zB(t,e){for(var n=0;n<t.length;){if(t.charAt(n)===e)return[t.substring(0,n),t.substring(n+1)];n+=1}return null}function qB(t){var e=t.match(/^(-[a-z_]|[a-z_])[a-z0-9_-]*/i);return e===null?null:[e[0],t.substring(e[0].length)]}var Yp,qS,HS,hf,Gp,VS,YS,GS,U1=["times"];function WS(t,e,n,r,a){var s=4,l=JS;switch(a){case Lt.API.image_compression.FAST:s=1,l=KS;break;case Lt.API.image_compression.MEDIUM:s=6,l=XS;break;case Lt.API.image_compression.SLOW:s=9,l=ZS}t=(function(c,h,d,g){for(var y,m=c.length/h,x=new Uint8Array(c.length+m),E=[HB,KS,JS,XS,ZS],A=0;A<m;A+=1){var N=A*h,O=c.subarray(N,N+h);if(g)x.set(g(O,d,y),N+A);else{for(var T=E.length,D=[],F=0;F<T;F+=1)D[F]=E[F](O,d,y);var Q=YB(D.concat());x.set(D[Q],N+A)}y=O}return x})(t,e,Math.ceil(n*r/8),l);var u=qv(t,{level:s});return Lt.API.__addimage__.arrayBufferToBinaryString(u)}function HB(t){var e=Array.apply([],t);return e.unshift(0),e}function KS(t,e){var n=t.length,r=[];r[0]=1;for(var a=0;a<n;a+=1){var s=t[a-e]||0;r[a+1]=t[a]-s+256&255}return r}function JS(t,e,n){var r=t.length,a=[];a[0]=2;for(var s=0;s<r;s+=1){var l=n&&n[s]||0;a[s+1]=t[s]-l+256&255}return a}function XS(t,e,n){var r=t.length,a=[];a[0]=3;for(var s=0;s<r;s+=1){var l=t[s-e]||0,u=n&&n[s]||0;a[s+1]=t[s]+256-(l+u>>>1)&255}return a}function ZS(t,e,n){var r=t.length,a=[];a[0]=4;for(var s=0;s<r;s+=1){var l=VB(t[s-e]||0,n&&n[s]||0,n&&n[s-e]||0);a[s+1]=t[s]-l+256&255}return a}function VB(t,e,n){if(t===e&&e===n)return t;var r=Math.abs(e-n),a=Math.abs(t-n),s=Math.abs(t+e-n-n);return r<=a&&r<=s?t:a<=s?e:n}function YB(t){var e=t.map(function(n){return n.reduce(function(r,a){return r+Math.abs(a)},0)});return e.indexOf(Math.min.apply(null,e))}function B1(t,e,n){var r=e*n,a=Math.floor(r/8),s=16-(r-8*a+n),l=(1<<n)-1;return B6(t,a)>>s&l}function QS(t,e,n,r){var a=n*r,s=Math.floor(a/8),l=16-(a-8*s+r),u=(1<<r)-1,c=(e&u)<<l;(function(h,d,g){if(d+1<h.byteLength)h.setUint16(d,g,!1);else{var y=g>>8&255;h.setUint8(d,y)}})(t,s,B6(t,s)&~(u<<l)&65535|c)}function B6(t,e){return e+1<t.byteLength?t.getUint16(e,!1):t.getUint8(e)<<8}function GB(t){var e=0;if(t[e++]!==71||t[e++]!==73||t[e++]!==70||t[e++]!==56||(t[e++]+1&253)!=56||t[e++]!==97)throw new Error("Invalid GIF 87a/89a header.");var n=t[e++]|t[e++]<<8,r=t[e++]|t[e++]<<8,a=t[e++],s=a>>7,l=1<<1+(7&a);t[e++],t[e++];var u=null,c=null;s&&(u=e,c=l,e+=3*l);var h=!0,d=[],g=0,y=null,m=0,x=null;for(this.width=n,this.height=r;h&&e<t.length;)switch(t[e++]){case 33:switch(t[e++]){case 255:if(t[e]!==11||t[e+1]==78&&t[e+2]==69&&t[e+3]==84&&t[e+4]==83&&t[e+5]==67&&t[e+6]==65&&t[e+7]==80&&t[e+8]==69&&t[e+9]==50&&t[e+10]==46&&t[e+11]==48&&t[e+12]==3&&t[e+13]==1&&t[e+16]==0)e+=14,x=t[e++]|t[e++]<<8,e++;else for(e+=12;;){if(!((I=t[e++])>=0))throw Error("Invalid block size");if(I===0)break;e+=I}break;case 249:if(t[e++]!==4||t[e+4]!==0)throw new Error("Invalid graphics extension block.");var E=t[e++];g=t[e++]|t[e++]<<8,y=t[e++],1&E||(y=null),m=E>>2&7,e++;break;case 254:for(;;){if(!((I=t[e++])>=0))throw Error("Invalid block size");if(I===0)break;e+=I}break;default:throw new Error("Unknown graphic control label: 0x"+t[e-1].toString(16))}break;case 44:var A=t[e++]|t[e++]<<8,N=t[e++]|t[e++]<<8,O=t[e++]|t[e++]<<8,T=t[e++]|t[e++]<<8,D=t[e++],F=D>>6&1,Q=1<<1+(7&D),P=u,$=c,B=!1;D>>7&&(B=!0,P=e,$=Q,e+=3*Q);var ne=e;for(e++;;){var I;if(!((I=t[e++])>=0))throw Error("Invalid block size");if(I===0)break;e+=I}d.push({x:A,y:N,width:O,height:T,has_local_palette:B,palette_offset:P,palette_size:$,data_offset:ne,data_length:e-ne,transparent_index:y,interlaced:!!F,delay:g,disposal:m});break;case 59:h=!1;break;default:throw new Error("Unknown gif block: 0x"+t[e-1].toString(16))}this.numFrames=function(){return d.length},this.loopCount=function(){return x},this.frameInfo=function(z){if(z<0||z>=d.length)throw new Error("Frame index out of range.");return d[z]},this.decodeAndBlitFrameBGRA=function(z,J){var ae=this.frameInfo(z),me=ae.width*ae.height,Z=new Uint8Array(me);e_(t,ae.data_offset,Z,me);var ce=ae.palette_offset,oe=ae.transparent_index;oe===null&&(oe=256);var ge=ae.width,he=n-ge,U=ge,j=4*(ae.y*n+ae.x),Y=4*((ae.y+ae.height)*n+ae.x),K=j,ie=4*he;ae.interlaced===!0&&(ie+=4*n*7);for(var V=8,se=0,be=Z.length;se<be;++se){var xe=Z[se];if(U===0&&(U=ge,(K+=ie)>=Y&&(ie=4*he+4*n*(V-1),K=j+(ge+he)*(V<<1),V>>=1)),xe===oe)K+=4;else{var Oe=t[ce+3*xe],Me=t[ce+3*xe+1],Ue=t[ce+3*xe+2];J[K++]=Ue,J[K++]=Me,J[K++]=Oe,J[K++]=255}--U}},this.decodeAndBlitFrameRGBA=function(z,J){var ae=this.frameInfo(z),me=ae.width*ae.height,Z=new Uint8Array(me);e_(t,ae.data_offset,Z,me);var ce=ae.palette_offset,oe=ae.transparent_index;oe===null&&(oe=256);var ge=ae.width,he=n-ge,U=ge,j=4*(ae.y*n+ae.x),Y=4*((ae.y+ae.height)*n+ae.x),K=j,ie=4*he;ae.interlaced===!0&&(ie+=4*n*7);for(var V=8,se=0,be=Z.length;se<be;++se){var xe=Z[se];if(U===0&&(U=ge,(K+=ie)>=Y&&(ie=4*he+4*n*(V-1),K=j+(ge+he)*(V<<1),V>>=1)),xe===oe)K+=4;else{var Oe=t[ce+3*xe],Me=t[ce+3*xe+1],Ue=t[ce+3*xe+2];J[K++]=Oe,J[K++]=Me,J[K++]=Ue,J[K++]=255}--U}}}function e_(t,e,n,r){for(var a=t[e++],s=1<<a,l=s+1,u=l+1,c=a+1,h=(1<<c)-1,d=0,g=0,y=0,m=t[e++],x=new Int32Array(4096),E=null;;){for(;d<16&&m!==0;)g|=t[e++]<<d,d+=8,m===1?m=t[e++]:--m;if(d<c)break;var A=g&h;if(g>>=c,d-=c,A!==s){if(A===l)break;for(var N=A<u?A:E,O=0,T=N;T>s;)T=x[T]>>8,++O;var D=T;if(y+O+(N!==A?1:0)>r)return void hr.log("Warning, gif stream longer than expected.");n[y++]=D;var F=y+=O;for(N!==A&&(n[y++]=D),T=N;O--;)T=x[T],n[--F]=255&T,T>>=8;E!==null&&u<4096&&(x[u++]=E<<8|D,u>=h+1&&c<12&&(++c,h=h<<1|1)),E=A}else u=l+1,h=(1<<(c=a+1))-1,E=null}return y!==r&&hr.log("Warning, gif stream shorter than expected."),n}/**
270
- * @license
271
- Copyright (c) 2008, Adobe Systems Incorporated
272
- All rights reserved.
273
-
274
- Redistribution and use in source and binary forms, with or without
275
- modification, are permitted provided that the following conditions are
276
- met:
277
-
278
- * Redistributions of source code must retain the above copyright notice,
279
- this list of conditions and the following disclaimer.
280
-
281
- * Redistributions in binary form must reproduce the above copyright
282
- notice, this list of conditions and the following disclaimer in the
283
- documentation and/or other materials provided with the distribution.
284
-
285
- * Neither the name of Adobe Systems Incorporated nor the names of its
286
- contributors may be used to endorse or promote products derived from
287
- this software without specific prior written permission.
288
-
289
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
290
- IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
291
- THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
292
- PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
293
- CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
294
- EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
295
- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
296
- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
297
- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
298
- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
299
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
300
- */function $1(t){var e,n,r,a,s,l=Math.floor,u=new Array(64),c=new Array(64),h=new Array(64),d=new Array(64),g=new Array(65535),y=new Array(65535),m=new Array(64),x=new Array(64),E=[],A=0,N=7,O=new Array(64),T=new Array(64),D=new Array(64),F=new Array(256),Q=new Array(2048),P=[0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63],$=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],B=[0,1,2,3,4,5,6,7,8,9,10,11],ne=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],I=[1,2,3,0,4,17,5,18,33,49,65,6,19,81,97,7,34,113,20,50,129,145,161,8,35,66,177,193,21,82,209,240,36,51,98,114,130,9,10,22,23,24,25,26,37,38,39,40,41,42,52,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,225,226,227,228,229,230,231,232,233,234,241,242,243,244,245,246,247,248,249,250],z=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],J=[0,1,2,3,4,5,6,7,8,9,10,11],ae=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],me=[0,1,2,3,17,4,5,33,49,6,18,65,81,7,97,113,19,34,50,129,8,20,66,145,161,177,193,9,35,51,82,240,21,98,114,209,10,22,36,52,225,37,241,23,24,25,26,38,39,40,41,42,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,130,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,226,227,228,229,230,231,232,233,234,242,243,244,245,246,247,248,249,250];function Z(j,Y){for(var K=0,ie=0,V=new Array,se=1;se<=16;se++){for(var be=1;be<=j[se];be++)V[Y[ie]]=[],V[Y[ie]][0]=K,V[Y[ie]][1]=se,ie++,K++;K*=2}return V}function ce(j){for(var Y=j[0],K=j[1]-1;K>=0;)Y&1<<K&&(A|=1<<N),K--,--N<0&&(A==255?(oe(255),oe(0)):oe(A),N=7,A=0)}function oe(j){E.push(j)}function ge(j){oe(j>>8&255),oe(255&j)}function he(j,Y,K,ie,V){for(var se,be=V[0],xe=V[240],Oe=(function(Ye,gt){var ot,Ot,At,Ft,rn,Jt,fn,zt,at,Xt,wt=0;for(at=0;at<8;++at){ot=Ye[wt],Ot=Ye[wt+1],At=Ye[wt+2],Ft=Ye[wt+3],rn=Ye[wt+4],Jt=Ye[wt+5],fn=Ye[wt+6];var lr=ot+(zt=Ye[wt+7]),dn=ot-zt,bt=Ot+fn,qt=Ot-fn,pn=At+Jt,Nt=At-Jt,Gn=Ft+rn,Pt=Ft-rn,It=lr+Gn,Mn=lr-Gn,Qt=bt+pn,_t=bt-pn;Ye[wt]=It+Qt,Ye[wt+4]=It-Qt;var bn=.707106781*(_t+Mn);Ye[wt+2]=Mn+bn,Ye[wt+6]=Mn-bn;var si=.382683433*((It=Pt+Nt)-(_t=qt+dn)),Wr=.5411961*It+si,ka=1.306562965*_t+si,ha=.707106781*(Qt=Nt+qt),Et=dn+ha,Ui=dn-ha;Ye[wt+5]=Ui+Wr,Ye[wt+3]=Ui-Wr,Ye[wt+1]=Et+ka,Ye[wt+7]=Et-ka,wt+=8}for(wt=0,at=0;at<8;++at){ot=Ye[wt],Ot=Ye[wt+8],At=Ye[wt+16],Ft=Ye[wt+24],rn=Ye[wt+32],Jt=Ye[wt+40],fn=Ye[wt+48];var vi=ot+(zt=Ye[wt+56]),de=ot-zt,Se=Ot+fn,Ne=Ot-fn,He=At+Jt,Xe=At-Jt,ht=Ft+rn,it=Ft-rn,Qe=vi+ht,et=vi-ht,rt=Se+He,Ct=Se-He;Ye[wt]=Qe+rt,Ye[wt+32]=Qe-rt;var st=.707106781*(Ct+et);Ye[wt+16]=et+st,Ye[wt+48]=et-st;var Ht=.382683433*((Qe=it+Xe)-(Ct=Ne+de)),Zt=.5411961*Qe+Ht,Bn=1.306562965*Ct+Ht,Kn=.707106781*(rt=Xe+Ne),Jn=de+Kn,hn=de-Kn;Ye[wt+40]=hn+Zt,Ye[wt+24]=hn-Zt,Ye[wt+8]=Jn+Bn,Ye[wt+56]=Jn-Bn,wt++}for(at=0;at<64;++at)Xt=Ye[at]*gt[at],m[at]=Xt>0?Xt+.5|0:Xt-.5|0;return m})(j,Y),Me=0;Me<64;++Me)x[P[Me]]=Oe[Me];var Ue=x[0]-K;K=x[0],Ue==0?ce(ie[0]):(ce(ie[y[se=32767+Ue]]),ce(g[se]));for(var Be=63;Be>0&&x[Be]==0;)Be--;if(Be==0)return ce(be),K;for(var Ke,ee=1;ee<=Be;){for(var qe=ee;x[ee]==0&&ee<=Be;)++ee;var ct=ee-qe;if(ct>=16){Ke=ct>>4;for(var tt=1;tt<=Ke;++tt)ce(xe);ct&=15}se=32767+x[ee],ce(V[(ct<<4)+y[se]]),ce(g[se]),ee++}return Be!=63&&ce(be),K}function U(j){j=Math.min(Math.max(j,1),100),s!=j&&((function(Y){for(var K=[16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99],ie=0;ie<64;ie++){var V=l((K[ie]*Y+50)/100);V=Math.min(Math.max(V,1),255),u[P[ie]]=V}for(var se=[17,18,24,47,99,99,99,99,18,21,26,66,99,99,99,99,24,26,56,99,99,99,99,99,47,66,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99],be=0;be<64;be++){var xe=l((se[be]*Y+50)/100);xe=Math.min(Math.max(xe,1),255),c[P[be]]=xe}for(var Oe=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],Me=0,Ue=0;Ue<8;Ue++)for(var Be=0;Be<8;Be++)h[Me]=1/(u[P[Me]]*Oe[Ue]*Oe[Be]*8),d[Me]=1/(c[P[Me]]*Oe[Ue]*Oe[Be]*8),Me++})(j<50?Math.floor(5e3/j):Math.floor(200-2*j)),s=j)}this.encode=function(j,Y){Y&&U(Y),E=new Array,A=0,N=7,ge(65496),ge(65504),ge(16),oe(74),oe(70),oe(73),oe(70),oe(0),oe(1),oe(1),oe(0),ge(1),ge(1),oe(0),oe(0),(function(){ge(65499),ge(132),oe(0);for(var Ot=0;Ot<64;Ot++)oe(u[Ot]);oe(1);for(var At=0;At<64;At++)oe(c[At])})(),(function(Ot,At){ge(65472),ge(17),oe(8),ge(At),ge(Ot),oe(3),oe(1),oe(17),oe(0),oe(2),oe(17),oe(1),oe(3),oe(17),oe(1)})(j.width,j.height),(function(){ge(65476),ge(418),oe(0);for(var Ot=0;Ot<16;Ot++)oe($[Ot+1]);for(var At=0;At<=11;At++)oe(B[At]);oe(16);for(var Ft=0;Ft<16;Ft++)oe(ne[Ft+1]);for(var rn=0;rn<=161;rn++)oe(I[rn]);oe(1);for(var Jt=0;Jt<16;Jt++)oe(z[Jt+1]);for(var fn=0;fn<=11;fn++)oe(J[fn]);oe(17);for(var zt=0;zt<16;zt++)oe(ae[zt+1]);for(var at=0;at<=161;at++)oe(me[at])})(),ge(65498),ge(12),oe(3),oe(1),oe(0),oe(2),oe(17),oe(3),oe(17),oe(0),oe(63),oe(0);var K=0,ie=0,V=0;A=0,N=7,this.encode.displayName="_encode_";for(var se,be,xe,Oe,Me,Ue,Be,Ke,ee,qe=j.data,ct=j.width,tt=j.height,Ye=4*ct,gt=0;gt<tt;){for(se=0;se<Ye;){for(Me=Ye*gt+se,Be=-1,Ke=0,ee=0;ee<64;ee++)Ue=Me+(Ke=ee>>3)*Ye+(Be=4*(7&ee)),gt+Ke>=tt&&(Ue-=Ye*(gt+1+Ke-tt)),se+Be>=Ye&&(Ue-=se+Be-Ye+4),be=qe[Ue++],xe=qe[Ue++],Oe=qe[Ue++],O[ee]=(Q[be]+Q[xe+256|0]+Q[Oe+512|0]>>16)-128,T[ee]=(Q[be+768|0]+Q[xe+1024|0]+Q[Oe+1280|0]>>16)-128,D[ee]=(Q[be+1280|0]+Q[xe+1536|0]+Q[Oe+1792|0]>>16)-128;K=he(O,h,K,e,r),ie=he(T,d,ie,n,a),V=he(D,d,V,n,a),se+=32}gt+=8}if(N>=0){var ot=[];ot[1]=N+1,ot[0]=(1<<N+1)-1,ce(ot)}return ge(65497),new Uint8Array(E)},t=t||50,(function(){for(var j=String.fromCharCode,Y=0;Y<256;Y++)F[Y]=j(Y)})(),e=Z($,B),n=Z(z,J),r=Z(ne,I),a=Z(ae,me),(function(){for(var j=1,Y=2,K=1;K<=15;K++){for(var ie=j;ie<Y;ie++)y[32767+ie]=K,g[32767+ie]=[],g[32767+ie][1]=K,g[32767+ie][0]=ie;for(var V=-(Y-1);V<=-j;V++)y[32767+V]=K,g[32767+V]=[],g[32767+V][1]=K,g[32767+V][0]=Y-1+V;j<<=1,Y<<=1}})(),(function(){for(var j=0;j<256;j++)Q[j]=19595*j,Q[j+256|0]=38470*j,Q[j+512|0]=7471*j+32768,Q[j+768|0]=-11059*j,Q[j+1024|0]=-21709*j,Q[j+1280|0]=32768*j+8421375,Q[j+1536|0]=-27439*j,Q[j+1792|0]=-5329*j})(),U(t)}/**
301
- * @license
302
- * Copyright (c) 2017 Aras Abbasi
303
- *
304
- * Licensed under the MIT License.
305
- * http://opensource.org/licenses/mit-license
306
- */function Qs(t,e){if(this.pos=0,this.buffer=t,this.datav=new DataView(t.buffer),this.is_with_alpha=!!e,this.bottom_up=!0,this.flag=String.fromCharCode(this.buffer[0])+String.fromCharCode(this.buffer[1]),this.pos+=2,["BM","BA","CI","CP","IC","PT"].indexOf(this.flag)===-1)throw new Error("Invalid BMP File");this.parseHeader(),this.parseBGR()}function t_(t){function e(B){if(!B)throw Error("assert :P")}function n(B,ne,I){for(var z=0;4>z;z++)if(B[ne+z]!=I.charCodeAt(z))return!0;return!1}function r(B,ne,I,z,J){for(var ae=0;ae<J;ae++)B[ne+ae]=I[z+ae]}function a(B,ne,I,z){for(var J=0;J<z;J++)B[ne+J]=I}function s(B){return new Int32Array(B)}function l(B,ne){for(var I=[],z=0;z<B;z++)I.push(new ne);return I}function u(B,ne){var I=[];return(function z(J,ae,me){for(var Z=me[ae],ce=0;ce<Z&&(J.push(me.length>ae+1?[]:new ne),!(me.length<ae+1));ce++)z(J[ce],ae+1,me)})(I,0,B),I}var c=function(){var B=this;function ne(v,w){for(var L=1<<w-1>>>0;v&L;)L>>>=1;return L?(v&L-1)+L:v}function I(v,w,L,R,H){e(!(R%L));do v[w+(R-=L)]=H;while(0<R)}function z(v,w,L,R,H){if(e(2328>=H),512>=H)var G=s(512);else if((G=s(H))==null)return 0;return(function(W,te,re,ue,ye,Le){var le,_e,Ce=te,Ie=1<<re,Te=s(16),Pe=s(16);for(e(ye!=0),e(ue!=null),e(W!=null),e(0<re),_e=0;_e<ye;++_e){if(15<ue[_e])return 0;++Te[ue[_e]]}if(Te[0]==ye)return 0;for(Pe[1]=0,le=1;15>le;++le){if(Te[le]>1<<le)return 0;Pe[le+1]=Pe[le]+Te[le]}for(_e=0;_e<ye;++_e)le=ue[_e],0<ue[_e]&&(Le[Pe[le]++]=_e);if(Pe[15]==1)return(ue=new J).g=0,ue.value=Le[0],I(W,Ce,1,Ie,ue),Ie;var ze,Ze=-1,We=Ie-1,vt=0,lt=1,en=1,dt=1<<re;for(_e=0,le=1,ye=2;le<=re;++le,ye<<=1){if(lt+=en<<=1,0>(en-=Te[le]))return 0;for(;0<Te[le];--Te[le])(ue=new J).g=le,ue.value=Le[_e++],I(W,Ce+vt,ye,dt,ue),vt=ne(vt,le)}for(le=re+1,ye=2;15>=le;++le,ye<<=1){if(lt+=en<<=1,0>(en-=Te[le]))return 0;for(;0<Te[le];--Te[le]){if(ue=new J,(vt&We)!=Ze){for(Ce+=dt,ze=1<<(Ze=le)-re;15>Ze&&!(0>=(ze-=Te[Ze]));)++Ze,ze<<=1;Ie+=dt=1<<(ze=Ze-re),W[te+(Ze=vt&We)].g=ze+re,W[te+Ze].value=Ce-te-Ze}ue.g=le-re,ue.value=Le[_e++],I(W,Ce+(vt>>re),ye,dt,ue),vt=ne(vt,le)}}return lt!=2*Pe[15]-1?0:Ie})(v,w,L,R,H,G)}function J(){this.value=this.g=0}function ae(){this.value=this.g=0}function me(){this.G=l(5,J),this.H=s(5),this.jc=this.Qb=this.qb=this.nd=0,this.pd=l(fo,ae)}function Z(v,w,L,R){e(v!=null),e(w!=null),e(2147483648>R),v.Ca=254,v.I=0,v.b=-8,v.Ka=0,v.oa=w,v.pa=L,v.Jd=w,v.Yc=L+R,v.Zc=4<=R?L+R-4+1:L,be(v)}function ce(v,w){for(var L=0;0<w--;)L|=Oe(v,128)<<w;return L}function oe(v,w){var L=ce(v,w);return xe(v)?-L:L}function ge(v,w,L,R){var H,G=0;for(e(v!=null),e(w!=null),e(4294967288>R),v.Sb=R,v.Ra=0,v.u=0,v.h=0,4<R&&(R=4),H=0;H<R;++H)G+=w[L+H]<<8*H;v.Ra=G,v.bb=R,v.oa=w,v.pa=L}function he(v){for(;8<=v.u&&v.bb<v.Sb;)v.Ra>>>=8,v.Ra+=v.oa[v.pa+v.bb]<<ds-8>>>0,++v.bb,v.u-=8;ie(v)&&(v.h=1,v.u=0)}function U(v,w){if(e(0<=w),!v.h&&w<=Ba){var L=K(v)&Xa[w];return v.u+=w,he(v),L}return v.h=1,v.u=0}function j(){this.b=this.Ca=this.I=0,this.oa=[],this.pa=0,this.Jd=[],this.Yc=0,this.Zc=[],this.Ka=0}function Y(){this.Ra=0,this.oa=[],this.h=this.u=this.bb=this.Sb=this.pa=0}function K(v){return v.Ra>>>(v.u&ds-1)>>>0}function ie(v){return e(v.bb<=v.Sb),v.h||v.bb==v.Sb&&v.u>ds}function V(v,w){v.u=w,v.h=ie(v)}function se(v){v.u>=ps&&(e(v.u>=ps),he(v))}function be(v){e(v!=null&&v.oa!=null),v.pa<v.Zc?(v.I=(v.oa[v.pa++]|v.I<<8)>>>0,v.b+=8):(e(v!=null&&v.oa!=null),v.pa<v.Yc?(v.b+=8,v.I=v.oa[v.pa++]|v.I<<8):v.Ka?v.b=0:(v.I<<=8,v.b+=8,v.Ka=1))}function xe(v){return ce(v,1)}function Oe(v,w){var L=v.Ca;0>v.b&&be(v);var R=v.b,H=L*w>>>8,G=(v.I>>>R>H)+0;for(G?(L-=H,v.I-=H+1<<R>>>0):L=H+1,R=L,H=0;256<=R;)H+=8,R>>=8;return R=7^H+Bs[R],v.b-=R,v.Ca=(L<<R)-1,G}function Me(v,w,L){v[w+0]=L>>24&255,v[w+1]=L>>16&255,v[w+2]=L>>8&255,v[w+3]=255&L}function Ue(v,w){return v[w+0]|v[w+1]<<8}function Be(v,w){return Ue(v,w)|v[w+2]<<16}function Ke(v,w){return Ue(v,w)|Ue(v,w+2)<<16}function ee(v,w){var L=1<<w;return e(v!=null),e(0<w),v.X=s(L),v.X==null?0:(v.Mb=32-w,v.Xa=w,1)}function qe(v,w){e(v!=null),e(w!=null),e(v.Xa==w.Xa),r(w.X,0,v.X,0,1<<w.Xa)}function ct(){this.X=[],this.Xa=this.Mb=0}function tt(v,w,L,R){e(L!=null),e(R!=null);var H=L[0],G=R[0];return H==0&&(H=(v*G+w/2)/w),G==0&&(G=(w*H+v/2)/v),0>=H||0>=G?0:(L[0]=H,R[0]=G,1)}function Ye(v,w){return v+(1<<w)-1>>>w}function gt(v,w){return((4278255360&v)+(4278255360&w)>>>0&4278255360)+((16711935&v)+(16711935&w)>>>0&16711935)>>>0}function ot(v,w){B[w]=function(L,R,H,G,W,te,re){var ue;for(ue=0;ue<W;++ue){var ye=B[v](te[re+ue-1],H,G+ue);te[re+ue]=gt(L[R+ue],ye)}}}function Ot(){this.ud=this.hd=this.jd=0}function At(v,w){return((4278124286&(v^w))>>>1)+(v&w)>>>0}function Ft(v){return 0<=v&&256>v?v:0>v?0:255<v?255:void 0}function rn(v,w){return Ft(v+(v-w+.5>>1))}function Jt(v,w,L){return Math.abs(w-L)-Math.abs(v-L)}function fn(v,w,L,R,H,G,W){for(R=G[W-1],L=0;L<H;++L)G[W+L]=R=gt(v[w+L],R)}function zt(v,w,L,R,H){var G;for(G=0;G<L;++G){var W=v[w+G],te=W>>8&255,re=16711935&(re=(re=16711935&W)+((te<<16)+te));R[H+G]=(4278255360&W)+re>>>0}}function at(v,w){w.jd=255&v,w.hd=v>>8&255,w.ud=v>>16&255}function Xt(v,w,L,R,H,G){var W;for(W=0;W<R;++W){var te=w[L+W],re=te>>>8,ue=te,ye=255&(ye=(ye=te>>>16)+((v.jd<<24>>24)*(re<<24>>24)>>>5));ue=255&(ue=(ue+=(v.hd<<24>>24)*(re<<24>>24)>>>5)+((v.ud<<24>>24)*(ye<<24>>24)>>>5)),H[G+W]=(4278255360&te)+(ye<<16)+ue}}function wt(v,w,L,R,H){B[w]=function(G,W,te,re,ue,ye,Le,le,_e){for(re=Le;re<le;++re)for(Le=0;Le<_e;++Le)ue[ye++]=H(te[R(G[W++])])},B[v]=function(G,W,te,re,ue,ye,Le){var le=8>>G.b,_e=G.Ea,Ce=G.K[0],Ie=G.w;if(8>le)for(G=(1<<G.b)-1,Ie=(1<<le)-1;W<te;++W){var Te,Pe=0;for(Te=0;Te<_e;++Te)Te&G||(Pe=R(re[ue++])),ye[Le++]=H(Ce[Pe&Ie]),Pe>>=le}else B["VP8LMapColor"+L](re,ue,Ce,Ie,ye,Le,W,te,_e)}}function lr(v,w,L,R,H){for(L=w+L;w<L;){var G=v[w++];R[H++]=G>>16&255,R[H++]=G>>8&255,R[H++]=255&G}}function dn(v,w,L,R,H){for(L=w+L;w<L;){var G=v[w++];R[H++]=G>>16&255,R[H++]=G>>8&255,R[H++]=255&G,R[H++]=G>>24&255}}function bt(v,w,L,R,H){for(L=w+L;w<L;){var G=(W=v[w++])>>16&240|W>>12&15,W=240&W|W>>28&15;R[H++]=G,R[H++]=W}}function qt(v,w,L,R,H){for(L=w+L;w<L;){var G=(W=v[w++])>>16&248|W>>13&7,W=W>>5&224|W>>3&31;R[H++]=G,R[H++]=W}}function pn(v,w,L,R,H){for(L=w+L;w<L;){var G=v[w++];R[H++]=255&G,R[H++]=G>>8&255,R[H++]=G>>16&255}}function Nt(v,w,L,R,H,G){if(G==0)for(L=w+L;w<L;)Me(R,((G=v[w++])[0]>>24|G[1]>>8&65280|G[2]<<8&16711680|G[3]<<24)>>>0),H+=32;else r(R,H,v,w,L)}function Gn(v,w){B[w][0]=B[v+"0"],B[w][1]=B[v+"1"],B[w][2]=B[v+"2"],B[w][3]=B[v+"3"],B[w][4]=B[v+"4"],B[w][5]=B[v+"5"],B[w][6]=B[v+"6"],B[w][7]=B[v+"7"],B[w][8]=B[v+"8"],B[w][9]=B[v+"9"],B[w][10]=B[v+"10"],B[w][11]=B[v+"11"],B[w][12]=B[v+"12"],B[w][13]=B[v+"13"],B[w][14]=B[v+"0"],B[w][15]=B[v+"0"]}function Pt(v){return v==Du||v==Sc||v==Pl||v==_c}function It(){this.eb=[],this.size=this.A=this.fb=0}function Mn(){this.y=[],this.f=[],this.ea=[],this.F=[],this.Tc=this.Ed=this.Cd=this.Fd=this.lb=this.Db=this.Ab=this.fa=this.J=this.W=this.N=this.O=0}function Qt(){this.Rd=this.height=this.width=this.S=0,this.f={},this.f.RGBA=new It,this.f.kb=new Mn,this.sd=null}function _t(){this.width=[0],this.height=[0],this.Pd=[0],this.Qd=[0],this.format=[0]}function bn(){this.Id=this.fd=this.Md=this.hb=this.ib=this.da=this.bd=this.cd=this.j=this.v=this.Da=this.Sd=this.ob=0}function si(v){return alert("todo:WebPSamplerProcessPlane"),v.T}function Wr(v,w){var L=v.T,R=w.ba.f.RGBA,H=R.eb,G=R.fb+v.ka*R.A,W=ya[w.ba.S],te=v.y,re=v.O,ue=v.f,ye=v.N,Le=v.ea,le=v.W,_e=w.cc,Ce=w.dc,Ie=w.Mc,Te=w.Nc,Pe=v.ka,ze=v.ka+v.T,Ze=v.U,We=Ze+1>>1;for(Pe==0?W(te,re,null,null,ue,ye,Le,le,ue,ye,Le,le,H,G,null,null,Ze):(W(w.ec,w.fc,te,re,_e,Ce,Ie,Te,ue,ye,Le,le,H,G-R.A,H,G,Ze),++L);Pe+2<ze;Pe+=2)_e=ue,Ce=ye,Ie=Le,Te=le,ye+=v.Rc,le+=v.Rc,G+=2*R.A,W(te,(re+=2*v.fa)-v.fa,te,re,_e,Ce,Ie,Te,ue,ye,Le,le,H,G-R.A,H,G,Ze);return re+=v.fa,v.j+ze<v.o?(r(w.ec,w.fc,te,re,Ze),r(w.cc,w.dc,ue,ye,We),r(w.Mc,w.Nc,Le,le,We),L--):1&ze||W(te,re,null,null,ue,ye,Le,le,ue,ye,Le,le,H,G+R.A,null,null,Ze),L}function ka(v,w,L){var R=v.F,H=[v.J];if(R!=null){var G=v.U,W=w.ba.S,te=W==Ru||W==Pl;w=w.ba.f.RGBA;var re=[0],ue=v.ka;re[0]=v.T,v.Kb&&(ue==0?--re[0]:(--ue,H[0]-=v.width),v.j+v.ka+v.T==v.o&&(re[0]=v.o-v.j-ue));var ye=w.eb;ue=w.fb+ue*w.A,v=Tu(R,H[0],v.width,G,re,ye,ue+(te?0:3),w.A),e(L==re),v&&Pt(W)&&Yo(ye,ue,te,G,re,w.A)}return 0}function ha(v){var w=v.ma,L=w.ba.S,R=11>L,H=L==La||L==Si||L==Ru||L==Ml||L==12||Pt(L);if(w.memory=null,w.Ib=null,w.Jb=null,w.Nd=null,!Us(w.Oa,v,H?11:12))return 0;if(H&&Pt(L)&&Eu(),v.da)alert("todo:use_scaling");else{if(R){if(w.Ib=si,v.Kb){if(L=v.U+1>>1,w.memory=s(v.U+2*L),w.memory==null)return 0;w.ec=w.memory,w.fc=0,w.cc=w.ec,w.dc=w.fc+v.U,w.Mc=w.cc,w.Nc=w.dc+L,w.Ib=Wr,Eu()}}else alert("todo:EmitYUV");H&&(w.Jb=ka,R&&zi())}if(R&&!bo){for(v=0;256>v;++v)ba[v]=89858*(v-128)+Ul>>Ti,gg[v]=-22014*(v-128)+Ul,Nd[v]=-45773*(v-128),Tc[v]=113618*(v-128)+Ul>>Ti;for(v=Jo;v<yo;++v)w=76283*(v-16)+Ul>>Ti,vg[v-Jo]=Pn(w,255),yg[v-Jo]=Pn(w+8>>4,15);bo=1}return 1}function Et(v){var w=v.ma,L=v.U,R=v.T;return e(!(1&v.ka)),0>=L||0>=R?0:(L=w.Ib(v,w),w.Jb!=null&&w.Jb(v,w,L),w.Dc+=L,1)}function Ui(v){v.ma.memory=null}function vi(v,w,L,R){return U(v,8)!=47?0:(w[0]=U(v,14)+1,L[0]=U(v,14)+1,R[0]=U(v,1),U(v,3)!=0?0:!v.h)}function de(v,w){if(4>v)return v+1;var L=v-2>>1;return(2+(1&v)<<L)+U(w,L)+1}function Se(v,w){return 120<w?w-120:1<=(L=((L=Ei[w-1])>>4)*v+(8-(15&L)))?L:1;var L}function Ne(v,w,L){var R=K(L),H=v[w+=255&R].g-8;return 0<H&&(V(L,L.u+8),R=K(L),w+=v[w].value,w+=R&(1<<H)-1),V(L,L.u+v[w].g),v[w].value}function He(v,w,L){return L.g+=v.g,L.value+=v.value<<w>>>0,e(8>=L.g),v.g}function Xe(v,w,L){var R=v.xc;return e((w=R==0?0:v.vc[v.md*(L>>R)+(w>>R)])<v.Wb),v.Ya[w]}function ht(v,w,L,R){var H=v.ab,G=v.c*w,W=v.C;w=W+w;var te=L,re=R;for(R=v.Ta,L=v.Ua;0<H--;){var ue=v.gc[H],ye=W,Le=w,le=te,_e=re,Ce=(re=R,te=L,ue.Ea);switch(e(ye<Le),e(Le<=ue.nc),ue.hc){case 2:Tr(le,_e,(Le-ye)*Ce,re,te);break;case 0:var Ie=ye,Te=Le,Pe=re,ze=te,Ze=(dt=ue).Ea;Ie==0&&(jl(le,_e,null,null,1,Pe,ze),fn(le,_e+1,0,0,Ze-1,Pe,ze+1),_e+=Ze,ze+=Ze,++Ie);for(var We=1<<dt.b,vt=We-1,lt=Ye(Ze,dt.b),en=dt.K,dt=dt.w+(Ie>>dt.b)*lt;Ie<Te;){var wn=en,cr=dt,sn=1;for(Rl(le,_e,Pe,ze-Ze,1,Pe,ze);sn<Ze;){var ut=(sn&~vt)+We;ut>Ze&&(ut=Ze),(0,$s[wn[cr++]>>8&15])(le,_e+ +sn,Pe,ze+sn-Ze,ut-sn,Pe,ze+sn),sn=ut}_e+=Ze,ze+=Ze,++Ie&vt||(dt+=lt)}Le!=ue.nc&&r(re,te-Ce,re,te+(Le-ye-1)*Ce,Ce);break;case 1:for(Ce=le,Te=_e,Ze=(le=ue.Ea)-(ze=le&~(Pe=(_e=1<<ue.b)-1)),Ie=Ye(le,ue.b),We=ue.K,ue=ue.w+(ye>>ue.b)*Ie;ye<Le;){for(vt=We,lt=ue,en=new Ot,dt=Te+ze,wn=Te+le;Te<dt;)at(vt[lt++],en),Dl(en,Ce,Te,_e,re,te),Te+=_e,te+=_e;Te<wn&&(at(vt[lt++],en),Dl(en,Ce,Te,Ze,re,te),Te+=Ze,te+=Ze),++ye&Pe||(ue+=Ie)}break;case 3:if(le==re&&_e==te&&0<ue.b){for(Te=re,le=Ce=te+(Le-ye)*Ce-(ze=(Le-ye)*Ye(ue.Ea,ue.b)),_e=re,Pe=te,Ie=[],ze=(Ze=ze)-1;0<=ze;--ze)Ie[ze]=_e[Pe+ze];for(ze=Ze-1;0<=ze;--ze)Te[le+ze]=Ie[ze];vc(ue,ye,Le,re,Ce,re,te)}else vc(ue,ye,Le,le,_e,re,te)}te=R,re=L}re!=L&&r(R,L,te,re,G)}function it(v,w){var L=v.V,R=v.Ba+v.c*v.C,H=w-v.C;if(e(w<=v.l.o),e(16>=H),0<H){var G=v.l,W=v.Ta,te=v.Ua,re=G.width;if(ht(v,H,L,R),H=te=[te],e((L=v.C)<(R=w)),e(G.v<G.va),R>G.o&&(R=G.o),L<G.j){var ue=G.j-L;L=G.j,H[0]+=ue*re}if(L>=R?L=0:(H[0]+=4*G.v,G.ka=L-G.j,G.U=G.va-G.v,G.T=R-L,L=1),L){if(te=te[0],11>(L=v.ca).S){var ye=L.f.RGBA,Le=(R=L.S,H=G.U,G=G.T,ue=ye.eb,ye.A),le=G;for(ye=ye.fb+v.Ma*ye.A;0<le--;){var _e=W,Ce=te,Ie=H,Te=ue,Pe=ye;switch(R){case wc:kl(_e,Ce,Ie,Te,Pe);break;case La:zs(_e,Ce,Ie,Te,Pe);break;case Du:zs(_e,Ce,Ie,Te,Pe),Yo(Te,Pe,0,Ie,1,0);break;case xc:Ho(_e,Ce,Ie,Te,Pe);break;case Si:Nt(_e,Ce,Ie,Te,Pe,1);break;case Sc:Nt(_e,Ce,Ie,Te,Pe,1),Yo(Te,Pe,0,Ie,1,0);break;case Ru:Nt(_e,Ce,Ie,Te,Pe,0);break;case Pl:Nt(_e,Ce,Ie,Te,Pe,0),Yo(Te,Pe,1,Ie,1,0);break;case Ml:qs(_e,Ce,Ie,Te,Pe);break;case _c:qs(_e,Ce,Ie,Te,Pe),xi(Te,Pe,Ie,1,0);break;case ho:vs(_e,Ce,Ie,Te,Pe);break;default:e(0)}te+=re,ye+=Le}v.Ma+=G}else alert("todo:EmitRescaledRowsYUVA");e(v.Ma<=L.height)}}v.C=w,e(v.C<=v.i)}function Qe(v){var w;if(0<v.ua)return 0;for(w=0;w<v.Wb;++w){var L=v.Ya[w].G,R=v.Ya[w].H;if(0<L[1][R[1]+0].g||0<L[2][R[2]+0].g||0<L[3][R[3]+0].g)return 0}return 1}function et(v,w,L,R,H,G){if(v.Z!=0){var W=v.qd,te=v.rd;for(e(Ys[v.Z]!=null);w<L;++w)Ys[v.Z](W,te,R,H,R,H,G),W=R,te=H,H+=G;v.qd=W,v.rd=te}}function rt(v,w){var L=v.l.ma,R=L.Z==0||L.Z==1?v.l.j:v.C;if(R=v.C<R?R:v.C,e(w<=v.l.o),w>R){var H=v.l.width,G=L.ca,W=L.tb+H*R,te=v.V,re=v.Ba+v.c*R,ue=v.gc;e(v.ab==1),e(ue[0].hc==3),gs(ue[0],R,w,te,re,G,W),et(L,R,w,G,W,H)}v.C=v.Ma=w}function Ct(v,w,L,R,H,G,W){var te=v.$/R,re=v.$%R,ue=v.m,ye=v.s,Le=L+v.$,le=Le;H=L+R*H;var _e=L+R*G,Ce=280+ye.ua,Ie=v.Pb?te:16777216,Te=0<ye.ua?ye.Wa:null,Pe=ye.wc,ze=Le<_e?Xe(ye,re,te):null;e(v.C<G),e(_e<=H);var Ze=!1;e:for(;;){for(;Ze||Le<_e;){var We=0;if(te>=Ie){var vt=Le-L;e((Ie=v).Pb),Ie.wd=Ie.m,Ie.xd=vt,0<Ie.s.ua&&qe(Ie.s.Wa,Ie.s.vb),Ie=te+po}if(re&Pe||(ze=Xe(ye,re,te)),e(ze!=null),ze.Qb&&(w[Le]=ze.qb,Ze=!0),!Ze)if(se(ue),ze.jc){We=ue,vt=w;var lt=Le,en=ze.pd[K(We)&fo-1];e(ze.jc),256>en.g?(V(We,We.u+en.g),vt[lt]=en.value,We=0):(V(We,We.u+en.g-256),e(256<=en.value),We=en.value),We==0&&(Ze=!0)}else We=Ne(ze.G[0],ze.H[0],ue);if(ue.h)break;if(Ze||256>We){if(!Ze)if(ze.nd)w[Le]=(ze.qb|We<<8)>>>0;else{if(se(ue),Ze=Ne(ze.G[1],ze.H[1],ue),se(ue),vt=Ne(ze.G[2],ze.H[2],ue),lt=Ne(ze.G[3],ze.H[3],ue),ue.h)break;w[Le]=(lt<<24|Ze<<16|We<<8|vt)>>>0}if(Ze=!1,++Le,++re>=R&&(re=0,++te,W!=null&&te<=G&&!(te%16)&&W(v,te),Te!=null))for(;le<Le;)We=w[le++],Te.X[(506832829*We&4294967295)>>>Te.Mb]=We}else if(280>We){if(We=de(We-256,ue),vt=Ne(ze.G[4],ze.H[4],ue),se(ue),vt=Se(R,vt=de(vt,ue)),ue.h)break;if(Le-L<vt||H-Le<We)break e;for(lt=0;lt<We;++lt)w[Le+lt]=w[Le+lt-vt];for(Le+=We,re+=We;re>=R;)re-=R,++te,W!=null&&te<=G&&!(te%16)&&W(v,te);if(e(Le<=H),re&Pe&&(ze=Xe(ye,re,te)),Te!=null)for(;le<Le;)We=w[le++],Te.X[(506832829*We&4294967295)>>>Te.Mb]=We}else{if(!(We<Ce))break e;for(Ze=We-280,e(Te!=null);le<Le;)We=w[le++],Te.X[(506832829*We&4294967295)>>>Te.Mb]=We;We=Le,e(!(Ze>>>(vt=Te).Xa)),w[We]=vt.X[Ze],Ze=!0}Ze||e(ue.h==ie(ue))}if(v.Pb&&ue.h&&Le<H)e(v.m.h),v.a=5,v.m=v.wd,v.$=v.xd,0<v.s.ua&&qe(v.s.vb,v.s.Wa);else{if(ue.h)break e;W!=null&&W(v,te>G?G:te),v.a=0,v.$=Le-L}return 1}return v.a=3,0}function st(v){e(v!=null),v.vc=null,v.yc=null,v.Ya=null;var w=v.Wa;w!=null&&(w.X=null),v.vb=null,e(v!=null)}function Ht(){var v=new Yt;return v==null?null:(v.a=0,v.xb=Vf,Gn("Predictor","VP8LPredictors"),Gn("Predictor","VP8LPredictors_C"),Gn("PredictorAdd","VP8LPredictorsAdd"),Gn("PredictorAdd","VP8LPredictorsAdd_C"),Tr=zt,Dl=Xt,kl=lr,zs=dn,qs=bt,vs=qt,Ho=pn,B.VP8LMapColor32b=ms,B.VP8LMapColor8b=ma,v)}function Zt(v,w,L,R,H){var G=1,W=[v],te=[w],re=R.m,ue=R.s,ye=null,Le=0;e:for(;;){if(L)for(;G&&U(re,1);){var le=W,_e=te,Ce=R,Ie=1,Te=Ce.m,Pe=Ce.gc[Ce.ab],ze=U(Te,2);if(Ce.Oc&1<<ze)G=0;else{switch(Ce.Oc|=1<<ze,Pe.hc=ze,Pe.Ea=le[0],Pe.nc=_e[0],Pe.K=[null],++Ce.ab,e(4>=Ce.ab),ze){case 0:case 1:Pe.b=U(Te,3)+2,Ie=Zt(Ye(Pe.Ea,Pe.b),Ye(Pe.nc,Pe.b),0,Ce,Pe.K),Pe.K=Pe.K[0];break;case 3:var Ze,We=U(Te,8)+1,vt=16<We?0:4<We?1:2<We?2:3;if(le[0]=Ye(Pe.Ea,vt),Pe.b=vt,Ze=Ie=Zt(We,1,0,Ce,Pe.K)){var lt,en=We,dt=Pe,wn=1<<(8>>dt.b),cr=s(wn);if(cr==null)Ze=0;else{var sn=dt.K[0],ut=dt.w;for(cr[0]=dt.K[0][0],lt=1;lt<1*en;++lt)cr[lt]=gt(sn[ut+lt],cr[lt-1]);for(;lt<4*wn;++lt)cr[lt]=0;dt.K[0]=null,dt.K[0]=cr,Ze=1}}Ie=Ze;break;case 2:break;default:e(0)}G=Ie}}if(W=W[0],te=te[0],G&&U(re,1)&&!(G=1<=(Le=U(re,4))&&11>=Le)){R.a=3;break e}var nt;if(nt=G)t:{var gr,Bt,un,$n=R,Zr=W,wa=te,ar=Le,Fr=L,Oa=$n.m,Ur=$n.s,vn=[null],Ln=1,vr=0,kn=Ai[ar];n:for(;;){if(Fr&&U(Oa,1)){var Qr=U(Oa,3)+2,yr=Ye(Zr,Qr),On=Ye(wa,Qr),jr=yr*On;if(!Zt(yr,On,0,$n,vn))break n;for(vn=vn[0],Ur.xc=Qr,gr=0;gr<jr;++gr){var zn=vn[gr]>>8&65535;vn[gr]=zn,zn>=Ln&&(Ln=zn+1)}}if(Oa.h)break n;for(Bt=0;5>Bt;++Bt){var Br=Wo[Bt];!Bt&&0<ar&&(Br+=1<<ar),vr<Br&&(vr=Br)}var $r=l(Ln*kn,J),Zn=Ln,Tn=l(Zn,me);if(Tn==null)var ja=null;else e(65536>=Zn),ja=Tn;var _r=s(vr);if(ja==null||_r==null||$r==null){$n.a=1;break n}var Rt=$r;for(gr=un=0;gr<Ln;++gr){var Dt=ja[gr],jn=Dt.G,Za=Dt.H,Li=0,za=1,zr=0;for(Bt=0;5>Bt;++Bt){Br=Wo[Bt],jn[Bt]=Rt,Za[Bt]=un,!Bt&&0<ar&&(Br+=1<<ar);a:{var wo,xo=Br,Oc=$n,ir=_r,Gf=Rt,Wf=un,jc=0,Gs=Oc.m,bg=U(Gs,1);if(a(ir,0,0,xo),bg){var Kf=U(Gs,1)+1,Jf=U(Gs,1),Rc=U(Gs,Jf==0?1:8);ir[Rc]=1,Kf==2&&(ir[Rc=U(Gs,8)]=1);var sa=1}else{var Er=s(19),Iu=U(Gs,4)+4;if(19<Iu){Oc.a=3;var So=0;break a}for(wo=0;wo<Iu;++wo)Er[ku[wo]]=U(Gs,3);var $l=void 0,Xo=void 0,ws=Oc,Dc=Er,zl=xo,kc=ir,Mc=0,Ws=ws.m,Xf=8,Zf=l(128,J);r:for(;z(Zf,0,7,Dc,19);){if(U(Ws,1)){var Cd=2+2*U(Ws,3);if(($l=2+U(Ws,Cd))>zl)break r}else $l=zl;for(Xo=0;Xo<zl&&$l--;){se(Ws);var Qf=Zf[0+(127&K(Ws))];V(Ws,Ws.u+Qf.g);var _o=Qf.value;if(16>_o)kc[Xo++]=_o,_o!=0&&(Xf=_o);else{var Td=_o==16,Ld=_o-16,Od=Il[Ld],eh=U(Ws,_i[Ld])+Od;if(Xo+eh>zl)break r;for(var jd=Td?Xf:0;0<eh--;)kc[Xo++]=jd}}Mc=1;break r}Mc||(ws.a=3),sa=Mc}(sa=sa&&!Gs.h)&&(jc=z(Gf,Wf,8,ir,xo)),sa&&jc!=0?So=jc:(Oc.a=3,So=0)}if(So==0)break n;if(za&&Ec[Bt]==1&&(za=Rt[un].g==0),Li+=Rt[un].g,un+=So,3>=Bt){var Zo,Pc=_r[0];for(Zo=1;Zo<Br;++Zo)_r[Zo]>Pc&&(Pc=_r[Zo]);zr+=Pc}}if(Dt.nd=za,Dt.Qb=0,za&&(Dt.qb=(jn[3][Za[3]+0].value<<24|jn[1][Za[1]+0].value<<16|jn[2][Za[2]+0].value)>>>0,Li==0&&256>jn[0][Za[0]+0].value&&(Dt.Qb=1,Dt.qb+=jn[0][Za[0]+0].value<<8)),Dt.jc=!Dt.Qb&&6>zr,Dt.jc){var Fu,xs=Dt;for(Fu=0;Fu<fo;++Fu){var Ks=Fu,Js=xs.pd[Ks],Ic=xs.G[0][xs.H[0]+Ks];256<=Ic.value?(Js.g=Ic.g+256,Js.value=Ic.value):(Js.g=0,Js.value=0,Ks>>=He(Ic,8,Js),Ks>>=He(xs.G[1][xs.H[1]+Ks],16,Js),Ks>>=He(xs.G[2][xs.H[2]+Ks],0,Js),He(xs.G[3][xs.H[3]+Ks],24,Js))}}}Ur.vc=vn,Ur.Wb=Ln,Ur.Ya=ja,Ur.yc=$r,nt=1;break t}nt=0}if(!(G=nt)){R.a=3;break e}if(0<Le){if(ue.ua=1<<Le,!ee(ue.Wa,Le)){R.a=1,G=0;break e}}else ue.ua=0;var Fc=R,Qo=W,Rd=te,ql=Fc.s,Hl=ql.xc;if(Fc.c=Qo,Fc.i=Rd,ql.md=Ye(Qo,Hl),ql.wc=Hl==0?-1:(1<<Hl)-1,L){R.xb=mo;break e}if((ye=s(W*te))==null){R.a=1,G=0;break e}G=(G=Ct(R,ye,0,W,te,te,null))&&!re.h;break e}return G?(H!=null?H[0]=ye:(e(ye==null),e(L)),R.$=0,L||st(ue)):st(ue),G}function Bn(v,w){var L=v.c*v.i,R=L+w+16*w;return e(v.c<=w),v.V=s(R),v.V==null?(v.Ta=null,v.Ua=0,v.a=1,0):(v.Ta=v.V,v.Ua=v.Ba+L+w,1)}function Kn(v,w){var L=v.C,R=w-L,H=v.V,G=v.Ba+v.c*L;for(e(w<=v.l.o);0<R;){var W=16<R?16:R,te=v.l.ma,re=v.l.width,ue=re*W,ye=te.ca,Le=te.tb+re*L,le=v.Ta,_e=v.Ua;ht(v,W,H,G),di(le,_e,ye,Le,ue),et(te,L,L+W,ye,Le,re),R-=W,H+=W*v.c,L+=W}e(L==w),v.C=v.Ma=w}function Jn(){this.ub=this.yd=this.td=this.Rb=0}function hn(){this.Kd=this.Ld=this.Ud=this.Td=this.i=this.c=0}function Mr(){this.Fb=this.Bb=this.Cb=0,this.Zb=s(4),this.Lb=s(4)}function ra(){this.Yb=(function(){var v=[];return(function w(L,R,H){for(var G=H[R],W=0;W<G&&(L.push(H.length>R+1?[]:0),!(H.length<R+1));W++)w(L[W],R+1,H)})(v,0,[3,11]),v})()}function Xn(){this.jb=s(3),this.Wc=u([4,8],ra),this.Xc=u([4,17],ra)}function Ka(){this.Pc=this.wb=this.Tb=this.zd=0,this.vd=new s(4),this.od=new s(4)}function dr(){this.ld=this.La=this.dd=this.tc=0}function Ma(){this.Na=this.la=0}function Pa(){this.Sc=[0,0],this.Eb=[0,0],this.Qc=[0,0],this.ia=this.lc=0}function oi(){this.ad=s(384),this.Za=0,this.Ob=s(16),this.$b=this.Ad=this.ia=this.Gc=this.Hc=this.Dd=0}function is(){this.uc=this.M=this.Nb=0,this.wa=Array(new dr),this.Y=0,this.ya=Array(new oi),this.aa=0,this.l=new Na}function ss(){this.y=s(16),this.f=s(8),this.ea=s(8)}function gn(){this.cb=this.a=0,this.sc="",this.m=new j,this.Od=new Jn,this.Kc=new hn,this.ed=new Ka,this.Qa=new Mr,this.Ic=this.$c=this.Aa=0,this.D=new is,this.Xb=this.Va=this.Hb=this.zb=this.yb=this.Ub=this.za=0,this.Jc=l(8,j),this.ia=0,this.pb=l(4,Pa),this.Pa=new Xn,this.Bd=this.kc=0,this.Ac=[],this.Bc=0,this.zc=[0,0,0,0],this.Gd=Array(new ss),this.Hd=0,this.rb=Array(new Ma),this.sb=0,this.wa=Array(new dr),this.Y=0,this.oc=[],this.pc=0,this.sa=[],this.ta=0,this.qa=[],this.ra=0,this.Ha=[],this.B=this.R=this.Ia=0,this.Ec=[],this.M=this.ja=this.Vb=this.Fc=0,this.ya=Array(new oi),this.L=this.aa=0,this.gd=u([4,2],dr),this.ga=null,this.Fa=[],this.Cc=this.qc=this.P=0,this.Gb=[],this.Uc=0,this.mb=[],this.nb=0,this.rc=[],this.Ga=this.Vc=0}function Pn(v,w){return 0>v?0:v>w?w:v}function Na(){this.T=this.U=this.ka=this.height=this.width=0,this.y=[],this.f=[],this.ea=[],this.Rc=this.fa=this.W=this.N=this.O=0,this.ma="void",this.put="VP8IoPutHook",this.ac="VP8IoSetupHook",this.bc="VP8IoTeardownHook",this.ha=this.Kb=0,this.data=[],this.hb=this.ib=this.da=this.o=this.j=this.va=this.v=this.Da=this.ob=this.w=0,this.F=[],this.J=0}function Kr(){var v=new gn;return v!=null&&(v.a=0,v.sc="OK",v.cb=0,v.Xb=0,pi||(pi=ls)),v}function jt(v,w,L){return v.a==0&&(v.a=w,v.sc=L,v.cb=0),0}function os(v,w,L){return 3<=L&&v[w+0]==157&&v[w+1]==1&&v[w+2]==42}function li(v,w){if(v==null)return 0;if(v.a=0,v.sc="OK",w==null)return jt(v,2,"null VP8Io passed to VP8GetHeaders()");var L=w.data,R=w.w,H=w.ha;if(4>H)return jt(v,7,"Truncated header.");var G=L[R+0]|L[R+1]<<8|L[R+2]<<16,W=v.Od;if(W.Rb=!(1&G),W.td=G>>1&7,W.yd=G>>4&1,W.ub=G>>5,3<W.td)return jt(v,3,"Incorrect keyframe parameters.");if(!W.yd)return jt(v,4,"Frame not displayable.");R+=3,H-=3;var te=v.Kc;if(W.Rb){if(7>H)return jt(v,7,"cannot parse picture header");if(!os(L,R,H))return jt(v,3,"Bad code word");te.c=16383&(L[R+4]<<8|L[R+3]),te.Td=L[R+4]>>6,te.i=16383&(L[R+6]<<8|L[R+5]),te.Ud=L[R+6]>>6,R+=7,H-=7,v.za=te.c+15>>4,v.Ub=te.i+15>>4,w.width=te.c,w.height=te.i,w.Da=0,w.j=0,w.v=0,w.va=w.width,w.o=w.height,w.da=0,w.ib=w.width,w.hb=w.height,w.U=w.width,w.T=w.height,a((G=v.Pa).jb,0,255,G.jb.length),e((G=v.Qa)!=null),G.Cb=0,G.Bb=0,G.Fb=1,a(G.Zb,0,0,G.Zb.length),a(G.Lb,0,0,G.Lb)}if(W.ub>H)return jt(v,7,"bad partition length");Z(G=v.m,L,R,W.ub),R+=W.ub,H-=W.ub,W.Rb&&(te.Ld=xe(G),te.Kd=xe(G)),te=v.Qa;var re,ue=v.Pa;if(e(G!=null),e(te!=null),te.Cb=xe(G),te.Cb){if(te.Bb=xe(G),xe(G)){for(te.Fb=xe(G),re=0;4>re;++re)te.Zb[re]=xe(G)?oe(G,7):0;for(re=0;4>re;++re)te.Lb[re]=xe(G)?oe(G,6):0}if(te.Bb)for(re=0;3>re;++re)ue.jb[re]=xe(G)?ce(G,8):255}else te.Bb=0;if(G.Ka)return jt(v,3,"cannot parse segment header");if((te=v.ed).zd=xe(G),te.Tb=ce(G,6),te.wb=ce(G,3),te.Pc=xe(G),te.Pc&&xe(G)){for(ue=0;4>ue;++ue)xe(G)&&(te.vd[ue]=oe(G,6));for(ue=0;4>ue;++ue)xe(G)&&(te.od[ue]=oe(G,6))}if(v.L=te.Tb==0?0:te.zd?1:2,G.Ka)return jt(v,3,"cannot parse filter header");var ye=H;if(H=re=R,R=re+ye,te=ye,v.Xb=(1<<ce(v.m,2))-1,ye<3*(ue=v.Xb))L=7;else{for(re+=3*ue,te-=3*ue,ye=0;ye<ue;++ye){var Le=L[H+0]|L[H+1]<<8|L[H+2]<<16;Le>te&&(Le=te),Z(v.Jc[+ye],L,re,Le),re+=Le,te-=Le,H+=3}Z(v.Jc[+ue],L,re,te),L=re<R?0:5}if(L!=0)return jt(v,L,"cannot parse partitions");for(L=ce(re=v.m,7),H=xe(re)?oe(re,4):0,R=xe(re)?oe(re,4):0,te=xe(re)?oe(re,4):0,ue=xe(re)?oe(re,4):0,re=xe(re)?oe(re,4):0,ye=v.Qa,Le=0;4>Le;++Le){if(ye.Cb){var le=ye.Zb[Le];ye.Fb||(le+=L)}else{if(0<Le){v.pb[Le]=v.pb[0];continue}le=L}var _e=v.pb[Le];_e.Sc[0]=Ni[Pn(le+H,127)],_e.Sc[1]=Ci[Pn(le+0,127)],_e.Eb[0]=2*Ni[Pn(le+R,127)],_e.Eb[1]=101581*Ci[Pn(le+te,127)]>>16,8>_e.Eb[1]&&(_e.Eb[1]=8),_e.Qc[0]=Ni[Pn(le+ue,117)],_e.Qc[1]=Ci[Pn(le+re,127)],_e.lc=le+re}if(!W.Rb)return jt(v,4,"Not a key frame.");for(xe(G),W=v.Pa,L=0;4>L;++L){for(H=0;8>H;++H)for(R=0;3>R;++R)for(te=0;11>te;++te)ue=Oe(G,ur[L][H][R][te])?ce(G,8):Ad[L][H][R][te],W.Wc[L][H].Yb[R][te]=ue;for(H=0;17>H;++H)W.Xc[L][H]=W.Wc[L][xn[H]]}return v.kc=xe(G),v.kc&&(v.Bd=ce(G,8)),v.cb=1}function ls(v,w,L,R,H,G,W){var te=w[H].Yb[L];for(L=0;16>H;++H){if(!Oe(v,te[L+0]))return H;for(;!Oe(v,te[L+1]);)if(te=w[++H].Yb[0],L=0,H==16)return 16;var re=w[H+1].Yb;if(Oe(v,te[L+2])){var ue=v,ye=0;if(Oe(ue,(le=te)[(Le=L)+3]))if(Oe(ue,le[Le+6])){for(te=0,Le=2*(ye=Oe(ue,le[Le+8]))+(le=Oe(ue,le[Le+9+ye])),ye=0,le=Ed[Le];le[te];++te)ye+=ye+Oe(ue,le[te]);ye+=3+(8<<Le)}else Oe(ue,le[Le+7])?(ye=7+2*Oe(ue,165),ye+=Oe(ue,145)):ye=5+Oe(ue,159);else ye=Oe(ue,le[Le+4])?3+Oe(ue,le[Le+5]):2;te=re[2]}else ye=1,te=re[1];re=W+Hf[H],0>(ue=v).b&&be(ue);var Le,le=ue.b,_e=(Le=ue.Ca>>1)-(ue.I>>le)>>31;--ue.b,ue.Ca+=_e,ue.Ca|=1,ue.I-=(Le+1&_e)<<le,G[re]=((ye^_e)-_e)*R[(0<H)+0]}return 16}function mu(v){var w=v.rb[v.sb-1];w.la=0,w.Na=0,a(v.zc,0,0,v.zc.length),v.ja=0}function Ia(v,w,L,R,H){H=v[w+L+32*R]+(H>>3),v[w+L+32*R]=-256&H?0>H?0:255:H}function Jr(v,w,L,R,H,G){Ia(v,w,0,L,R+H),Ia(v,w,1,L,R+G),Ia(v,w,2,L,R-G),Ia(v,w,3,L,R-H)}function Pr(v){return(20091*v>>16)+v}function El(v,w,L,R){var H,G=0,W=s(16);for(H=0;4>H;++H){var te=v[w+0]+v[w+8],re=v[w+0]-v[w+8],ue=(35468*v[w+4]>>16)-Pr(v[w+12]),ye=Pr(v[w+4])+(35468*v[w+12]>>16);W[G+0]=te+ye,W[G+1]=re+ue,W[G+2]=re-ue,W[G+3]=te-ye,G+=4,w++}for(H=G=0;4>H;++H)te=(v=W[G+0]+4)+W[G+8],re=v-W[G+8],ue=(35468*W[G+4]>>16)-Pr(W[G+12]),Ia(L,R,0,0,te+(ye=Pr(W[G+4])+(35468*W[G+12]>>16))),Ia(L,R,1,0,re+ue),Ia(L,R,2,0,re-ue),Ia(L,R,3,0,te-ye),G++,R+=32}function lc(v,w,L,R){var H=v[w+0]+4,G=35468*v[w+4]>>16,W=Pr(v[w+4]),te=35468*v[w+1]>>16;Jr(L,R,0,H+W,v=Pr(v[w+1]),te),Jr(L,R,1,H+G,v,te),Jr(L,R,2,H-G,v,te),Jr(L,R,3,H-W,v,te)}function gu(v,w,L,R,H){El(v,w,L,R),H&&El(v,w+16,L,R+4)}function Fa(v,w,L,R){Hs(v,w+0,L,R,1),Hs(v,w+32,L,R+128,1)}function vu(v,w,L,R){var H;for(v=v[w+0]+4,H=0;4>H;++H)for(w=0;4>w;++w)Ia(L,R,w,H,v)}function yu(v,w,L,R){v[w+0]&&Dn(v,w+0,L,R),v[w+16]&&Dn(v,w+16,L,R+4),v[w+32]&&Dn(v,w+32,L,R+128),v[w+48]&&Dn(v,w+48,L,R+128+4)}function Bi(v,w,L,R){var H,G=s(16);for(H=0;4>H;++H){var W=v[w+0+H]+v[w+12+H],te=v[w+4+H]+v[w+8+H],re=v[w+4+H]-v[w+8+H],ue=v[w+0+H]-v[w+12+H];G[0+H]=W+te,G[8+H]=W-te,G[4+H]=ue+re,G[12+H]=ue-re}for(H=0;4>H;++H)W=(v=G[0+4*H]+3)+G[3+4*H],te=G[1+4*H]+G[2+4*H],re=G[1+4*H]-G[2+4*H],ue=v-G[3+4*H],L[R+0]=W+te>>3,L[R+16]=ue+re>>3,L[R+32]=W-te>>3,L[R+48]=ue-re>>3,R+=64}function Io(v,w,L){var R,H=w-32,G=Ta,W=255-v[H-1];for(R=0;R<L;++R){var te,re=G,ue=W+v[w-1];for(te=0;te<L;++te)v[w+te]=re[ue+v[H+te]];w+=32}}function uc(v,w){Io(v,w,4)}function cc(v,w){Io(v,w,8)}function bu(v,w){Io(v,w,16)}function wu(v,w){var L;for(L=0;16>L;++L)r(v,w+32*L,v,w-32,16)}function fc(v,w){var L;for(L=16;0<L;--L)a(v,w,v[w-1],16),w+=32}function Ja(v,w,L){var R;for(R=0;16>R;++R)a(w,L+32*R,v,16)}function $i(v,w){var L,R=16;for(L=0;16>L;++L)R+=v[w-1+32*L]+v[w+L-32];Ja(R>>5,v,w)}function Ts(v,w){var L,R=8;for(L=0;16>L;++L)R+=v[w-1+32*L];Ja(R>>4,v,w)}function Fo(v,w){var L,R=8;for(L=0;16>L;++L)R+=v[w+L-32];Ja(R>>4,v,w)}function lo(v,w){Ja(128,v,w)}function Ut(v,w,L){return v+2*w+L+2>>2}function hc(v,w){var L,R=w-32;for(R=new Uint8Array([Ut(v[R-1],v[R+0],v[R+1]),Ut(v[R+0],v[R+1],v[R+2]),Ut(v[R+1],v[R+2],v[R+3]),Ut(v[R+2],v[R+3],v[R+4])]),L=0;4>L;++L)r(v,w+32*L,R,0,R.length)}function xu(v,w){var L=v[w-1],R=v[w-1+32],H=v[w-1+64],G=v[w-1+96];Me(v,w+0,16843009*Ut(v[w-1-32],L,R)),Me(v,w+32,16843009*Ut(L,R,H)),Me(v,w+64,16843009*Ut(R,H,G)),Me(v,w+96,16843009*Ut(H,G,G))}function dc(v,w){var L,R=4;for(L=0;4>L;++L)R+=v[w+L-32]+v[w-1+32*L];for(R>>=3,L=0;4>L;++L)a(v,w+32*L,R,4)}function ui(v,w){var L=v[w-1+0],R=v[w-1+32],H=v[w-1+64],G=v[w-1-32],W=v[w+0-32],te=v[w+1-32],re=v[w+2-32],ue=v[w+3-32];v[w+0+96]=Ut(R,H,v[w-1+96]),v[w+1+96]=v[w+0+64]=Ut(L,R,H),v[w+2+96]=v[w+1+64]=v[w+0+32]=Ut(G,L,R),v[w+3+96]=v[w+2+64]=v[w+1+32]=v[w+0+0]=Ut(W,G,L),v[w+3+64]=v[w+2+32]=v[w+1+0]=Ut(te,W,G),v[w+3+32]=v[w+2+0]=Ut(re,te,W),v[w+3+0]=Ut(ue,re,te)}function da(v,w){var L=v[w+1-32],R=v[w+2-32],H=v[w+3-32],G=v[w+4-32],W=v[w+5-32],te=v[w+6-32],re=v[w+7-32];v[w+0+0]=Ut(v[w+0-32],L,R),v[w+1+0]=v[w+0+32]=Ut(L,R,H),v[w+2+0]=v[w+1+32]=v[w+0+64]=Ut(R,H,G),v[w+3+0]=v[w+2+32]=v[w+1+64]=v[w+0+96]=Ut(H,G,W),v[w+3+32]=v[w+2+64]=v[w+1+96]=Ut(G,W,te),v[w+3+64]=v[w+2+96]=Ut(W,te,re),v[w+3+96]=Ut(te,re,re)}function Su(v,w){var L=v[w-1+0],R=v[w-1+32],H=v[w-1+64],G=v[w-1-32],W=v[w+0-32],te=v[w+1-32],re=v[w+2-32],ue=v[w+3-32];v[w+0+0]=v[w+1+64]=G+W+1>>1,v[w+1+0]=v[w+2+64]=W+te+1>>1,v[w+2+0]=v[w+3+64]=te+re+1>>1,v[w+3+0]=re+ue+1>>1,v[w+0+96]=Ut(H,R,L),v[w+0+64]=Ut(R,L,G),v[w+0+32]=v[w+1+96]=Ut(L,G,W),v[w+1+32]=v[w+2+96]=Ut(G,W,te),v[w+2+32]=v[w+3+96]=Ut(W,te,re),v[w+3+32]=Ut(te,re,ue)}function Uo(v,w){var L=v[w+0-32],R=v[w+1-32],H=v[w+2-32],G=v[w+3-32],W=v[w+4-32],te=v[w+5-32],re=v[w+6-32],ue=v[w+7-32];v[w+0+0]=L+R+1>>1,v[w+1+0]=v[w+0+64]=R+H+1>>1,v[w+2+0]=v[w+1+64]=H+G+1>>1,v[w+3+0]=v[w+2+64]=G+W+1>>1,v[w+0+32]=Ut(L,R,H),v[w+1+32]=v[w+0+96]=Ut(R,H,G),v[w+2+32]=v[w+1+96]=Ut(H,G,W),v[w+3+32]=v[w+2+96]=Ut(G,W,te),v[w+3+64]=Ut(W,te,re),v[w+3+96]=Ut(te,re,ue)}function ci(v,w){var L=v[w-1+0],R=v[w-1+32],H=v[w-1+64],G=v[w-1+96];v[w+0+0]=L+R+1>>1,v[w+2+0]=v[w+0+32]=R+H+1>>1,v[w+2+32]=v[w+0+64]=H+G+1>>1,v[w+1+0]=Ut(L,R,H),v[w+3+0]=v[w+1+32]=Ut(R,H,G),v[w+3+32]=v[w+1+64]=Ut(H,G,G),v[w+3+64]=v[w+2+64]=v[w+0+96]=v[w+1+96]=v[w+2+96]=v[w+3+96]=G}function Bo(v,w){var L=v[w-1+0],R=v[w-1+32],H=v[w-1+64],G=v[w-1+96],W=v[w-1-32],te=v[w+0-32],re=v[w+1-32],ue=v[w+2-32];v[w+0+0]=v[w+2+32]=L+W+1>>1,v[w+0+32]=v[w+2+64]=R+L+1>>1,v[w+0+64]=v[w+2+96]=H+R+1>>1,v[w+0+96]=G+H+1>>1,v[w+3+0]=Ut(te,re,ue),v[w+2+0]=Ut(W,te,re),v[w+1+0]=v[w+3+32]=Ut(L,W,te),v[w+1+32]=v[w+3+64]=Ut(R,L,W),v[w+1+64]=v[w+3+96]=Ut(H,R,L),v[w+1+96]=Ut(G,H,R)}function us(v,w){var L;for(L=0;8>L;++L)r(v,w+32*L,v,w-32,8)}function pc(v,w){var L;for(L=0;8>L;++L)a(v,w,v[w-1],8),w+=32}function yi(v,w,L){var R;for(R=0;8>R;++R)a(w,L+32*R,v,8)}function Al(v,w){var L,R=8;for(L=0;8>L;++L)R+=v[w+L-32]+v[w-1+32*L];yi(R>>4,v,w)}function Nl(v,w){var L,R=4;for(L=0;8>L;++L)R+=v[w+L-32];yi(R>>3,v,w)}function aa(v,w){var L,R=4;for(L=0;8>L;++L)R+=v[w-1+32*L];yi(R>>3,v,w)}function cs(v,w){yi(128,v,w)}function bi(v,w,L){var R=v[w-L],H=v[w+0],G=3*(H-R)+Vs[1020+v[w-2*L]-v[w+L]],W=ju[112+(G+4>>3)];v[w-L]=Ta[255+R+ju[112+(G+3>>3)]],v[w+0]=Ta[255+H-W]}function Ls(v,w,L,R){var H=v[w+0],G=v[w+L];return ga[255+v[w-2*L]-v[w-L]]>R||ga[255+G-H]>R}function Cl(v,w,L,R){return 4*ga[255+v[w-L]-v[w+0]]+ga[255+v[w-2*L]-v[w+L]]<=R}function $o(v,w,L,R,H){var G=v[w-3*L],W=v[w-2*L],te=v[w-L],re=v[w+0],ue=v[w+L],ye=v[w+2*L],Le=v[w+3*L];return 4*ga[255+te-re]+ga[255+W-ue]>R?0:ga[255+v[w-4*L]-G]<=H&&ga[255+G-W]<=H&&ga[255+W-te]<=H&&ga[255+Le-ye]<=H&&ga[255+ye-ue]<=H&&ga[255+ue-re]<=H}function Os(v,w,L,R){var H=2*R+1;for(R=0;16>R;++R)Cl(v,w+R,L,H)&&bi(v,w+R,L)}function js(v,w,L,R){var H=2*R+1;for(R=0;16>R;++R)Cl(v,w+R*L,1,H)&&bi(v,w+R*L,1)}function zo(v,w,L,R){var H;for(H=3;0<H;--H)Os(v,w+=4*L,L,R)}function _u(v,w,L,R){var H;for(H=3;0<H;--H)js(v,w+=4,L,R)}function Rs(v,w,L,R,H,G,W,te){for(G=2*G+1;0<H--;){if($o(v,w,L,G,W))if(Ls(v,w,L,te))bi(v,w,L);else{var re=v,ue=w,ye=L,Le=re[ue-2*ye],le=re[ue-ye],_e=re[ue+0],Ce=re[ue+ye],Ie=re[ue+2*ye],Te=27*(ze=Vs[1020+3*(_e-le)+Vs[1020+Le-Ce]])+63>>7,Pe=18*ze+63>>7,ze=9*ze+63>>7;re[ue-3*ye]=Ta[255+re[ue-3*ye]+ze],re[ue-2*ye]=Ta[255+Le+Pe],re[ue-ye]=Ta[255+le+Te],re[ue+0]=Ta[255+_e-Te],re[ue+ye]=Ta[255+Ce-Pe],re[ue+2*ye]=Ta[255+Ie-ze]}w+=R}}function Ds(v,w,L,R,H,G,W,te){for(G=2*G+1;0<H--;){if($o(v,w,L,G,W))if(Ls(v,w,L,te))bi(v,w,L);else{var re=v,ue=w,ye=L,Le=re[ue-ye],le=re[ue+0],_e=re[ue+ye],Ce=ju[112+(4+(Ie=3*(le-Le))>>3)],Ie=ju[112+(Ie+3>>3)],Te=Ce+1>>1;re[ue-2*ye]=Ta[255+re[ue-2*ye]+Te],re[ue-ye]=Ta[255+Le+Ie],re[ue+0]=Ta[255+le-Ce],re[ue+ye]=Ta[255+_e-Te]}w+=R}}function mc(v,w,L,R,H,G){Rs(v,w,L,1,16,R,H,G)}function ks(v,w,L,R,H,G){Rs(v,w,1,L,16,R,H,G)}function gc(v,w,L,R,H,G){var W;for(W=3;0<W;--W)Ds(v,w+=4*L,L,1,16,R,H,G)}function C(v,w,L,R,H,G){var W;for(W=3;0<W;--W)Ds(v,w+=4,1,L,16,R,H,G)}function q(v,w,L,R,H,G,W,te){Rs(v,w,H,1,8,G,W,te),Rs(L,R,H,1,8,G,W,te)}function fe(v,w,L,R,H,G,W,te){Rs(v,w,1,H,8,G,W,te),Rs(L,R,1,H,8,G,W,te)}function ve(v,w,L,R,H,G,W,te){Ds(v,w+4*H,H,1,8,G,W,te),Ds(L,R+4*H,H,1,8,G,W,te)}function Ee(v,w,L,R,H,G,W,te){Ds(v,w+4,1,H,8,G,W,te),Ds(L,R+4,1,H,8,G,W,te)}function $e(){this.ba=new Qt,this.ec=[],this.cc=[],this.Mc=[],this.Dc=this.Nc=this.dc=this.fc=0,this.Oa=new bn,this.memory=0,this.Ib="OutputFunc",this.Jb="OutputAlphaFunc",this.Nd="OutputRowFunc"}function Je(){this.data=[],this.offset=this.kd=this.ha=this.w=0,this.na=[],this.xa=this.gb=this.Ja=this.Sa=this.P=0}function pt(){this.nc=this.Ea=this.b=this.hc=0,this.K=[],this.w=0}function xt(){this.ua=0,this.Wa=new ct,this.vb=new ct,this.md=this.xc=this.wc=0,this.vc=[],this.Wb=0,this.Ya=new me,this.yc=new J}function Yt(){this.xb=this.a=0,this.l=new Na,this.ca=new Qt,this.V=[],this.Ba=0,this.Ta=[],this.Ua=0,this.m=new Y,this.Pb=0,this.wd=new Y,this.Ma=this.$=this.C=this.i=this.c=this.xd=0,this.s=new xt,this.ab=0,this.gc=l(4,pt),this.Oc=0}function an(){this.Lc=this.Z=this.$a=this.i=this.c=0,this.l=new Na,this.ic=0,this.ca=[],this.tb=0,this.qd=null,this.rd=0}function Nn(v,w,L,R,H,G,W){for(v=v==null?0:v[w+0],w=0;w<W;++w)H[G+w]=v+L[R+w]&255,v=H[G+w]}function mr(v,w,L,R,H,G,W){var te;if(v==null)Nn(null,null,L,R,H,G,W);else for(te=0;te<W;++te)H[G+te]=v[w+te]+L[R+te]&255}function Cr(v,w,L,R,H,G,W){if(v==null)Nn(null,null,L,R,H,G,W);else{var te,re=v[w+0],ue=re,ye=re;for(te=0;te<W;++te)ue=ye+(re=v[w+te])-ue,ye=L[R+te]+(-256&ue?0>ue?0:255:ue)&255,ue=re,H[G+te]=ye}}function nr(v,w,L,R){var H=w.width,G=w.o;if(e(v!=null&&w!=null),0>L||0>=R||L+R>G)return null;if(!v.Cc){if(v.ga==null){var W;if(v.ga=new an,(W=v.ga==null)||(W=w.width*w.o,e(v.Gb.length==0),v.Gb=s(W),v.Uc=0,v.Gb==null?W=0:(v.mb=v.Gb,v.nb=v.Uc,v.rc=null,W=1),W=!W),!W){W=v.ga;var te=v.Fa,re=v.P,ue=v.qc,ye=v.mb,Le=v.nb,le=re+1,_e=ue-1,Ce=W.l;if(e(te!=null&&ye!=null&&w!=null),Ys[0]=null,Ys[1]=Nn,Ys[2]=mr,Ys[3]=Cr,W.ca=ye,W.tb=Le,W.c=w.width,W.i=w.height,e(0<W.c&&0<W.i),1>=ue)w=0;else if(W.$a=3&te[re+0],W.Z=te[re+0]>>2&3,W.Lc=te[re+0]>>4&3,re=te[re+0]>>6&3,0>W.$a||1<W.$a||4<=W.Z||1<W.Lc||re)w=0;else if(Ce.put=Et,Ce.ac=ha,Ce.bc=Ui,Ce.ma=W,Ce.width=w.width,Ce.height=w.height,Ce.Da=w.Da,Ce.v=w.v,Ce.va=w.va,Ce.j=w.j,Ce.o=w.o,W.$a)e:{e(W.$a==1),w=Ht();t:for(;;){if(w==null){w=0;break e}if(e(W!=null),W.mc=w,w.c=W.c,w.i=W.i,w.l=W.l,w.l.ma=W,w.l.width=W.c,w.l.height=W.i,w.a=0,ge(w.m,te,le,_e),!Zt(W.c,W.i,1,w,null)||(w.ab==1&&w.gc[0].hc==3&&Qe(w.s)?(W.ic=1,te=w.c*w.i,w.Ta=null,w.Ua=0,w.V=s(te),w.Ba=0,w.V==null?(w.a=1,w=0):w=1):(W.ic=0,w=Bn(w,W.c)),!w))break t;w=1;break e}W.mc=null,w=0}else w=_e>=W.c*W.i;W=!w}if(W)return null;v.ga.Lc!=1?v.Ga=0:R=G-L}e(v.ga!=null),e(L+R<=G);e:{if(w=(te=v.ga).c,G=te.l.o,te.$a==0){if(le=v.rc,_e=v.Vc,Ce=v.Fa,re=v.P+1+L*w,ue=v.mb,ye=v.nb+L*w,e(re<=v.P+v.qc),te.Z!=0)for(e(Ys[te.Z]!=null),W=0;W<R;++W)Ys[te.Z](le,_e,Ce,re,ue,ye,w),le=ue,_e=ye,ye+=w,re+=w;else for(W=0;W<R;++W)r(ue,ye,Ce,re,w),le=ue,_e=ye,ye+=w,re+=w;v.rc=le,v.Vc=_e}else{if(e(te.mc!=null),w=L+R,e((W=te.mc)!=null),e(w<=W.i),W.C>=w)w=1;else if(te.ic||zi(),te.ic){te=W.V,le=W.Ba,_e=W.c;var Ie=W.i,Te=(Ce=1,re=W.$/_e,ue=W.$%_e,ye=W.m,Le=W.s,W.$),Pe=_e*Ie,ze=_e*w,Ze=Le.wc,We=Te<ze?Xe(Le,ue,re):null;e(Te<=Pe),e(w<=Ie),e(Qe(Le));t:for(;;){for(;!ye.h&&Te<ze;){if(ue&Ze||(We=Xe(Le,ue,re)),e(We!=null),se(ye),256>(Ie=Ne(We.G[0],We.H[0],ye)))te[le+Te]=Ie,++Te,++ue>=_e&&(ue=0,++re<=w&&!(re%16)&&rt(W,re));else{if(!(280>Ie)){Ce=0;break t}Ie=de(Ie-256,ye);var vt,lt=Ne(We.G[4],We.H[4],ye);if(se(ye),!(Te>=(lt=Se(_e,lt=de(lt,ye)))&&Pe-Te>=Ie)){Ce=0;break t}for(vt=0;vt<Ie;++vt)te[le+Te+vt]=te[le+Te+vt-lt];for(Te+=Ie,ue+=Ie;ue>=_e;)ue-=_e,++re<=w&&!(re%16)&&rt(W,re);Te<ze&&ue&Ze&&(We=Xe(Le,ue,re))}e(ye.h==ie(ye))}rt(W,re>w?w:re);break t}!Ce||ye.h&&Te<Pe?(Ce=0,W.a=ye.h?5:3):W.$=Te,w=Ce}else w=Ct(W,W.V,W.Ba,W.c,W.i,w,Kn);if(!w){R=0;break e}}L+R>=G&&(v.Cc=1),R=1}if(!R)return null;if(v.Cc&&((R=v.ga)!=null&&(R.mc=null),v.ga=null,0<v.Ga))return alert("todo:WebPDequantizeLevels"),null}return v.nb+L*H}function Xr(v,w,L,R,H,G){for(;0<H--;){var W,te=v,re=w+(L?1:0),ue=v,ye=w+(L?0:3);for(W=0;W<R;++W){var Le=ue[ye+4*W];Le!=255&&(Le*=32897,te[re+4*W+0]=te[re+4*W+0]*Le>>23,te[re+4*W+1]=te[re+4*W+1]*Le>>23,te[re+4*W+2]=te[re+4*W+2]*Le>>23)}w+=G}}function Ir(v,w,L,R,H){for(;0<R--;){var G;for(G=0;G<L;++G){var W=v[w+2*G+0],te=15&(ue=v[w+2*G+1]),re=4369*te,ue=(240&ue|ue>>4)*re>>16;v[w+2*G+0]=(240&W|W>>4)*re>>16&240|(15&W|W<<4)*re>>16>>4&15,v[w+2*G+1]=240&ue|te}w+=H}}function pa(v,w,L,R,H,G,W,te){var re,ue,ye=255;for(ue=0;ue<H;++ue){for(re=0;re<R;++re){var Le=v[w+re];G[W+4*re]=Le,ye&=Le}w+=L,W+=te}return ye!=255}function Ms(v,w,L,R,H){var G;for(G=0;G<H;++G)L[R+G]=v[w+G]>>8}function zi(){Yo=Xr,xi=Ir,Tu=pa,di=Ms}function Ps(v,w,L){B[v]=function(R,H,G,W,te,re,ue,ye,Le,le,_e,Ce,Ie,Te,Pe,ze,Ze){var We,vt=Ze-1>>1,lt=te[re+0]|ue[ye+0]<<16,en=Le[le+0]|_e[Ce+0]<<16;e(R!=null);var dt=3*lt+en+131074>>2;for(w(R[H+0],255&dt,dt>>16,Ie,Te),G!=null&&(dt=3*en+lt+131074>>2,w(G[W+0],255&dt,dt>>16,Pe,ze)),We=1;We<=vt;++We){var wn=te[re+We]|ue[ye+We]<<16,cr=Le[le+We]|_e[Ce+We]<<16,sn=lt+wn+en+cr+524296,ut=sn+2*(wn+en)>>3;dt=ut+lt>>1,lt=(sn=sn+2*(lt+cr)>>3)+wn>>1,w(R[H+2*We-1],255&dt,dt>>16,Ie,Te+(2*We-1)*L),w(R[H+2*We-0],255&lt,lt>>16,Ie,Te+(2*We-0)*L),G!=null&&(dt=sn+en>>1,lt=ut+cr>>1,w(G[W+2*We-1],255&dt,dt>>16,Pe,ze+(2*We-1)*L),w(G[W+2*We+0],255&lt,lt>>16,Pe,ze+(2*We+0)*L)),lt=wn,en=cr}1&Ze||(dt=3*lt+en+131074>>2,w(R[H+Ze-1],255&dt,dt>>16,Ie,Te+(Ze-1)*L),G!=null&&(dt=3*en+lt+131074>>2,w(G[W+Ze-1],255&dt,dt>>16,Pe,ze+(Ze-1)*L)))}}function Eu(){ya[wc]=Ko,ya[La]=Fl,ya[xc]=Yf,ya[Si]=Nc,ya[Ru]=go,ya[Ml]=bs,ya[ho]=vo,ya[Du]=Fl,ya[Sc]=Nc,ya[Pl]=go,ya[_c]=bs}function Tl(v){return v&-16384?0>v?0:255:v>>Cc}function fs(v,w){return Tl((19077*v>>8)+(26149*w>>8)-14234)}function qi(v,w,L){return Tl((19077*v>>8)-(6419*w>>8)-(13320*L>>8)+8708)}function qo(v,w){return Tl((19077*v>>8)+(33050*w>>8)-17685)}function Is(v,w,L,R,H){R[H+0]=fs(v,L),R[H+1]=qi(v,w,L),R[H+2]=qo(v,w)}function ia(v,w,L,R,H){R[H+0]=qo(v,w),R[H+1]=qi(v,w,L),R[H+2]=fs(v,L)}function uo(v,w,L,R,H){var G=qi(v,w,L);w=G<<3&224|qo(v,w)>>3,R[H+0]=248&fs(v,L)|G>>5,R[H+1]=w}function co(v,w,L,R,H){var G=240&qo(v,w)|15;R[H+0]=240&fs(v,L)|qi(v,w,L)>>4,R[H+1]=G}function Ll(v,w,L,R,H){R[H+0]=255,Is(v,w,L,R,H+1)}function hs(v,w,L,R,H){ia(v,w,L,R,H),R[H+3]=255}function Ua(v,w,L,R,H){Is(v,w,L,R,H),R[H+3]=255}function Fs(v,w,L){B[v]=function(R,H,G,W,te,re,ue,ye,Le){for(var le=ye+(-2&Le)*L;ye!=le;)w(R[H+0],G[W+0],te[re+0],ue,ye),w(R[H+1],G[W+0],te[re+0],ue,ye+L),H+=2,++W,++re,ye+=2*L;1&Le&&w(R[H+0],G[W+0],te[re+0],ue,ye)}}function Ol(v,w,L){return L==0?v==0?w==0?6:5:w==0?4:0:L}function Au(v,w,L,R,H){switch(v>>>30){case 3:Hs(w,L,R,H,0);break;case 2:Ca(w,L,R,H);break;case 1:Dn(w,L,R,H)}}function fi(v,w){var L,R,H=w.M,G=w.Nb,W=v.oc,te=v.pc+40,re=v.oc,ue=v.pc+584,ye=v.oc,Le=v.pc+600;for(L=0;16>L;++L)W[te+32*L-1]=129;for(L=0;8>L;++L)re[ue+32*L-1]=129,ye[Le+32*L-1]=129;for(0<H?W[te-1-32]=re[ue-1-32]=ye[Le-1-32]=129:(a(W,te-32-1,127,21),a(re,ue-32-1,127,9),a(ye,Le-32-1,127,9)),R=0;R<v.za;++R){var le=w.ya[w.aa+R];if(0<R){for(L=-1;16>L;++L)r(W,te+32*L-4,W,te+32*L+12,4);for(L=-1;8>L;++L)r(re,ue+32*L-4,re,ue+32*L+4,4),r(ye,Le+32*L-4,ye,Le+32*L+4,4)}var _e=v.Gd,Ce=v.Hd+R,Ie=le.ad,Te=le.Hc;if(0<H&&(r(W,te-32,_e[Ce].y,0,16),r(re,ue-32,_e[Ce].f,0,8),r(ye,Le-32,_e[Ce].ea,0,8)),le.Za){var Pe=W,ze=te-32+16;for(0<H&&(R>=v.za-1?a(Pe,ze,_e[Ce].y[15],4):r(Pe,ze,_e[Ce+1].y,0,4)),L=0;4>L;L++)Pe[ze+128+L]=Pe[ze+256+L]=Pe[ze+384+L]=Pe[ze+0+L];for(L=0;16>L;++L,Te<<=2)Pe=W,ze=te+Or[L],Sr[le.Ob[L]](Pe,ze),Au(Te,Ie,16*+L,Pe,ze)}else if(Pe=Ol(R,H,le.Ob[0]),$a[Pe](W,te),Te!=0)for(L=0;16>L;++L,Te<<=2)Au(Te,Ie,16*+L,W,te+Or[L]);for(L=le.Gc,Pe=Ol(R,H,le.Dd),Gi[Pe](re,ue),Gi[Pe](ye,Le),Te=Ie,Pe=re,ze=ue,255&(le=0|L)&&(170&le?wi(Te,256,Pe,ze):Cn(Te,256,Pe,ze)),le=ye,Te=Le,255&(L>>=8)&&(170&L?wi(Ie,320,le,Te):Cn(Ie,320,le,Te)),H<v.Ub-1&&(r(_e[Ce].y,0,W,te+480,16),r(_e[Ce].f,0,re,ue+224,8),r(_e[Ce].ea,0,ye,Le+224,8)),L=8*G*v.B,_e=v.sa,Ce=v.ta+16*R+16*G*v.R,Ie=v.qa,le=v.ra+8*R+L,Te=v.Ha,Pe=v.Ia+8*R+L,L=0;16>L;++L)r(_e,Ce+L*v.R,W,te+32*L,16);for(L=0;8>L;++L)r(Ie,le+L*v.B,re,ue+32*L,8),r(Te,Pe+L*v.B,ye,Le+32*L,8)}}function Hi(v,w,L,R,H,G,W,te,re){var ue=[0],ye=[0],Le=0,le=re!=null?re.kd:0,_e=re??new Je;if(v==null||12>L)return 7;_e.data=v,_e.w=w,_e.ha=L,w=[w],L=[L],_e.gb=[_e.gb];e:{var Ce=w,Ie=L,Te=_e.gb;if(e(v!=null),e(Ie!=null),e(Te!=null),Te[0]=0,12<=Ie[0]&&!n(v,Ce[0],"RIFF")){if(n(v,Ce[0]+8,"WEBP")){Te=3;break e}var Pe=Ke(v,Ce[0]+4);if(12>Pe||4294967286<Pe){Te=3;break e}if(le&&Pe>Ie[0]-8){Te=7;break e}Te[0]=Pe,Ce[0]+=12,Ie[0]-=12}Te=0}if(Te!=0)return Te;for(Pe=0<_e.gb[0],L=L[0];;){e:{var ze=v;Ie=w,Te=L;var Ze=ue,We=ye,vt=Ce=[0];if((dt=Le=[Le])[0]=0,8>Te[0])Te=7;else{if(!n(ze,Ie[0],"VP8X")){if(Ke(ze,Ie[0]+4)!=10){Te=3;break e}if(18>Te[0]){Te=7;break e}var lt=Ke(ze,Ie[0]+8),en=1+Be(ze,Ie[0]+12);if(2147483648<=en*(ze=1+Be(ze,Ie[0]+15))){Te=3;break e}vt!=null&&(vt[0]=lt),Ze!=null&&(Ze[0]=en),We!=null&&(We[0]=ze),Ie[0]+=18,Te[0]-=18,dt[0]=1}Te=0}}if(Le=Le[0],Ce=Ce[0],Te!=0)return Te;if(Ie=!!(2&Ce),!Pe&&Le)return 3;if(G!=null&&(G[0]=!!(16&Ce)),W!=null&&(W[0]=Ie),te!=null&&(te[0]=0),W=ue[0],Ce=ye[0],Le&&Ie&&re==null){Te=0;break}if(4>L){Te=7;break}if(Pe&&Le||!Pe&&!Le&&!n(v,w[0],"ALPH")){L=[L],_e.na=[_e.na],_e.P=[_e.P],_e.Sa=[_e.Sa];e:{lt=v,Te=w,Pe=L;var dt=_e.gb;Ze=_e.na,We=_e.P,vt=_e.Sa,en=22,e(lt!=null),e(Pe!=null),ze=Te[0];var wn=Pe[0];for(e(Ze!=null),e(vt!=null),Ze[0]=null,We[0]=null,vt[0]=0;;){if(Te[0]=ze,Pe[0]=wn,8>wn){Te=7;break e}var cr=Ke(lt,ze+4);if(4294967286<cr){Te=3;break e}var sn=8+cr+1&-2;if(en+=sn,0<dt&&en>dt){Te=3;break e}if(!n(lt,ze,"VP8 ")||!n(lt,ze,"VP8L")){Te=0;break e}if(wn[0]<sn){Te=7;break e}n(lt,ze,"ALPH")||(Ze[0]=lt,We[0]=ze+8,vt[0]=cr),ze+=sn,wn-=sn}}if(L=L[0],_e.na=_e.na[0],_e.P=_e.P[0],_e.Sa=_e.Sa[0],Te!=0)break}L=[L],_e.Ja=[_e.Ja],_e.xa=[_e.xa];e:if(dt=v,Te=w,Pe=L,Ze=_e.gb[0],We=_e.Ja,vt=_e.xa,lt=Te[0],ze=!n(dt,lt,"VP8 "),en=!n(dt,lt,"VP8L"),e(dt!=null),e(Pe!=null),e(We!=null),e(vt!=null),8>Pe[0])Te=7;else{if(ze||en){if(dt=Ke(dt,lt+4),12<=Ze&&dt>Ze-12){Te=3;break e}if(le&&dt>Pe[0]-8){Te=7;break e}We[0]=dt,Te[0]+=8,Pe[0]-=8,vt[0]=en}else vt[0]=5<=Pe[0]&&dt[lt+0]==47&&!(dt[lt+4]>>5),We[0]=Pe[0];Te=0}if(L=L[0],_e.Ja=_e.Ja[0],_e.xa=_e.xa[0],w=w[0],Te!=0)break;if(4294967286<_e.Ja)return 3;if(te==null||Ie||(te[0]=_e.xa?2:1),W=[W],Ce=[Ce],_e.xa){if(5>L){Te=7;break}te=W,le=Ce,Ie=G,v==null||5>L?v=0:5<=L&&v[w+0]==47&&!(v[w+4]>>5)?(Pe=[0],dt=[0],Ze=[0],ge(We=new Y,v,w,L),vi(We,Pe,dt,Ze)?(te!=null&&(te[0]=Pe[0]),le!=null&&(le[0]=dt[0]),Ie!=null&&(Ie[0]=Ze[0]),v=1):v=0):v=0}else{if(10>L){Te=7;break}te=Ce,v==null||10>L||!os(v,w+3,L-3)?v=0:(le=v[w+0]|v[w+1]<<8|v[w+2]<<16,Ie=16383&(v[w+7]<<8|v[w+6]),v=16383&(v[w+9]<<8|v[w+8]),1&le||3<(le>>1&7)||!(le>>4&1)||le>>5>=_e.Ja||!Ie||!v?v=0:(W&&(W[0]=Ie),te&&(te[0]=v),v=1))}if(!v||(W=W[0],Ce=Ce[0],Le&&(ue[0]!=W||ye[0]!=Ce)))return 3;re!=null&&(re[0]=_e,re.offset=w-re.w,e(4294967286>w-re.w),e(re.offset==re.ha-L));break}return Te==0||Te==7&&Le&&re==null?(G!=null&&(G[0]|=_e.na!=null&&0<_e.na.length),R!=null&&(R[0]=W),H!=null&&(H[0]=Ce),0):Te}function Us(v,w,L){var R=w.width,H=w.height,G=0,W=0,te=R,re=H;if(w.Da=v!=null&&0<v.Da,w.Da&&(te=v.cd,re=v.bd,G=v.v,W=v.j,11>L||(G&=-2,W&=-2),0>G||0>W||0>=te||0>=re||G+te>R||W+re>H))return 0;if(w.v=G,w.j=W,w.va=G+te,w.o=W+re,w.U=te,w.T=re,w.da=v!=null&&0<v.da,w.da){if(!tt(te,re,L=[v.ib],G=[v.hb]))return 0;w.ib=L[0],w.hb=G[0]}return w.ob=v!=null&&v.ob,w.Kb=v==null||!v.Sd,w.da&&(w.ob=w.ib<3*R/4&&w.hb<3*H/4,w.Kb=0),1}function Nu(v){if(v==null)return 2;if(11>v.S){var w=v.f.RGBA;w.fb+=(v.height-1)*w.A,w.A=-w.A}else w=v.f.kb,v=v.height,w.O+=(v-1)*w.fa,w.fa=-w.fa,w.N+=(v-1>>1)*w.Ab,w.Ab=-w.Ab,w.W+=(v-1>>1)*w.Db,w.Db=-w.Db,w.F!=null&&(w.J+=(v-1)*w.lb,w.lb=-w.lb);return 0}function Vi(v,w,L,R){if(R==null||0>=v||0>=w)return 2;if(L!=null){if(L.Da){var H=L.cd,G=L.bd,W=-2&L.v,te=-2&L.j;if(0>W||0>te||0>=H||0>=G||W+H>v||te+G>w)return 2;v=H,w=G}if(L.da){if(!tt(v,w,H=[L.ib],G=[L.hb]))return 2;v=H[0],w=G[0]}}R.width=v,R.height=w;e:{var re=R.width,ue=R.height;if(v=R.S,0>=re||0>=ue||!(v>=wc&&13>v))v=2;else{if(0>=R.Rd&&R.sd==null){W=G=H=w=0;var ye=(te=re*Lc[v])*ue;if(11>v||(G=(ue+1)/2*(w=(re+1)/2),v==12&&(W=(H=re)*ue)),(ue=s(ye+2*G+W))==null){v=1;break e}R.sd=ue,11>v?((re=R.f.RGBA).eb=ue,re.fb=0,re.A=te,re.size=ye):((re=R.f.kb).y=ue,re.O=0,re.fa=te,re.Fd=ye,re.f=ue,re.N=0+ye,re.Ab=w,re.Cd=G,re.ea=ue,re.W=0+ye+G,re.Db=w,re.Ed=G,v==12&&(re.F=ue,re.J=0+ye+2*G),re.Tc=W,re.lb=H)}if(w=1,H=R.S,G=R.width,W=R.height,H>=wc&&13>H)if(11>H)v=R.f.RGBA,w&=(te=Math.abs(v.A))*(W-1)+G<=v.size,w&=te>=G*Lc[H],w&=v.eb!=null;else{v=R.f.kb,te=(G+1)/2,ye=(W+1)/2,re=Math.abs(v.fa),ue=Math.abs(v.Ab);var Le=Math.abs(v.Db),le=Math.abs(v.lb),_e=le*(W-1)+G;w&=re*(W-1)+G<=v.Fd,w&=ue*(ye-1)+te<=v.Cd,w=(w&=Le*(ye-1)+te<=v.Ed)&re>=G&ue>=te&Le>=te,w&=v.y!=null,w&=v.f!=null,w&=v.ea!=null,H==12&&(w&=le>=G,w&=_e<=v.Tc,w&=v.F!=null)}else w=0;v=w?0:2}}return v!=0||L!=null&&L.fd&&(v=Nu(R)),v}var fo=64,Xa=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535,131071,262143,524287,1048575,2097151,4194303,8388607,16777215],Ba=24,ds=32,ps=8,Bs=[0,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7];ot("Predictor0","PredictorAdd0"),B.Predictor0=function(){return 4278190080},B.Predictor1=function(v){return v},B.Predictor2=function(v,w,L){return w[L+0]},B.Predictor3=function(v,w,L){return w[L+1]},B.Predictor4=function(v,w,L){return w[L-1]},B.Predictor5=function(v,w,L){return At(At(v,w[L+1]),w[L+0])},B.Predictor6=function(v,w,L){return At(v,w[L-1])},B.Predictor7=function(v,w,L){return At(v,w[L+0])},B.Predictor8=function(v,w,L){return At(w[L-1],w[L+0])},B.Predictor9=function(v,w,L){return At(w[L+0],w[L+1])},B.Predictor10=function(v,w,L){return At(At(v,w[L-1]),At(w[L+0],w[L+1]))},B.Predictor11=function(v,w,L){var R=w[L+0];return 0>=Jt(R>>24&255,v>>24&255,(w=w[L-1])>>24&255)+Jt(R>>16&255,v>>16&255,w>>16&255)+Jt(R>>8&255,v>>8&255,w>>8&255)+Jt(255&R,255&v,255&w)?R:v},B.Predictor12=function(v,w,L){var R=w[L+0];return(Ft((v>>24&255)+(R>>24&255)-((w=w[L-1])>>24&255))<<24|Ft((v>>16&255)+(R>>16&255)-(w>>16&255))<<16|Ft((v>>8&255)+(R>>8&255)-(w>>8&255))<<8|Ft((255&v)+(255&R)-(255&w)))>>>0},B.Predictor13=function(v,w,L){var R=w[L-1];return(rn((v=At(v,w[L+0]))>>24&255,R>>24&255)<<24|rn(v>>16&255,R>>16&255)<<16|rn(v>>8&255,R>>8&255)<<8|rn(255&v,255&R))>>>0};var jl=B.PredictorAdd0;B.PredictorAdd1=fn,ot("Predictor2","PredictorAdd2"),ot("Predictor3","PredictorAdd3"),ot("Predictor4","PredictorAdd4"),ot("Predictor5","PredictorAdd5"),ot("Predictor6","PredictorAdd6"),ot("Predictor7","PredictorAdd7"),ot("Predictor8","PredictorAdd8"),ot("Predictor9","PredictorAdd9"),ot("Predictor10","PredictorAdd10"),ot("Predictor11","PredictorAdd11"),ot("Predictor12","PredictorAdd12"),ot("Predictor13","PredictorAdd13");var Rl=B.PredictorAdd2;wt("ColorIndexInverseTransform","MapARGB","32b",function(v){return v>>8&255},function(v){return v}),wt("VP8LColorIndexInverseTransformAlpha","MapAlpha","8b",function(v){return v},function(v){return v>>8&255});var Tr,vc=B.ColorIndexInverseTransform,ms=B.MapARGB,gs=B.VP8LColorIndexInverseTransformAlpha,ma=B.MapAlpha,$s=B.VP8LPredictorsAdd=[];$s.length=16,(B.VP8LPredictors=[]).length=16,(B.VP8LPredictorsAdd_C=[]).length=16,(B.VP8LPredictors_C=[]).length=16;var Dl,kl,zs,qs,vs,Ho,hi,Hs,Ca,wi,Dn,Cn,rr,Lr,ys,Yi,Vo,Cu,$f,xd,Sd,_d,zf,qf,Yo,xi,Tu,di,Go=s(511),yc=s(2041),Lu=s(225),Ou=s(767),bc=0,Vs=yc,ju=Lu,Ta=Ou,ga=Go,wc=0,La=1,xc=2,Si=3,Ru=4,Ml=5,ho=6,Du=7,Sc=8,Pl=9,_c=10,_i=[2,3,7],Il=[3,3,11],Wo=[280,256,256,256,40],Ec=[0,1,1,1,0],ku=[17,18,0,1,2,3,4,5,16,6,7,8,9,10,11,12,13,14,15],Ei=[24,7,23,25,40,6,39,41,22,26,38,42,56,5,55,57,21,27,54,58,37,43,72,4,71,73,20,28,53,59,70,74,36,44,88,69,75,52,60,3,87,89,19,29,86,90,35,45,68,76,85,91,51,61,104,2,103,105,18,30,102,106,34,46,84,92,67,77,101,107,50,62,120,1,119,121,83,93,17,31,100,108,66,78,118,122,33,47,117,123,49,63,99,109,82,94,0,116,124,65,79,16,32,98,110,48,115,125,81,95,64,114,126,97,111,80,113,127,96,112],Ai=[2954,2956,2958,2962,2970,2986,3018,3082,3212,3468,3980,5004],po=8,Ni=[4,5,6,7,8,9,10,10,11,12,13,14,15,16,17,17,18,19,20,20,21,21,22,22,23,23,24,25,25,26,27,28,29,30,31,32,33,34,35,36,37,37,38,39,40,41,42,43,44,45,46,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,76,77,78,79,80,81,82,83,84,85,86,87,88,89,91,93,95,96,98,100,101,102,104,106,108,110,112,114,116,118,122,124,126,128,130,132,134,136,138,140,143,145,148,151,154,157],Ci=[4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,119,122,125,128,131,134,137,140,143,146,149,152,155,158,161,164,167,170,173,177,181,185,189,193,197,201,205,209,213,217,221,225,229,234,239,245,249,254,259,264,269,274,279,284],pi=null,Ed=[[173,148,140,0],[176,155,140,135,0],[180,157,141,134,130,0],[254,254,243,230,196,177,153,140,133,130,129,0]],Hf=[0,1,4,8,5,2,3,6,9,12,13,10,7,11,14,15],Ac=[-0,1,-1,2,-2,3,4,6,-3,5,-4,-5,-6,7,-7,8,-8,-9],Ad=[[[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]],[[253,136,254,255,228,219,128,128,128,128,128],[189,129,242,255,227,213,255,219,128,128,128],[106,126,227,252,214,209,255,255,128,128,128]],[[1,98,248,255,236,226,255,255,128,128,128],[181,133,238,254,221,234,255,154,128,128,128],[78,134,202,247,198,180,255,219,128,128,128]],[[1,185,249,255,243,255,128,128,128,128,128],[184,150,247,255,236,224,128,128,128,128,128],[77,110,216,255,236,230,128,128,128,128,128]],[[1,101,251,255,241,255,128,128,128,128,128],[170,139,241,252,236,209,255,255,128,128,128],[37,116,196,243,228,255,255,255,128,128,128]],[[1,204,254,255,245,255,128,128,128,128,128],[207,160,250,255,238,128,128,128,128,128,128],[102,103,231,255,211,171,128,128,128,128,128]],[[1,152,252,255,240,255,128,128,128,128,128],[177,135,243,255,234,225,128,128,128,128,128],[80,129,211,255,194,224,128,128,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[246,1,255,128,128,128,128,128,128,128,128],[255,128,128,128,128,128,128,128,128,128,128]]],[[[198,35,237,223,193,187,162,160,145,155,62],[131,45,198,221,172,176,220,157,252,221,1],[68,47,146,208,149,167,221,162,255,223,128]],[[1,149,241,255,221,224,255,255,128,128,128],[184,141,234,253,222,220,255,199,128,128,128],[81,99,181,242,176,190,249,202,255,255,128]],[[1,129,232,253,214,197,242,196,255,255,128],[99,121,210,250,201,198,255,202,128,128,128],[23,91,163,242,170,187,247,210,255,255,128]],[[1,200,246,255,234,255,128,128,128,128,128],[109,178,241,255,231,245,255,255,128,128,128],[44,130,201,253,205,192,255,255,128,128,128]],[[1,132,239,251,219,209,255,165,128,128,128],[94,136,225,251,218,190,255,255,128,128,128],[22,100,174,245,186,161,255,199,128,128,128]],[[1,182,249,255,232,235,128,128,128,128,128],[124,143,241,255,227,234,128,128,128,128,128],[35,77,181,251,193,211,255,205,128,128,128]],[[1,157,247,255,236,231,255,255,128,128,128],[121,141,235,255,225,227,255,255,128,128,128],[45,99,188,251,195,217,255,224,128,128,128]],[[1,1,251,255,213,255,128,128,128,128,128],[203,1,248,255,255,128,128,128,128,128,128],[137,1,177,255,224,255,128,128,128,128,128]]],[[[253,9,248,251,207,208,255,192,128,128,128],[175,13,224,243,193,185,249,198,255,255,128],[73,17,171,221,161,179,236,167,255,234,128]],[[1,95,247,253,212,183,255,255,128,128,128],[239,90,244,250,211,209,255,255,128,128,128],[155,77,195,248,188,195,255,255,128,128,128]],[[1,24,239,251,218,219,255,205,128,128,128],[201,51,219,255,196,186,128,128,128,128,128],[69,46,190,239,201,218,255,228,128,128,128]],[[1,191,251,255,255,128,128,128,128,128,128],[223,165,249,255,213,255,128,128,128,128,128],[141,124,248,255,255,128,128,128,128,128,128]],[[1,16,248,255,255,128,128,128,128,128,128],[190,36,230,255,236,255,128,128,128,128,128],[149,1,255,128,128,128,128,128,128,128,128]],[[1,226,255,128,128,128,128,128,128,128,128],[247,192,255,128,128,128,128,128,128,128,128],[240,128,255,128,128,128,128,128,128,128,128]],[[1,134,252,255,255,128,128,128,128,128,128],[213,62,250,255,255,128,128,128,128,128,128],[55,93,255,128,128,128,128,128,128,128,128]],[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]]],[[[202,24,213,235,186,191,220,160,240,175,255],[126,38,182,232,169,184,228,174,255,187,128],[61,46,138,219,151,178,240,170,255,216,128]],[[1,112,230,250,199,191,247,159,255,255,128],[166,109,228,252,211,215,255,174,128,128,128],[39,77,162,232,172,180,245,178,255,255,128]],[[1,52,220,246,198,199,249,220,255,255,128],[124,74,191,243,183,193,250,221,255,255,128],[24,71,130,219,154,170,243,182,255,255,128]],[[1,182,225,249,219,240,255,224,128,128,128],[149,150,226,252,216,205,255,171,128,128,128],[28,108,170,242,183,194,254,223,255,255,128]],[[1,81,230,252,204,203,255,192,128,128,128],[123,102,209,247,188,196,255,233,128,128,128],[20,95,153,243,164,173,255,203,128,128,128]],[[1,222,248,255,216,213,128,128,128,128,128],[168,175,246,252,235,205,255,255,128,128,128],[47,116,215,255,211,212,255,255,128,128,128]],[[1,121,236,253,212,214,255,255,128,128,128],[141,84,213,252,201,202,255,219,128,128,128],[42,80,160,240,162,185,255,205,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[244,1,255,128,128,128,128,128,128,128,128],[238,1,255,128,128,128,128,128,128,128,128]]]],va=[[[231,120,48,89,115,113,120,152,112],[152,179,64,126,170,118,46,70,95],[175,69,143,80,85,82,72,155,103],[56,58,10,171,218,189,17,13,152],[114,26,17,163,44,195,21,10,173],[121,24,80,195,26,62,44,64,85],[144,71,10,38,171,213,144,34,26],[170,46,55,19,136,160,33,206,71],[63,20,8,114,114,208,12,9,226],[81,40,11,96,182,84,29,16,36]],[[134,183,89,137,98,101,106,165,148],[72,187,100,130,157,111,32,75,80],[66,102,167,99,74,62,40,234,128],[41,53,9,178,241,141,26,8,107],[74,43,26,146,73,166,49,23,157],[65,38,105,160,51,52,31,115,128],[104,79,12,27,217,255,87,17,7],[87,68,71,44,114,51,15,186,23],[47,41,14,110,182,183,21,17,194],[66,45,25,102,197,189,23,18,22]],[[88,88,147,150,42,46,45,196,205],[43,97,183,117,85,38,35,179,61],[39,53,200,87,26,21,43,232,171],[56,34,51,104,114,102,29,93,77],[39,28,85,171,58,165,90,98,64],[34,22,116,206,23,34,43,166,73],[107,54,32,26,51,1,81,43,31],[68,25,106,22,64,171,36,225,114],[34,19,21,102,132,188,16,76,124],[62,18,78,95,85,57,50,48,51]],[[193,101,35,159,215,111,89,46,111],[60,148,31,172,219,228,21,18,111],[112,113,77,85,179,255,38,120,114],[40,42,1,196,245,209,10,25,109],[88,43,29,140,166,213,37,43,154],[61,63,30,155,67,45,68,1,209],[100,80,8,43,154,1,51,26,71],[142,78,78,16,255,128,34,197,171],[41,40,5,102,211,183,4,1,221],[51,50,17,168,209,192,23,25,82]],[[138,31,36,171,27,166,38,44,229],[67,87,58,169,82,115,26,59,179],[63,59,90,180,59,166,93,73,154],[40,40,21,116,143,209,34,39,175],[47,15,16,183,34,223,49,45,183],[46,17,33,183,6,98,15,32,183],[57,46,22,24,128,1,54,17,37],[65,32,73,115,28,128,23,128,205],[40,3,9,115,51,192,18,6,223],[87,37,9,115,59,77,64,21,47]],[[104,55,44,218,9,54,53,130,226],[64,90,70,205,40,41,23,26,57],[54,57,112,184,5,41,38,166,213],[30,34,26,133,152,116,10,32,134],[39,19,53,221,26,114,32,73,255],[31,9,65,234,2,15,1,118,73],[75,32,12,51,192,255,160,43,51],[88,31,35,67,102,85,55,186,85],[56,21,23,111,59,205,45,37,192],[55,38,70,124,73,102,1,34,98]],[[125,98,42,88,104,85,117,175,82],[95,84,53,89,128,100,113,101,45],[75,79,123,47,51,128,81,171,1],[57,17,5,71,102,57,53,41,49],[38,33,13,121,57,73,26,1,85],[41,10,67,138,77,110,90,47,114],[115,21,2,10,102,255,166,23,6],[101,29,16,10,85,128,101,196,26],[57,18,10,102,102,213,34,20,43],[117,20,15,36,163,128,68,1,26]],[[102,61,71,37,34,53,31,243,192],[69,60,71,38,73,119,28,222,37],[68,45,128,34,1,47,11,245,171],[62,17,19,70,146,85,55,62,70],[37,43,37,154,100,163,85,160,1],[63,9,92,136,28,64,32,201,85],[75,15,9,9,64,255,184,119,16],[86,6,28,5,64,255,25,248,1],[56,8,17,132,137,255,55,116,128],[58,15,20,82,135,57,26,121,40]],[[164,50,31,137,154,133,25,35,218],[51,103,44,131,131,123,31,6,158],[86,40,64,135,148,224,45,183,128],[22,26,17,131,240,154,14,1,209],[45,16,21,91,64,222,7,1,197],[56,21,39,155,60,138,23,102,213],[83,12,13,54,192,255,68,47,28],[85,26,85,85,128,128,32,146,171],[18,11,7,63,144,171,4,4,246],[35,27,10,146,174,171,12,26,128]],[[190,80,35,99,180,80,126,54,45],[85,126,47,87,176,51,41,20,32],[101,75,128,139,118,146,116,128,85],[56,41,15,176,236,85,37,9,62],[71,30,17,119,118,255,17,18,138],[101,38,60,138,55,70,43,26,142],[146,36,19,30,171,255,97,27,20],[138,45,61,62,219,1,81,188,64],[32,41,20,117,151,142,20,21,163],[112,19,12,61,195,128,48,4,24]]],ur=[[[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[176,246,255,255,255,255,255,255,255,255,255],[223,241,252,255,255,255,255,255,255,255,255],[249,253,253,255,255,255,255,255,255,255,255]],[[255,244,252,255,255,255,255,255,255,255,255],[234,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255]],[[255,246,254,255,255,255,255,255,255,255,255],[239,253,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[251,255,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[251,254,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,254,253,255,254,255,255,255,255,255,255],[250,255,254,255,254,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[217,255,255,255,255,255,255,255,255,255,255],[225,252,241,253,255,255,254,255,255,255,255],[234,250,241,250,253,255,253,254,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[223,254,254,255,255,255,255,255,255,255,255],[238,253,254,254,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[249,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,255,255,255,255,255,255,255,255,255],[247,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[252,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[186,251,250,255,255,255,255,255,255,255,255],[234,251,244,254,255,255,255,255,255,255,255],[251,251,243,253,254,255,254,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[236,253,254,255,255,255,255,255,255,255,255],[251,253,253,254,254,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[254,254,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[254,254,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[248,255,255,255,255,255,255,255,255,255,255],[250,254,252,254,255,255,255,255,255,255,255],[248,254,249,253,255,255,255,255,255,255,255]],[[255,253,253,255,255,255,255,255,255,255,255],[246,253,253,255,255,255,255,255,255,255,255],[252,254,251,254,254,255,255,255,255,255,255]],[[255,254,252,255,255,255,255,255,255,255,255],[248,254,253,255,255,255,255,255,255,255,255],[253,255,254,254,255,255,255,255,255,255,255]],[[255,251,254,255,255,255,255,255,255,255,255],[245,251,254,255,255,255,255,255,255,255,255],[253,253,254,255,255,255,255,255,255,255,255]],[[255,251,253,255,255,255,255,255,255,255,255],[252,253,254,255,255,255,255,255,255,255,255],[255,254,255,255,255,255,255,255,255,255,255]],[[255,252,255,255,255,255,255,255,255,255,255],[249,255,254,255,255,255,255,255,255,255,255],[255,255,254,255,255,255,255,255,255,255,255]],[[255,255,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]]],xn=[0,1,2,3,6,4,5,6,6,6,6,6,6,6,6,7,0],$a=[],Sr=[],Gi=[],mo=1,Vf=2,Ys=[],ya=[];Ps("UpsampleRgbLinePair",Is,3),Ps("UpsampleBgrLinePair",ia,3),Ps("UpsampleRgbaLinePair",Ua,4),Ps("UpsampleBgraLinePair",hs,4),Ps("UpsampleArgbLinePair",Ll,4),Ps("UpsampleRgba4444LinePair",co,2),Ps("UpsampleRgb565LinePair",uo,2);var Ko=B.UpsampleRgbLinePair,Yf=B.UpsampleBgrLinePair,Fl=B.UpsampleRgbaLinePair,Nc=B.UpsampleBgraLinePair,go=B.UpsampleArgbLinePair,bs=B.UpsampleRgba4444LinePair,vo=B.UpsampleRgb565LinePair,Ti=16,Ul=1<<Ti-1,Jo=-227,yo=482,Cc=6,bo=0,ba=s(256),Tc=s(256),Nd=s(256),gg=s(256),vg=s(yo-Jo),yg=s(yo-Jo);Fs("YuvToRgbRow",Is,3),Fs("YuvToBgrRow",ia,3),Fs("YuvToRgbaRow",Ua,4),Fs("YuvToBgraRow",hs,4),Fs("YuvToArgbRow",Ll,4),Fs("YuvToRgba4444Row",co,2),Fs("YuvToRgb565Row",uo,2);var Or=[0,4,8,12,128,132,136,140,256,260,264,268,384,388,392,396],Bl=[0,2,8],Mu=[8,7,6,4,4,2,2,2,1,1,1,1],Pu=1;this.WebPDecodeRGBA=function(v,w,L,R,H){var G=La,W=new $e,te=new Qt;W.ba=te,te.S=G,te.width=[te.width],te.height=[te.height];var re=te.width,ue=te.height,ye=new _t;if(ye==null||v==null)var Le=2;else e(ye!=null),Le=Hi(v,w,L,ye.width,ye.height,ye.Pd,ye.Qd,ye.format,null);if(Le!=0?re=0:(re!=null&&(re[0]=ye.width[0]),ue!=null&&(ue[0]=ye.height[0]),re=1),re){te.width=te.width[0],te.height=te.height[0],R!=null&&(R[0]=te.width),H!=null&&(H[0]=te.height);e:{if(R=new Na,(H=new Je).data=v,H.w=w,H.ha=L,H.kd=1,w=[0],e(H!=null),((v=Hi(H.data,H.w,H.ha,null,null,null,w,null,H))==0||v==7)&&w[0]&&(v=4),(w=v)==0){if(e(W!=null),R.data=H.data,R.w=H.w+H.offset,R.ha=H.ha-H.offset,R.put=Et,R.ac=ha,R.bc=Ui,R.ma=W,H.xa){if((v=Ht())==null){W=1;break e}if((function(le,_e){var Ce=[0],Ie=[0],Te=[0];t:for(;;){if(le==null)return 0;if(_e==null)return le.a=2,0;if(le.l=_e,le.a=0,ge(le.m,_e.data,_e.w,_e.ha),!vi(le.m,Ce,Ie,Te)){le.a=3;break t}if(le.xb=Vf,_e.width=Ce[0],_e.height=Ie[0],!Zt(Ce[0],Ie[0],1,le,null))break t;return 1}return e(le.a!=0),0})(v,R)){if(R=(w=Vi(R.width,R.height,W.Oa,W.ba))==0){t:{R=v;n:for(;;){if(R==null){R=0;break t}if(e(R.s.yc!=null),e(R.s.Ya!=null),e(0<R.s.Wb),e((L=R.l)!=null),e((H=L.ma)!=null),R.xb!=0){if(R.ca=H.ba,R.tb=H.tb,e(R.ca!=null),!Us(H.Oa,L,Si)){R.a=2;break n}if(!Bn(R,L.width)||L.da)break n;if((L.da||Pt(R.ca.S))&&zi(),11>R.ca.S||(alert("todo:WebPInitConvertARGBToYUV"),R.ca.f.kb.F!=null&&zi()),R.Pb&&0<R.s.ua&&R.s.vb.X==null&&!ee(R.s.vb,R.s.Wa.Xa)){R.a=1;break n}R.xb=0}if(!Ct(R,R.V,R.Ba,R.c,R.i,L.o,it))break n;H.Dc=R.Ma,R=1;break t}e(R.a!=0),R=0}R=!R}R&&(w=v.a)}else w=v.a}else{if((v=new Kr)==null){W=1;break e}if(v.Fa=H.na,v.P=H.P,v.qc=H.Sa,li(v,R)){if((w=Vi(R.width,R.height,W.Oa,W.ba))==0){if(v.Aa=0,L=W.Oa,e((H=v)!=null),L!=null){if(0<(re=0>(re=L.Md)?0:100<re?255:255*re/100)){for(ue=ye=0;4>ue;++ue)12>(Le=H.pb[ue]).lc&&(Le.ia=re*Mu[0>Le.lc?0:Le.lc]>>3),ye|=Le.ia;ye&&(alert("todo:VP8InitRandom"),H.ia=1)}H.Ga=L.Id,100<H.Ga?H.Ga=100:0>H.Ga&&(H.Ga=0)}(function(le,_e){if(le==null)return 0;if(_e==null)return jt(le,2,"NULL VP8Io parameter in VP8Decode().");if(!le.cb&&!li(le,_e))return 0;if(e(le.cb),_e.ac==null||_e.ac(_e)){_e.ob&&(le.L=0);var Ce=Bl[le.L];if(le.L==2?(le.yb=0,le.zb=0):(le.yb=_e.v-Ce>>4,le.zb=_e.j-Ce>>4,0>le.yb&&(le.yb=0),0>le.zb&&(le.zb=0)),le.Va=_e.o+15+Ce>>4,le.Hb=_e.va+15+Ce>>4,le.Hb>le.za&&(le.Hb=le.za),le.Va>le.Ub&&(le.Va=le.Ub),0<le.L){var Ie=le.ed;for(Ce=0;4>Ce;++Ce){var Te;if(le.Qa.Cb){var Pe=le.Qa.Lb[Ce];le.Qa.Fb||(Pe+=Ie.Tb)}else Pe=Ie.Tb;for(Te=0;1>=Te;++Te){var ze=le.gd[Ce][Te],Ze=Pe;if(Ie.Pc&&(Ze+=Ie.vd[0],Te&&(Ze+=Ie.od[0])),0<(Ze=0>Ze?0:63<Ze?63:Ze)){var We=Ze;0<Ie.wb&&(We=4<Ie.wb?We>>2:We>>1)>9-Ie.wb&&(We=9-Ie.wb),1>We&&(We=1),ze.dd=We,ze.tc=2*Ze+We,ze.ld=40<=Ze?2:15<=Ze?1:0}else ze.tc=0;ze.La=Te}}}Ce=0}else jt(le,6,"Frame setup failed"),Ce=le.a;if(Ce=Ce==0){if(Ce){le.$c=0,0<le.Aa||(le.Ic=Pu);t:{Ce=le.Ic,Ie=4*(We=le.za);var vt=32*We,lt=We+1,en=0<le.L?We*(0<le.Aa?2:1):0,dt=(le.Aa==2?2:1)*We;if((ze=Ie+832+(Te=3*(16*Ce+Bl[le.L])/2*vt)+(Pe=le.Fa!=null&&0<le.Fa.length?le.Kc.c*le.Kc.i:0))!=ze)Ce=0;else{if(ze>le.Vb){if(le.Vb=0,le.Ec=s(ze),le.Fc=0,le.Ec==null){Ce=jt(le,1,"no memory during frame initialization.");break t}le.Vb=ze}ze=le.Ec,Ze=le.Fc,le.Ac=ze,le.Bc=Ze,Ze+=Ie,le.Gd=l(vt,ss),le.Hd=0,le.rb=l(lt+1,Ma),le.sb=1,le.wa=en?l(en,dr):null,le.Y=0,le.D.Nb=0,le.D.wa=le.wa,le.D.Y=le.Y,0<le.Aa&&(le.D.Y+=We),e(!0),le.oc=ze,le.pc=Ze,Ze+=832,le.ya=l(dt,oi),le.aa=0,le.D.ya=le.ya,le.D.aa=le.aa,le.Aa==2&&(le.D.aa+=We),le.R=16*We,le.B=8*We,We=(vt=Bl[le.L])*le.R,vt=vt/2*le.B,le.sa=ze,le.ta=Ze+We,le.qa=le.sa,le.ra=le.ta+16*Ce*le.R+vt,le.Ha=le.qa,le.Ia=le.ra+8*Ce*le.B+vt,le.$c=0,Ze+=Te,le.mb=Pe?ze:null,le.nb=Pe?Ze:null,e(Ze+Pe<=le.Fc+le.Vb),mu(le),a(le.Ac,le.Bc,0,Ie),Ce=1}}if(Ce){if(_e.ka=0,_e.y=le.sa,_e.O=le.ta,_e.f=le.qa,_e.N=le.ra,_e.ea=le.Ha,_e.Vd=le.Ia,_e.fa=le.R,_e.Rc=le.B,_e.F=null,_e.J=0,!bc){for(Ce=-255;255>=Ce;++Ce)Go[255+Ce]=0>Ce?-Ce:Ce;for(Ce=-1020;1020>=Ce;++Ce)yc[1020+Ce]=-128>Ce?-128:127<Ce?127:Ce;for(Ce=-112;112>=Ce;++Ce)Lu[112+Ce]=-16>Ce?-16:15<Ce?15:Ce;for(Ce=-255;510>=Ce;++Ce)Ou[255+Ce]=0>Ce?0:255<Ce?255:Ce;bc=1}hi=Bi,Hs=gu,wi=Fa,Dn=vu,Cn=yu,Ca=lc,rr=mc,Lr=ks,ys=q,Yi=fe,Vo=gc,Cu=C,$f=ve,xd=Ee,Sd=Os,_d=js,zf=zo,qf=_u,Sr[0]=dc,Sr[1]=uc,Sr[2]=hc,Sr[3]=xu,Sr[4]=ui,Sr[5]=Su,Sr[6]=da,Sr[7]=Uo,Sr[8]=Bo,Sr[9]=ci,$a[0]=$i,$a[1]=bu,$a[2]=wu,$a[3]=fc,$a[4]=Ts,$a[5]=Fo,$a[6]=lo,Gi[0]=Al,Gi[1]=cc,Gi[2]=us,Gi[3]=pc,Gi[4]=aa,Gi[5]=Nl,Gi[6]=cs,Ce=1}else Ce=0}Ce&&(Ce=(function(wn,cr){for(wn.M=0;wn.M<wn.Va;++wn.M){var sn,ut=wn.Jc[wn.M&wn.Xb],nt=wn.m,gr=wn;for(sn=0;sn<gr.za;++sn){var Bt=nt,un=gr,$n=un.Ac,Zr=un.Bc+4*sn,wa=un.zc,ar=un.ya[un.aa+sn];if(un.Qa.Bb?ar.$b=Oe(Bt,un.Pa.jb[0])?2+Oe(Bt,un.Pa.jb[2]):Oe(Bt,un.Pa.jb[1]):ar.$b=0,un.kc&&(ar.Ad=Oe(Bt,un.Bd)),ar.Za=!Oe(Bt,145)+0,ar.Za){var Fr=ar.Ob,Oa=0;for(un=0;4>un;++un){var Ur,vn=wa[0+un];for(Ur=0;4>Ur;++Ur){vn=va[$n[Zr+Ur]][vn];for(var Ln=Ac[Oe(Bt,vn[0])];0<Ln;)Ln=Ac[2*Ln+Oe(Bt,vn[Ln])];vn=-Ln,$n[Zr+Ur]=vn}r(Fr,Oa,$n,Zr,4),Oa+=4,wa[0+un]=vn}}else vn=Oe(Bt,156)?Oe(Bt,128)?1:3:Oe(Bt,163)?2:0,ar.Ob[0]=vn,a($n,Zr,vn,4),a(wa,0,vn,4);ar.Dd=Oe(Bt,142)?Oe(Bt,114)?Oe(Bt,183)?1:3:2:0}if(gr.m.Ka)return jt(wn,7,"Premature end-of-partition0 encountered.");for(;wn.ja<wn.za;++wn.ja){if(gr=ut,Bt=(nt=wn).rb[nt.sb-1],$n=nt.rb[nt.sb+nt.ja],sn=nt.ya[nt.aa+nt.ja],Zr=nt.kc?sn.Ad:0)Bt.la=$n.la=0,sn.Za||(Bt.Na=$n.Na=0),sn.Hc=0,sn.Gc=0,sn.ia=0;else{var vr,kn;if(Bt=$n,$n=gr,Zr=nt.Pa.Xc,wa=nt.ya[nt.aa+nt.ja],ar=nt.pb[wa.$b],un=wa.ad,Fr=0,Oa=nt.rb[nt.sb-1],vn=Ur=0,a(un,Fr,0,384),wa.Za)var Qr=0,yr=Zr[3];else{Ln=s(16);var On=Bt.Na+Oa.Na;if(On=pi($n,Zr[1],On,ar.Eb,0,Ln,0),Bt.Na=Oa.Na=(0<On)+0,1<On)hi(Ln,0,un,Fr);else{var jr=Ln[0]+3>>3;for(Ln=0;256>Ln;Ln+=16)un[Fr+Ln]=jr}Qr=1,yr=Zr[0]}var zn=15&Bt.la,Br=15&Oa.la;for(Ln=0;4>Ln;++Ln){var $r=1&Br;for(jr=kn=0;4>jr;++jr)zn=zn>>1|($r=(On=pi($n,yr,On=$r+(1&zn),ar.Sc,Qr,un,Fr))>Qr)<<7,kn=kn<<2|(3<On?3:1<On?2:un[Fr+0]!=0),Fr+=16;zn>>=4,Br=Br>>1|$r<<7,Ur=(Ur<<8|kn)>>>0}for(yr=zn,Qr=Br>>4,vr=0;4>vr;vr+=2){for(kn=0,zn=Bt.la>>4+vr,Br=Oa.la>>4+vr,Ln=0;2>Ln;++Ln){for($r=1&Br,jr=0;2>jr;++jr)On=$r+(1&zn),zn=zn>>1|($r=0<(On=pi($n,Zr[2],On,ar.Qc,0,un,Fr)))<<3,kn=kn<<2|(3<On?3:1<On?2:un[Fr+0]!=0),Fr+=16;zn>>=2,Br=Br>>1|$r<<5}vn|=kn<<4*vr,yr|=zn<<4<<vr,Qr|=(240&Br)<<vr}Bt.la=yr,Oa.la=Qr,wa.Hc=Ur,wa.Gc=vn,wa.ia=43690&vn?0:ar.ia,Zr=!(Ur|vn)}if(0<nt.L&&(nt.wa[nt.Y+nt.ja]=nt.gd[sn.$b][sn.Za],nt.wa[nt.Y+nt.ja].La|=!Zr),gr.Ka)return jt(wn,7,"Premature end-of-file encountered.")}if(mu(wn),nt=cr,gr=1,sn=(ut=wn).D,Bt=0<ut.L&&ut.M>=ut.zb&&ut.M<=ut.Va,ut.Aa==0)t:{if(sn.M=ut.M,sn.uc=Bt,fi(ut,sn),gr=1,sn=(kn=ut.D).Nb,Bt=(vn=Bl[ut.L])*ut.R,$n=vn/2*ut.B,Ln=16*sn*ut.R,jr=8*sn*ut.B,Zr=ut.sa,wa=ut.ta-Bt+Ln,ar=ut.qa,un=ut.ra-$n+jr,Fr=ut.Ha,Oa=ut.Ia-$n+jr,Br=(zn=kn.M)==0,Ur=zn>=ut.Va-1,ut.Aa==2&&fi(ut,kn),kn.uc)for($r=(On=ut).D.M,e(On.D.uc),kn=On.yb;kn<On.Hb;++kn){Qr=kn,yr=$r;var Zn=(Tn=(zr=On).D).Nb;vr=zr.R;var Tn=Tn.wa[Tn.Y+Qr],ja=zr.sa,_r=zr.ta+16*Zn*vr+16*Qr,Rt=Tn.dd,Dt=Tn.tc;if(Dt!=0)if(e(3<=Dt),zr.L==1)0<Qr&&_d(ja,_r,vr,Dt+4),Tn.La&&qf(ja,_r,vr,Dt),0<yr&&Sd(ja,_r,vr,Dt+4),Tn.La&&zf(ja,_r,vr,Dt);else{var jn=zr.B,Za=zr.qa,Li=zr.ra+8*Zn*jn+8*Qr,za=zr.Ha,zr=zr.Ia+8*Zn*jn+8*Qr;Zn=Tn.ld,0<Qr&&(Lr(ja,_r,vr,Dt+4,Rt,Zn),Yi(Za,Li,za,zr,jn,Dt+4,Rt,Zn)),Tn.La&&(Cu(ja,_r,vr,Dt,Rt,Zn),xd(Za,Li,za,zr,jn,Dt,Rt,Zn)),0<yr&&(rr(ja,_r,vr,Dt+4,Rt,Zn),ys(Za,Li,za,zr,jn,Dt+4,Rt,Zn)),Tn.La&&(Vo(ja,_r,vr,Dt,Rt,Zn),$f(Za,Li,za,zr,jn,Dt,Rt,Zn))}}if(ut.ia&&alert("todo:DitherRow"),nt.put!=null){if(kn=16*zn,zn=16*(zn+1),Br?(nt.y=ut.sa,nt.O=ut.ta+Ln,nt.f=ut.qa,nt.N=ut.ra+jr,nt.ea=ut.Ha,nt.W=ut.Ia+jr):(kn-=vn,nt.y=Zr,nt.O=wa,nt.f=ar,nt.N=un,nt.ea=Fr,nt.W=Oa),Ur||(zn-=vn),zn>nt.o&&(zn=nt.o),nt.F=null,nt.J=null,ut.Fa!=null&&0<ut.Fa.length&&kn<zn&&(nt.J=nr(ut,nt,kn,zn-kn),nt.F=ut.mb,nt.F==null&&nt.F.length==0)){gr=jt(ut,3,"Could not decode alpha data.");break t}kn<nt.j&&(vn=nt.j-kn,kn=nt.j,e(!(1&vn)),nt.O+=ut.R*vn,nt.N+=ut.B*(vn>>1),nt.W+=ut.B*(vn>>1),nt.F!=null&&(nt.J+=nt.width*vn)),kn<zn&&(nt.O+=nt.v,nt.N+=nt.v>>1,nt.W+=nt.v>>1,nt.F!=null&&(nt.J+=nt.v),nt.ka=kn-nt.j,nt.U=nt.va-nt.v,nt.T=zn-kn,gr=nt.put(nt))}sn+1!=ut.Ic||Ur||(r(ut.sa,ut.ta-Bt,Zr,wa+16*ut.R,Bt),r(ut.qa,ut.ra-$n,ar,un+8*ut.B,$n),r(ut.Ha,ut.Ia-$n,Fr,Oa+8*ut.B,$n))}if(!gr)return jt(wn,6,"Output aborted.")}return 1})(le,_e)),_e.bc!=null&&_e.bc(_e),Ce&=1}return Ce?(le.cb=0,Ce):0})(v,R)||(w=v.a)}}else w=v.a}w==0&&W.Oa!=null&&W.Oa.fd&&(w=Nu(W.ba))}W=w}G=W!=0?null:11>G?te.f.RGBA.eb:te.f.kb.y}else G=null;return G};var Lc=[3,4,3,4,4,2,2,4,4,4,2,1,1]};function h(B,ne){for(var I="",z=0;z<4;z++)I+=String.fromCharCode(B[ne++]);return I}function d(B,ne){return B[ne+0]|B[ne+1]<<8}function g(B,ne){return(B[ne+0]|B[ne+1]<<8|B[ne+2]<<16)>>>0}function y(B,ne){return(B[ne+0]|B[ne+1]<<8|B[ne+2]<<16|B[ne+3]<<24)>>>0}new c;var m=[0],x=[0],E=[],A=new c,N=t,O=(function(B,ne){var I={},z=0,J=!1,ae=0,me=0;if(I.frames=[],!(function(j,Y){for(var K=0;K<4;K++)if(j[Y+K]!="RIFF".charCodeAt(K))return!0;return!1})(B,ne)){for(y(B,ne+=4),ne+=8;ne<B.length;){var Z=h(B,ne),ce=y(B,ne+=4);ne+=4;var oe=ce+(1&ce);switch(Z){case"VP8 ":case"VP8L":I.frames[z]===void 0&&(I.frames[z]={}),(U=I.frames[z]).src_off=J?me:ne-8,U.src_size=ae+ce+8,z++,J&&(J=!1,ae=0,me=0);break;case"VP8X":(U=I.header={}).feature_flags=B[ne];var ge=ne+4;U.canvas_width=1+g(B,ge),ge+=3,U.canvas_height=1+g(B,ge),ge+=3;break;case"ALPH":J=!0,ae=oe+8,me=ne-8;break;case"ANIM":(U=I.header).bgcolor=y(B,ne),ge=ne+4,U.loop_count=d(B,ge),ge+=2;break;case"ANMF":var he,U;(U=I.frames[z]={}).offset_x=2*g(B,ne),ne+=3,U.offset_y=2*g(B,ne),ne+=3,U.width=1+g(B,ne),ne+=3,U.height=1+g(B,ne),ne+=3,U.duration=g(B,ne),ne+=3,he=B[ne++],U.dispose=1&he,U.blend=he>>1&1}Z!="ANMF"&&(ne+=oe)}return I}})(N,0);O.response=N,O.rgbaoutput=!0,O.dataurl=!1;var T=O.header?O.header:null,D=O.frames?O.frames:null;if(T){T.loop_counter=T.loop_count,m=[T.canvas_height],x=[T.canvas_width];for(var F=0;F<D.length&&D[F].blend!=0;F++);}var Q=D[0],P=A.WebPDecodeRGBA(N,Q.src_off,Q.src_size,x,m);Q.rgba=P,Q.imgwidth=x[0],Q.imgheight=m[0];for(var $=0;$<x[0]*m[0]*4;$++)E[$]=P[$];return this.width=x,this.height=m,this.data=E,this}(function(t){var e,n,r,a,s,l,u,c,h,d=function(j){return j=j||{},this.isStrokeTransparent=j.isStrokeTransparent||!1,this.strokeOpacity=j.strokeOpacity||1,this.strokeStyle=j.strokeStyle||"#000000",this.fillStyle=j.fillStyle||"#000000",this.isFillTransparent=j.isFillTransparent||!1,this.fillOpacity=j.fillOpacity||1,this.font=j.font||"10px sans-serif",this.textBaseline=j.textBaseline||"alphabetic",this.textAlign=j.textAlign||"left",this.lineWidth=j.lineWidth||1,this.lineJoin=j.lineJoin||"miter",this.lineCap=j.lineCap||"butt",this.path=j.path||[],this.transform=j.transform!==void 0?j.transform.clone():new c,this.globalCompositeOperation=j.globalCompositeOperation||"normal",this.globalAlpha=j.globalAlpha||1,this.clip_path=j.clip_path||[],this.currentPoint=j.currentPoint||new l,this.miterLimit=j.miterLimit||10,this.lastPoint=j.lastPoint||new l,this.lineDashOffset=j.lineDashOffset||0,this.lineDash=j.lineDash||[],this.margin=j.margin||[0,0,0,0],this.prevPageLastElemOffset=j.prevPageLastElemOffset||0,this.ignoreClearRect=typeof j.ignoreClearRect!="boolean"||j.ignoreClearRect,this};t.events.push(["initialized",function(){this.context2d=new g(this),e=this.internal.f2,n=this.internal.getCoordinateString,r=this.internal.getVerticalCoordinateString,a=this.internal.getHorizontalCoordinate,s=this.internal.getVerticalCoordinate,l=this.internal.Point,u=this.internal.Rectangle,c=this.internal.Matrix,h=new d}]);var g=function(j){Object.defineProperty(this,"canvas",{get:function(){return{parentNode:!1,style:!1}}});var Y=j;Object.defineProperty(this,"pdf",{get:function(){return Y}});var K=!1;Object.defineProperty(this,"pageWrapXEnabled",{get:function(){return K},set:function(ee){K=!!ee}});var ie=!1;Object.defineProperty(this,"pageWrapYEnabled",{get:function(){return ie},set:function(ee){ie=!!ee}});var V=0;Object.defineProperty(this,"posX",{get:function(){return V},set:function(ee){isNaN(ee)||(V=ee)}});var se=0;Object.defineProperty(this,"posY",{get:function(){return se},set:function(ee){isNaN(ee)||(se=ee)}}),Object.defineProperty(this,"margin",{get:function(){return h.margin},set:function(ee){var qe;typeof ee=="number"?qe=[ee,ee,ee,ee]:((qe=new Array(4))[0]=ee[0],qe[1]=ee.length>=2?ee[1]:qe[0],qe[2]=ee.length>=3?ee[2]:qe[0],qe[3]=ee.length>=4?ee[3]:qe[1]),h.margin=qe}});var be=!1;Object.defineProperty(this,"autoPaging",{get:function(){return be},set:function(ee){be=ee}});var xe=0;Object.defineProperty(this,"lastBreak",{get:function(){return xe},set:function(ee){xe=ee}});var Oe=[];Object.defineProperty(this,"pageBreaks",{get:function(){return Oe},set:function(ee){Oe=ee}}),Object.defineProperty(this,"ctx",{get:function(){return h},set:function(ee){ee instanceof d&&(h=ee)}}),Object.defineProperty(this,"path",{get:function(){return h.path},set:function(ee){h.path=ee}});var Me=[];Object.defineProperty(this,"ctxStack",{get:function(){return Me},set:function(ee){Me=ee}}),Object.defineProperty(this,"fillStyle",{get:function(){return this.ctx.fillStyle},set:function(ee){var qe;qe=y(ee),this.ctx.fillStyle=qe.style,this.ctx.isFillTransparent=qe.a===0,this.ctx.fillOpacity=qe.a,this.pdf.setFillColor(qe.r,qe.g,qe.b,{a:qe.a}),this.pdf.setTextColor(qe.r,qe.g,qe.b,{a:qe.a})}}),Object.defineProperty(this,"strokeStyle",{get:function(){return this.ctx.strokeStyle},set:function(ee){var qe=y(ee);this.ctx.strokeStyle=qe.style,this.ctx.isStrokeTransparent=qe.a===0,this.ctx.strokeOpacity=qe.a,qe.a===0?this.pdf.setDrawColor(255,255,255):(qe.a,this.pdf.setDrawColor(qe.r,qe.g,qe.b))}}),Object.defineProperty(this,"lineCap",{get:function(){return this.ctx.lineCap},set:function(ee){["butt","round","square"].indexOf(ee)!==-1&&(this.ctx.lineCap=ee,this.pdf.setLineCap(ee))}}),Object.defineProperty(this,"lineWidth",{get:function(){return this.ctx.lineWidth},set:function(ee){isNaN(ee)||(this.ctx.lineWidth=ee,this.pdf.setLineWidth(ee))}}),Object.defineProperty(this,"lineJoin",{get:function(){return this.ctx.lineJoin},set:function(ee){["bevel","round","miter"].indexOf(ee)!==-1&&(this.ctx.lineJoin=ee,this.pdf.setLineJoin(ee))}}),Object.defineProperty(this,"miterLimit",{get:function(){return this.ctx.miterLimit},set:function(ee){isNaN(ee)||(this.ctx.miterLimit=ee,this.pdf.setMiterLimit(ee))}}),Object.defineProperty(this,"textBaseline",{get:function(){return this.ctx.textBaseline},set:function(ee){this.ctx.textBaseline=ee}}),Object.defineProperty(this,"textAlign",{get:function(){return this.ctx.textAlign},set:function(ee){["right","end","center","left","start"].indexOf(ee)!==-1&&(this.ctx.textAlign=ee)}});var Ue=null,Be=null,Ke=null;Object.defineProperty(this,"fontFaces",{get:function(){return Ke},set:function(ee){Ue=null,Be=null,Ke=ee}}),Object.defineProperty(this,"font",{get:function(){return this.ctx.font},set:function(ee){var qe;if(this.ctx.font=ee,(qe=/^\s*(?=(?:(?:[-a-z]+\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\1|\2|\3)\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\d]+(?:\%|in|[cem]m|ex|p[ctx]))(?:\s*\/\s*(normal|[.\d]+(?:\%|in|[cem]m|ex|p[ctx])))?\s*([-_,\"\'\sa-z0-9]+?)\s*$/i.exec(ee))!==null){var ct=qe[1];qe[2];var tt=qe[3],Ye=qe[4];qe[5];var gt=qe[6],ot=/^([.\d]+)((?:%|in|[cem]m|ex|p[ctx]))$/i.exec(Ye)[2];Ye=Math.floor(ot==="px"?parseFloat(Ye)*this.pdf.internal.scaleFactor:ot==="em"?parseFloat(Ye)*this.pdf.getFontSize():parseFloat(Ye)*this.pdf.internal.scaleFactor),this.pdf.setFontSize(Ye);var Ot=(function(wt){var lr,dn,bt=[],qt=wt.trim();if(qt==="")return U1;if(qt in BS)return[BS[qt]];for(;qt!=="";){switch(dn=null,lr=(qt=zS(qt)).charAt(0)){case'"':case"'":dn=zB(qt.substring(1),lr);break;default:dn=qB(qt)}if(dn===null||(bt.push(dn[0]),(qt=zS(dn[1]))!==""&&qt.charAt(0)!==","))return U1;qt=qt.replace(/^,/,"")}return bt})(gt);if(this.fontFaces){var At=(function(wt,lr){var dn=wt.getFontList(),bt=JSON.stringify(dn);if(Ue===null||Be!==bt){var qt=(function(pn){var Nt=[];return Object.keys(pn).forEach(function(Gn){pn[Gn].forEach(function(Pt){var It=null;switch(Pt){case"bold":It={family:Gn,weight:"bold"};break;case"italic":It={family:Gn,style:"italic"};break;case"bolditalic":It={family:Gn,weight:"bold",style:"italic"};break;case"":case"normal":It={family:Gn}}It!==null&&(It.ref={name:Gn,style:Pt},Nt.push(It))})}),Nt})(dn);Ue=(function(pn){for(var Nt={},Gn=0;Gn<pn.length;++Gn){var Pt=F1(pn[Gn]),It=Pt.family,Mn=Pt.stretch,Qt=Pt.style,_t=Pt.weight;Nt[It]=Nt[It]||{},Nt[It][Mn]=Nt[It][Mn]||{},Nt[It][Mn][Qt]=Nt[It][Mn][Qt]||{},Nt[It][Mn][Qt][_t]=Pt}return Nt})(qt.concat(lr)),Be=bt}return Ue})(this.pdf,this.fontFaces),Ft=Ot.map(function(wt){return{family:wt,stretch:"normal",weight:tt,style:ct}}),rn=(function(wt,lr,dn){for(var bt=(dn=dn||{}).defaultFontFamily||"times",qt=Object.assign({},$B,dn.genericFontFamilies||{}),pn=null,Nt=null,Gn=0;Gn<lr.length;++Gn)if(qt[(pn=F1(lr[Gn])).family]&&(pn.family=qt[pn.family]),wt.hasOwnProperty(pn.family)){Nt=wt[pn.family];break}if(!(Nt=Nt||wt[bt]))throw new Error("Could not find a font-family for the rule '"+$S(pn)+"' and default family '"+bt+"'.");if(Nt=(function(Pt,It){if(It[Pt])return It[Pt];var Mn=Jv[Pt],Qt=Mn<=Jv.normal?-1:1,_t=US(It,F6,Mn,Qt);if(!_t)throw new Error("Could not find a matching font-stretch value for "+Pt);return _t})(pn.stretch,Nt),Nt=(function(Pt,It){if(It[Pt])return It[Pt];for(var Mn=I6[Pt],Qt=0;Qt<Mn.length;++Qt)if(It[Mn[Qt]])return It[Mn[Qt]];throw new Error("Could not find a matching font-style for "+Pt)})(pn.style,Nt),!(Nt=(function(Pt,It){if(It[Pt])return It[Pt];if(Pt===400&&It[500])return It[500];if(Pt===500&&It[400])return It[400];var Mn=BB[Pt],Qt=US(It,U6,Mn,Pt<400?-1:1);if(!Qt)throw new Error("Could not find a matching font-weight for value "+Pt);return Qt})(pn.weight,Nt)))throw new Error("Failed to resolve a font for the rule '"+$S(pn)+"'.");return Nt})(At,Ft);this.pdf.setFont(rn.ref.name,rn.ref.style)}else{var Jt="";(tt==="bold"||parseInt(tt,10)>=700||ct==="bold")&&(Jt="bold"),ct==="italic"&&(Jt+="italic"),Jt.length===0&&(Jt="normal");for(var fn="",zt={arial:"Helvetica",Arial:"Helvetica",verdana:"Helvetica",Verdana:"Helvetica",helvetica:"Helvetica",Helvetica:"Helvetica","sans-serif":"Helvetica",fixed:"Courier",monospace:"Courier",terminal:"Courier",cursive:"Times",fantasy:"Times",serif:"Times"},at=0;at<Ot.length;at++){if(this.pdf.internal.getFont(Ot[at],Jt,{noFallback:!0,disableWarning:!0})!==void 0){fn=Ot[at];break}if(Jt==="bolditalic"&&this.pdf.internal.getFont(Ot[at],"bold",{noFallback:!0,disableWarning:!0})!==void 0)fn=Ot[at],Jt="bold";else if(this.pdf.internal.getFont(Ot[at],"normal",{noFallback:!0,disableWarning:!0})!==void 0){fn=Ot[at],Jt="normal";break}}if(fn===""){for(var Xt=0;Xt<Ot.length;Xt++)if(zt[Ot[Xt]]){fn=zt[Ot[Xt]];break}}fn=fn===""?"Times":fn,this.pdf.setFont(fn,Jt)}}}}),Object.defineProperty(this,"globalCompositeOperation",{get:function(){return this.ctx.globalCompositeOperation},set:function(ee){this.ctx.globalCompositeOperation=ee}}),Object.defineProperty(this,"globalAlpha",{get:function(){return this.ctx.globalAlpha},set:function(ee){this.ctx.globalAlpha=ee}}),Object.defineProperty(this,"lineDashOffset",{get:function(){return this.ctx.lineDashOffset},set:function(ee){this.ctx.lineDashOffset=ee,U.call(this)}}),Object.defineProperty(this,"lineDash",{get:function(){return this.ctx.lineDash},set:function(ee){this.ctx.lineDash=ee,U.call(this)}}),Object.defineProperty(this,"ignoreClearRect",{get:function(){return this.ctx.ignoreClearRect},set:function(ee){this.ctx.ignoreClearRect=!!ee}})};g.prototype.setLineDash=function(j){this.lineDash=j},g.prototype.getLineDash=function(){return this.lineDash.length%2?this.lineDash.concat(this.lineDash):this.lineDash.slice()},g.prototype.fill=function(){D.call(this,"fill",!1)},g.prototype.stroke=function(){D.call(this,"stroke",!1)},g.prototype.beginPath=function(){this.path=[{type:"begin"}]},g.prototype.moveTo=function(j,Y){if(isNaN(j)||isNaN(Y))throw hr.error("jsPDF.context2d.moveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.moveTo");var K=this.ctx.transform.applyToPoint(new l(j,Y));this.path.push({type:"mt",x:K.x,y:K.y}),this.ctx.lastPoint=new l(j,Y)},g.prototype.closePath=function(){var j=new l(0,0),Y=0;for(Y=this.path.length-1;Y!==-1;Y--)if(this.path[Y].type==="begin"&&Rn(this.path[Y+1])==="object"&&typeof this.path[Y+1].x=="number"){j=new l(this.path[Y+1].x,this.path[Y+1].y);break}this.path.push({type:"close"}),this.ctx.lastPoint=new l(j.x,j.y)},g.prototype.lineTo=function(j,Y){if(isNaN(j)||isNaN(Y))throw hr.error("jsPDF.context2d.lineTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.lineTo");var K=this.ctx.transform.applyToPoint(new l(j,Y));this.path.push({type:"lt",x:K.x,y:K.y}),this.ctx.lastPoint=new l(K.x,K.y)},g.prototype.clip=function(){this.ctx.clip_path=JSON.parse(JSON.stringify(this.path)),D.call(this,null,!0)},g.prototype.quadraticCurveTo=function(j,Y,K,ie){if(isNaN(K)||isNaN(ie)||isNaN(j)||isNaN(Y))throw hr.error("jsPDF.context2d.quadraticCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.quadraticCurveTo");var V=this.ctx.transform.applyToPoint(new l(K,ie)),se=this.ctx.transform.applyToPoint(new l(j,Y));this.path.push({type:"qct",x1:se.x,y1:se.y,x:V.x,y:V.y}),this.ctx.lastPoint=new l(V.x,V.y)},g.prototype.bezierCurveTo=function(j,Y,K,ie,V,se){if(isNaN(V)||isNaN(se)||isNaN(j)||isNaN(Y)||isNaN(K)||isNaN(ie))throw hr.error("jsPDF.context2d.bezierCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.bezierCurveTo");var be=this.ctx.transform.applyToPoint(new l(V,se)),xe=this.ctx.transform.applyToPoint(new l(j,Y)),Oe=this.ctx.transform.applyToPoint(new l(K,ie));this.path.push({type:"bct",x1:xe.x,y1:xe.y,x2:Oe.x,y2:Oe.y,x:be.x,y:be.y}),this.ctx.lastPoint=new l(be.x,be.y)},g.prototype.arc=function(j,Y,K,ie,V,se){if(isNaN(j)||isNaN(Y)||isNaN(K)||isNaN(ie)||isNaN(V))throw hr.error("jsPDF.context2d.arc: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.arc");if(se=!!se,!this.ctx.transform.isIdentity){var be=this.ctx.transform.applyToPoint(new l(j,Y));j=be.x,Y=be.y;var xe=this.ctx.transform.applyToPoint(new l(0,K)),Oe=this.ctx.transform.applyToPoint(new l(0,0));K=Math.sqrt(Math.pow(xe.x-Oe.x,2)+Math.pow(xe.y-Oe.y,2))}Math.abs(V-ie)>=2*Math.PI&&(ie=0,V=2*Math.PI),this.path.push({type:"arc",x:j,y:Y,radius:K,startAngle:ie,endAngle:V,counterclockwise:se})},g.prototype.arcTo=function(j,Y,K,ie,V){throw new Error("arcTo not implemented.")},g.prototype.rect=function(j,Y,K,ie){if(isNaN(j)||isNaN(Y)||isNaN(K)||isNaN(ie))throw hr.error("jsPDF.context2d.rect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rect");this.moveTo(j,Y),this.lineTo(j+K,Y),this.lineTo(j+K,Y+ie),this.lineTo(j,Y+ie),this.lineTo(j,Y),this.lineTo(j+K,Y),this.lineTo(j,Y)},g.prototype.fillRect=function(j,Y,K,ie){if(isNaN(j)||isNaN(Y)||isNaN(K)||isNaN(ie))throw hr.error("jsPDF.context2d.fillRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillRect");if(!m.call(this)){var V={};this.lineCap!=="butt"&&(V.lineCap=this.lineCap,this.lineCap="butt"),this.lineJoin!=="miter"&&(V.lineJoin=this.lineJoin,this.lineJoin="miter"),this.beginPath(),this.rect(j,Y,K,ie),this.fill(),V.hasOwnProperty("lineCap")&&(this.lineCap=V.lineCap),V.hasOwnProperty("lineJoin")&&(this.lineJoin=V.lineJoin)}},g.prototype.strokeRect=function(j,Y,K,ie){if(isNaN(j)||isNaN(Y)||isNaN(K)||isNaN(ie))throw hr.error("jsPDF.context2d.strokeRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeRect");x.call(this)||(this.beginPath(),this.rect(j,Y,K,ie),this.stroke())},g.prototype.clearRect=function(j,Y,K,ie){if(isNaN(j)||isNaN(Y)||isNaN(K)||isNaN(ie))throw hr.error("jsPDF.context2d.clearRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.clearRect");this.ignoreClearRect||(this.fillStyle="#ffffff",this.fillRect(j,Y,K,ie))},g.prototype.save=function(j){j=typeof j!="boolean"||j;for(var Y=this.pdf.internal.getCurrentPageInfo().pageNumber,K=0;K<this.pdf.internal.getNumberOfPages();K++)this.pdf.setPage(K+1),this.pdf.internal.out("q");if(this.pdf.setPage(Y),j){this.ctx.fontSize=this.pdf.internal.getFontSize();var ie=new d(this.ctx);this.ctxStack.push(this.ctx),this.ctx=ie}},g.prototype.restore=function(j){j=typeof j!="boolean"||j;for(var Y=this.pdf.internal.getCurrentPageInfo().pageNumber,K=0;K<this.pdf.internal.getNumberOfPages();K++)this.pdf.setPage(K+1),this.pdf.internal.out("Q");this.pdf.setPage(Y),j&&this.ctxStack.length!==0&&(this.ctx=this.ctxStack.pop(),this.fillStyle=this.ctx.fillStyle,this.strokeStyle=this.ctx.strokeStyle,this.font=this.ctx.font,this.lineCap=this.ctx.lineCap,this.lineWidth=this.ctx.lineWidth,this.lineJoin=this.ctx.lineJoin,this.lineDash=this.ctx.lineDash,this.lineDashOffset=this.ctx.lineDashOffset)},g.prototype.toDataURL=function(){throw new Error("toDataUrl not implemented.")};var y=function(j){var Y,K,ie,V;if(j.isCanvasGradient===!0&&(j=j.getColor()),!j)return{r:0,g:0,b:0,a:0,style:j};if(/transparent|rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*0+\s*\)/.test(j))Y=0,K=0,ie=0,V=0;else{var se=/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/.exec(j);if(se!==null)Y=parseInt(se[1]),K=parseInt(se[2]),ie=parseInt(se[3]),V=1;else if((se=/rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)/.exec(j))!==null)Y=parseInt(se[1]),K=parseInt(se[2]),ie=parseInt(se[3]),V=parseFloat(se[4]);else{if(V=1,typeof j=="string"&&j.charAt(0)!=="#"){var be=new O6(j);j=be.ok?be.toHex():"#000000"}j.length===4?(Y=j.substring(1,2),Y+=Y,K=j.substring(2,3),K+=K,ie=j.substring(3,4),ie+=ie):(Y=j.substring(1,3),K=j.substring(3,5),ie=j.substring(5,7)),Y=parseInt(Y,16),K=parseInt(K,16),ie=parseInt(ie,16)}}return{r:Y,g:K,b:ie,a:V,style:j}},m=function(){return this.ctx.isFillTransparent||this.globalAlpha==0},x=function(){return!!(this.ctx.isStrokeTransparent||this.globalAlpha==0)};g.prototype.fillText=function(j,Y,K,ie){if(isNaN(Y)||isNaN(K)||typeof j!="string")throw hr.error("jsPDF.context2d.fillText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillText");if(ie=isNaN(ie)?void 0:ie,!m.call(this)){var V=oe(this.ctx.transform.rotation),se=this.ctx.transform.scaleX;z.call(this,{text:j,x:Y,y:K,scale:se,angle:V,align:this.textAlign,maxWidth:ie})}},g.prototype.strokeText=function(j,Y,K,ie){if(isNaN(Y)||isNaN(K)||typeof j!="string")throw hr.error("jsPDF.context2d.strokeText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeText");if(!x.call(this)){ie=isNaN(ie)?void 0:ie;var V=oe(this.ctx.transform.rotation),se=this.ctx.transform.scaleX;z.call(this,{text:j,x:Y,y:K,scale:se,renderingMode:"stroke",angle:V,align:this.textAlign,maxWidth:ie})}},g.prototype.measureText=function(j){if(typeof j!="string")throw hr.error("jsPDF.context2d.measureText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.measureText");var Y=this.pdf,K=this.pdf.internal.scaleFactor,ie=Y.internal.getFontSize(),V=Y.getStringUnitWidth(j)*ie/Y.internal.scaleFactor;return new function(se){var be=(se=se||{}).width||0;return Object.defineProperty(this,"width",{get:function(){return be}}),this}({width:V*=Math.round(96*K/72*1e4)/1e4})},g.prototype.scale=function(j,Y){if(isNaN(j)||isNaN(Y))throw hr.error("jsPDF.context2d.scale: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.scale");var K=new c(j,0,0,Y,0,0);this.ctx.transform=this.ctx.transform.multiply(K)},g.prototype.rotate=function(j){if(isNaN(j))throw hr.error("jsPDF.context2d.rotate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rotate");var Y=new c(Math.cos(j),Math.sin(j),-Math.sin(j),Math.cos(j),0,0);this.ctx.transform=this.ctx.transform.multiply(Y)},g.prototype.translate=function(j,Y){if(isNaN(j)||isNaN(Y))throw hr.error("jsPDF.context2d.translate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.translate");var K=new c(1,0,0,1,j,Y);this.ctx.transform=this.ctx.transform.multiply(K)},g.prototype.transform=function(j,Y,K,ie,V,se){if(isNaN(j)||isNaN(Y)||isNaN(K)||isNaN(ie)||isNaN(V)||isNaN(se))throw hr.error("jsPDF.context2d.transform: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.transform");var be=new c(j,Y,K,ie,V,se);this.ctx.transform=this.ctx.transform.multiply(be)},g.prototype.setTransform=function(j,Y,K,ie,V,se){j=isNaN(j)?1:j,Y=isNaN(Y)?0:Y,K=isNaN(K)?0:K,ie=isNaN(ie)?1:ie,V=isNaN(V)?0:V,se=isNaN(se)?0:se,this.ctx.transform=new c(j,Y,K,ie,V,se)};var E=function(){return this.margin[0]>0||this.margin[1]>0||this.margin[2]>0||this.margin[3]>0};g.prototype.drawImage=function(j,Y,K,ie,V,se,be,xe,Oe){var Me=this.pdf.getImageProperties(j),Ue=1,Be=1,Ke=1,ee=1;ie!==void 0&&xe!==void 0&&(Ke=xe/ie,ee=Oe/V,Ue=Me.width/ie*xe/ie,Be=Me.height/V*Oe/V),se===void 0&&(se=Y,be=K,Y=0,K=0),ie!==void 0&&xe===void 0&&(xe=ie,Oe=V),ie===void 0&&xe===void 0&&(xe=Me.width,Oe=Me.height);var qe=this.ctx.transform.decompose(),ct=oe(qe.rotate.shx),tt=new c,Ye=(tt=(tt=(tt=tt.multiply(qe.translate)).multiply(qe.skew)).multiply(qe.scale)).applyToRectangle(new u(se-Y*Ke,be-K*ee,ie*Ue,V*Be));if(this.autoPaging){for(var gt,ot=A.call(this,Ye),Ot=[],At=0;At<ot.length;At+=1)Ot.indexOf(ot[At])===-1&&Ot.push(ot[At]);T(Ot);for(var Ft=Ot[0],rn=Ot[Ot.length-1],Jt=Ft;Jt<rn+1;Jt++){this.pdf.setPage(Jt);var fn=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],zt=Jt===1?this.posY+this.margin[0]:this.margin[0],at=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],Xt=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],wt=Jt===1?0:at+(Jt-2)*Xt;if(this.ctx.clip_path.length!==0){var lr=this.path;gt=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=O(gt,this.posX+this.margin[3],-wt+zt+this.ctx.prevPageLastElemOffset),F.call(this,"fill",!0),this.path=lr}var dn=JSON.parse(JSON.stringify(Ye));dn=O([dn],this.posX+this.margin[3],-wt+zt+this.ctx.prevPageLastElemOffset)[0];var bt=(Jt>Ft||Jt<rn)&&E.call(this);bt&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],fn,Xt,null).clip().discardPath()),this.pdf.addImage(j,"JPEG",dn.x,dn.y,dn.w,dn.h,null,null,ct),bt&&this.pdf.restoreGraphicsState()}}else this.pdf.addImage(j,"JPEG",Ye.x,Ye.y,Ye.w,Ye.h,null,null,ct)};var A=function(j,Y,K){var ie=[];Y=Y||this.pdf.internal.pageSize.width,K=K||this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2];var V=this.posY+this.ctx.prevPageLastElemOffset;switch(j.type){default:case"mt":case"lt":ie.push(Math.floor((j.y+V)/K)+1);break;case"arc":ie.push(Math.floor((j.y+V-j.radius)/K)+1),ie.push(Math.floor((j.y+V+j.radius)/K)+1);break;case"qct":var se=ge(this.ctx.lastPoint.x,this.ctx.lastPoint.y,j.x1,j.y1,j.x,j.y);ie.push(Math.floor((se.y+V)/K)+1),ie.push(Math.floor((se.y+se.h+V)/K)+1);break;case"bct":var be=he(this.ctx.lastPoint.x,this.ctx.lastPoint.y,j.x1,j.y1,j.x2,j.y2,j.x,j.y);ie.push(Math.floor((be.y+V)/K)+1),ie.push(Math.floor((be.y+be.h+V)/K)+1);break;case"rect":ie.push(Math.floor((j.y+V)/K)+1),ie.push(Math.floor((j.y+j.h+V)/K)+1)}for(var xe=0;xe<ie.length;xe+=1)for(;this.pdf.internal.getNumberOfPages()<ie[xe];)N.call(this);return ie},N=function(){var j=this.fillStyle,Y=this.strokeStyle,K=this.font,ie=this.lineCap,V=this.lineWidth,se=this.lineJoin;this.pdf.addPage(),this.fillStyle=j,this.strokeStyle=Y,this.font=K,this.lineCap=ie,this.lineWidth=V,this.lineJoin=se},O=function(j,Y,K){for(var ie=0;ie<j.length;ie++)switch(j[ie].type){case"bct":j[ie].x2+=Y,j[ie].y2+=K;case"qct":j[ie].x1+=Y,j[ie].y1+=K;default:j[ie].x+=Y,j[ie].y+=K}return j},T=function(j){return j.sort(function(Y,K){return Y-K})},D=function(j,Y){var K=this.fillStyle,ie=this.strokeStyle,V=this.lineCap,se=this.lineWidth,be=Math.abs(se*this.ctx.transform.scaleX),xe=this.lineJoin;if(this.autoPaging){for(var Oe,Me,Ue=JSON.parse(JSON.stringify(this.path)),Be=JSON.parse(JSON.stringify(this.path)),Ke=[],ee=0;ee<Be.length;ee++)if(Be[ee].x!==void 0)for(var qe=A.call(this,Be[ee]),ct=0;ct<qe.length;ct+=1)Ke.indexOf(qe[ct])===-1&&Ke.push(qe[ct]);for(var tt=0;tt<Ke.length;tt++)for(;this.pdf.internal.getNumberOfPages()<Ke[tt];)N.call(this);T(Ke);for(var Ye=Ke[0],gt=Ke[Ke.length-1],ot=Ye;ot<gt+1;ot++){this.pdf.setPage(ot),this.fillStyle=K,this.strokeStyle=ie,this.lineCap=V,this.lineWidth=be,this.lineJoin=xe;var Ot=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],At=ot===1?this.posY+this.margin[0]:this.margin[0],Ft=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],rn=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],Jt=ot===1?0:Ft+(ot-2)*rn;if(this.ctx.clip_path.length!==0){var fn=this.path;Oe=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=O(Oe,this.posX+this.margin[3],-Jt+At+this.ctx.prevPageLastElemOffset),F.call(this,j,!0),this.path=fn}if(Me=JSON.parse(JSON.stringify(Ue)),this.path=O(Me,this.posX+this.margin[3],-Jt+At+this.ctx.prevPageLastElemOffset),Y===!1||ot===0){var zt=(ot>Ye||ot<gt)&&E.call(this);zt&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],Ot,rn,null).clip().discardPath()),F.call(this,j,Y),zt&&this.pdf.restoreGraphicsState()}this.lineWidth=se}this.path=Ue}else this.lineWidth=be,F.call(this,j,Y),this.lineWidth=se},F=function(j,Y){if((j!=="stroke"||Y||!x.call(this))&&(j==="stroke"||Y||!m.call(this))){for(var K,ie,V=[],se=this.path,be=0;be<se.length;be++){var xe=se[be];switch(xe.type){case"begin":V.push({begin:!0});break;case"close":V.push({close:!0});break;case"mt":V.push({start:xe,deltas:[],abs:[]});break;case"lt":var Oe=V.length;if(se[be-1]&&!isNaN(se[be-1].x)&&(K=[xe.x-se[be-1].x,xe.y-se[be-1].y],Oe>0)){for(;Oe>=0;Oe--)if(V[Oe-1].close!==!0&&V[Oe-1].begin!==!0){V[Oe-1].deltas.push(K),V[Oe-1].abs.push(xe);break}}break;case"bct":K=[xe.x1-se[be-1].x,xe.y1-se[be-1].y,xe.x2-se[be-1].x,xe.y2-se[be-1].y,xe.x-se[be-1].x,xe.y-se[be-1].y],V[V.length-1].deltas.push(K);break;case"qct":var Me=se[be-1].x+2/3*(xe.x1-se[be-1].x),Ue=se[be-1].y+2/3*(xe.y1-se[be-1].y),Be=xe.x+2/3*(xe.x1-xe.x),Ke=xe.y+2/3*(xe.y1-xe.y),ee=xe.x,qe=xe.y;K=[Me-se[be-1].x,Ue-se[be-1].y,Be-se[be-1].x,Ke-se[be-1].y,ee-se[be-1].x,qe-se[be-1].y],V[V.length-1].deltas.push(K);break;case"arc":V.push({deltas:[],abs:[],arc:!0}),Array.isArray(V[V.length-1].abs)&&V[V.length-1].abs.push(xe)}}ie=Y?null:j==="stroke"?"stroke":"fill";for(var ct=!1,tt=0;tt<V.length;tt++)if(V[tt].arc)for(var Ye=V[tt].abs,gt=0;gt<Ye.length;gt++){var ot=Ye[gt];ot.type==="arc"?$.call(this,ot.x,ot.y,ot.radius,ot.startAngle,ot.endAngle,ot.counterclockwise,void 0,Y,!ct):J.call(this,ot.x,ot.y),ct=!0}else if(V[tt].close===!0)this.pdf.internal.out("h"),ct=!1;else if(V[tt].begin!==!0){var Ot=V[tt].start.x,At=V[tt].start.y;ae.call(this,V[tt].deltas,Ot,At),ct=!0}ie&&B.call(this,ie),Y&&ne.call(this)}},Q=function(j){var Y=this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor,K=Y*(this.pdf.internal.getLineHeightFactor()-1);switch(this.ctx.textBaseline){case"bottom":return j-K;case"top":return j+Y-K;case"hanging":return j+Y-2*K;case"middle":return j+Y/2-K;default:return j}},P=function(j){return j+this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor*(this.pdf.internal.getLineHeightFactor()-1)};g.prototype.createLinearGradient=function(){var j=function(){};return j.colorStops=[],j.addColorStop=function(Y,K){this.colorStops.push([Y,K])},j.getColor=function(){return this.colorStops.length===0?"#000000":this.colorStops[0][1]},j.isCanvasGradient=!0,j},g.prototype.createPattern=function(){return this.createLinearGradient()},g.prototype.createRadialGradient=function(){return this.createLinearGradient()};var $=function(j,Y,K,ie,V,se,be,xe,Oe){for(var Me=Z.call(this,K,ie,V,se),Ue=0;Ue<Me.length;Ue++){var Be=Me[Ue];Ue===0&&(Oe?I.call(this,Be.x1+j,Be.y1+Y):J.call(this,Be.x1+j,Be.y1+Y)),me.call(this,j,Y,Be.x2,Be.y2,Be.x3,Be.y3,Be.x4,Be.y4)}xe?ne.call(this):B.call(this,be)},B=function(j){switch(j){case"stroke":this.pdf.internal.out("S");break;case"fill":this.pdf.internal.out("f")}},ne=function(){this.pdf.clip(),this.pdf.discardPath()},I=function(j,Y){this.pdf.internal.out(n(j)+" "+r(Y)+" m")},z=function(j){var Y;switch(j.align){case"right":case"end":Y="right";break;case"center":Y="center";break;default:Y="left"}var K,ie,V,se=this.pdf.getTextDimensions(j.text),be=Q.call(this,j.y),xe=P.call(this,be)-se.h,Oe=this.ctx.transform.applyToPoint(new l(j.x,be));if(this.autoPaging){var Me=this.ctx.transform.decompose(),Ue=new c;Ue=(Ue=(Ue=Ue.multiply(Me.translate)).multiply(Me.skew)).multiply(Me.scale);for(var Be=this.ctx.transform.applyToRectangle(new u(j.x,be,se.w,se.h)),Ke=Ue.applyToRectangle(new u(j.x,xe,se.w,se.h)),ee=A.call(this,Ke),qe=[],ct=0;ct<ee.length;ct+=1)qe.indexOf(ee[ct])===-1&&qe.push(ee[ct]);T(qe);for(var tt=qe[0],Ye=qe[qe.length-1],gt=tt;gt<Ye+1;gt++){this.pdf.setPage(gt);var ot=gt===1?this.posY+this.margin[0]:this.margin[0],Ot=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],At=this.pdf.internal.pageSize.height-this.margin[2],Ft=At-this.margin[0],rn=this.pdf.internal.pageSize.width-this.margin[1],Jt=rn-this.margin[3],fn=gt===1?0:Ot+(gt-2)*Ft;if(this.ctx.clip_path.length!==0){var zt=this.path;K=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=O(K,this.posX+this.margin[3],-1*fn+ot),F.call(this,"fill",!0),this.path=zt}var at=O([JSON.parse(JSON.stringify(Ke))],this.posX+this.margin[3],-fn+ot+this.ctx.prevPageLastElemOffset)[0];j.scale>=.01&&(ie=this.pdf.internal.getFontSize(),this.pdf.setFontSize(ie*j.scale),V=this.lineWidth,this.lineWidth=V*j.scale);var Xt=this.autoPaging!=="text";if(Xt||at.y+at.h<=At){if(Xt||at.y>=ot&&at.x<=rn){var wt=Xt?j.text:this.pdf.splitTextToSize(j.text,j.maxWidth||rn-at.x)[0],lr=O([JSON.parse(JSON.stringify(Be))],this.posX+this.margin[3],-fn+ot+this.ctx.prevPageLastElemOffset)[0],dn=Xt&&(gt>tt||gt<Ye)&&E.call(this);dn&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],Jt,Ft,null).clip().discardPath()),this.pdf.text(wt,lr.x,lr.y,{angle:j.angle,align:Y,renderingMode:j.renderingMode}),dn&&this.pdf.restoreGraphicsState()}}else at.y<At&&(this.ctx.prevPageLastElemOffset+=At-at.y);j.scale>=.01&&(this.pdf.setFontSize(ie),this.lineWidth=V)}}else j.scale>=.01&&(ie=this.pdf.internal.getFontSize(),this.pdf.setFontSize(ie*j.scale),V=this.lineWidth,this.lineWidth=V*j.scale),this.pdf.text(j.text,Oe.x+this.posX,Oe.y+this.posY,{angle:j.angle,align:Y,renderingMode:j.renderingMode,maxWidth:j.maxWidth}),j.scale>=.01&&(this.pdf.setFontSize(ie),this.lineWidth=V)},J=function(j,Y,K,ie){K=K||0,ie=ie||0,this.pdf.internal.out(n(j+K)+" "+r(Y+ie)+" l")},ae=function(j,Y,K){return this.pdf.lines(j,Y,K,null,null)},me=function(j,Y,K,ie,V,se,be,xe){this.pdf.internal.out([e(a(K+j)),e(s(ie+Y)),e(a(V+j)),e(s(se+Y)),e(a(be+j)),e(s(xe+Y)),"c"].join(" "))},Z=function(j,Y,K,ie){for(var V=2*Math.PI,se=Math.PI/2;Y>K;)Y-=V;var be=Math.abs(K-Y);be<V&&ie&&(be=V-be);for(var xe=[],Oe=ie?-1:1,Me=Y;be>1e-5;){var Ue=Me+Oe*Math.min(be,se);xe.push(ce.call(this,j,Me,Ue)),be-=Math.abs(Ue-Me),Me=Ue}return xe},ce=function(j,Y,K){var ie=(K-Y)/2,V=j*Math.cos(ie),se=j*Math.sin(ie),be=V,xe=-se,Oe=be*be+xe*xe,Me=Oe+be*V+xe*se,Ue=4/3*(Math.sqrt(2*Oe*Me)-Me)/(be*se-xe*V),Be=be-Ue*xe,Ke=xe+Ue*be,ee=Be,qe=-Ke,ct=ie+Y,tt=Math.cos(ct),Ye=Math.sin(ct);return{x1:j*Math.cos(Y),y1:j*Math.sin(Y),x2:Be*tt-Ke*Ye,y2:Be*Ye+Ke*tt,x3:ee*tt-qe*Ye,y3:ee*Ye+qe*tt,x4:j*Math.cos(K),y4:j*Math.sin(K)}},oe=function(j){return 180*j/Math.PI},ge=function(j,Y,K,ie,V,se){var be=j+.5*(K-j),xe=Y+.5*(ie-Y),Oe=V+.5*(K-V),Me=se+.5*(ie-se),Ue=Math.min(j,V,be,Oe),Be=Math.max(j,V,be,Oe),Ke=Math.min(Y,se,xe,Me),ee=Math.max(Y,se,xe,Me);return new u(Ue,Ke,Be-Ue,ee-Ke)},he=function(j,Y,K,ie,V,se,be,xe){var Oe,Me,Ue,Be,Ke,ee,qe,ct,tt,Ye,gt,ot,Ot,At,Ft=K-j,rn=ie-Y,Jt=V-K,fn=se-ie,zt=be-V,at=xe-se;for(Me=0;Me<41;Me++)tt=(qe=(Ue=j+(Oe=Me/40)*Ft)+Oe*((Ke=K+Oe*Jt)-Ue))+Oe*(Ke+Oe*(V+Oe*zt-Ke)-qe),Ye=(ct=(Be=Y+Oe*rn)+Oe*((ee=ie+Oe*fn)-Be))+Oe*(ee+Oe*(se+Oe*at-ee)-ct),Me==0?(gt=tt,ot=Ye,Ot=tt,At=Ye):(gt=Math.min(gt,tt),ot=Math.min(ot,Ye),Ot=Math.max(Ot,tt),At=Math.max(At,Ye));return new u(Math.round(gt),Math.round(ot),Math.round(Ot-gt),Math.round(At-ot))},U=function(){if(this.prevLineDash||this.ctx.lineDash.length||this.ctx.lineDashOffset){var j,Y,K=(j=this.ctx.lineDash,Y=this.ctx.lineDashOffset,JSON.stringify({lineDash:j,lineDashOffset:Y}));this.prevLineDash!==K&&(this.pdf.setLineDash(this.ctx.lineDash,this.ctx.lineDashOffset),this.prevLineDash=K)}}})(Lt.API),(function(t){var e=function(l){var u,c,h,d,g,y,m,x,E,A;for(c=[],h=0,d=(l+=u="\0\0\0\0".slice(l.length%4||4)).length;d>h;h+=4)(g=(l.charCodeAt(h)<<24)+(l.charCodeAt(h+1)<<16)+(l.charCodeAt(h+2)<<8)+l.charCodeAt(h+3))!==0?(y=(g=((g=((g=((g=(g-(A=g%85))/85)-(E=g%85))/85)-(x=g%85))/85)-(m=g%85))/85)%85,c.push(y+33,m+33,x+33,E+33,A+33)):c.push(122);return(function(N,O){for(var T=O;T>0;T--)N.pop()})(c,u.length),String.fromCharCode.apply(String,c)+"~>"},n=function(l){var u,c,h,d,g,y=String,m="length",x=255,E="charCodeAt",A="slice",N="replace";for(l[A](-2),l=l[A](0,-2)[N](/\s/g,"")[N]("z","!!!!!"),h=[],d=0,g=(l+=u="uuuuu"[A](l[m]%5||5))[m];g>d;d+=5)c=52200625*(l[E](d)-33)+614125*(l[E](d+1)-33)+7225*(l[E](d+2)-33)+85*(l[E](d+3)-33)+(l[E](d+4)-33),h.push(x&c>>24,x&c>>16,x&c>>8,x&c);return(function(O,T){for(var D=T;D>0;D--)O.pop()})(h,u[m]),y.fromCharCode.apply(y,h)},r=function(l){return l.split("").map(function(u){return("0"+u.charCodeAt().toString(16)).slice(-2)}).join("")+">"},a=function(l){var u=new RegExp(/^([0-9A-Fa-f]{2})+$/);if((l=l.replace(/\s/g,"")).indexOf(">")!==-1&&(l=l.substr(0,l.indexOf(">"))),l.length%2&&(l+="0"),u.test(l)===!1)return"";for(var c="",h=0;h<l.length;h+=2)c+=String.fromCharCode("0x"+(l[h]+l[h+1]));return c},s=function(l){for(var u=new Uint8Array(l.length),c=l.length;c--;)u[c]=l.charCodeAt(c);return(u=qv(u)).reduce(function(h,d){return h+String.fromCharCode(d)},"")};t.processDataByFilters=function(l,u){var c=0,h=l||"",d=[];for(typeof(u=u||[])=="string"&&(u=[u]),c=0;c<u.length;c+=1)switch(u[c]){case"ASCII85Decode":case"/ASCII85Decode":h=n(h),d.push("/ASCII85Encode");break;case"ASCII85Encode":case"/ASCII85Encode":h=e(h),d.push("/ASCII85Decode");break;case"ASCIIHexDecode":case"/ASCIIHexDecode":h=a(h),d.push("/ASCIIHexEncode");break;case"ASCIIHexEncode":case"/ASCIIHexEncode":h=r(h),d.push("/ASCIIHexDecode");break;case"FlateEncode":case"/FlateEncode":h=s(h),d.push("/FlateDecode");break;default:throw new Error('The filter: "'+u[c]+'" is not implemented')}return{data:h,reverseChain:d.reverse().join(" ")}}})(Lt.API),(function(t){t.loadFile=function(e,n,r){return(function(a,s,l){s=s!==!1,l=typeof l=="function"?l:function(){};var u=void 0;try{u=(function(c,h,d){var g=new XMLHttpRequest,y=0,m=function(x){var E=x.length,A=[],N=String.fromCharCode;for(y=0;y<E;y+=1)A.push(N(255&x.charCodeAt(y)));return A.join("")};if(g.open("GET",c,!h),g.overrideMimeType("text/plain; charset=x-user-defined"),h===!1&&(g.onload=function(){g.status===200?d(m(this.responseText)):d(void 0)}),g.send(null),h&&g.status===200)return m(g.responseText)})(a,s,l)}catch{}return u})(e,n,r)},t.allowFsRead=void 0,t.loadImageFile=t.loadFile})(Lt.API),(function(t){function e(){return(tn.html2canvas?Promise.resolve(tn.html2canvas):w1(()=>import("./html2canvas.esm-QH1iLAAe.js"),[])).catch(function(u){return Promise.reject(new Error("Could not load html2canvas: "+u))}).then(function(u){return u.default?u.default:u})}function n(){return(tn.DOMPurify?Promise.resolve(tn.DOMPurify):w1(()=>import("./purify.es-B9ZVCkUG.js"),[])).catch(function(u){return Promise.reject(new Error("Could not load dompurify: "+u))}).then(function(u){return u.default?u.default:u})}var r=function(u){var c=Rn(u);return c==="undefined"?"undefined":c==="string"||u instanceof String?"string":c==="number"||u instanceof Number?"number":c==="function"||u instanceof Function?"function":u&&u.constructor===Array?"array":u&&u.nodeType===1?"element":c==="object"?"object":"unknown"},a=function(u,c){var h=document.createElement(u);for(var d in c.className&&(h.className=c.className),c.innerHTML&&c.dompurify&&(h.innerHTML=c.dompurify.sanitize(c.innerHTML)),c.style)h.style[d]=c.style[d];return h},s=function u(c,h){for(var d=c.nodeType===3?document.createTextNode(c.nodeValue):c.cloneNode(!1),g=c.firstChild;g;g=g.nextSibling)h!==!0&&g.nodeType===1&&g.nodeName==="SCRIPT"||d.appendChild(u(g,h));return c.nodeType===1&&(c.nodeName==="CANVAS"?(d.width=c.width,d.height=c.height,d.getContext("2d").drawImage(c,0,0)):c.nodeName!=="TEXTAREA"&&c.nodeName!=="SELECT"||(d.value=c.value),d.addEventListener("load",function(){d.scrollTop=c.scrollTop,d.scrollLeft=c.scrollLeft},!0)),d},l=function u(c){var h=Object.assign(u.convert(Promise.resolve()),JSON.parse(JSON.stringify(u.template))),d=u.convert(Promise.resolve(),h);return(d=d.setProgress(1,u,1,[u])).set(c)};(l.prototype=Object.create(Promise.prototype)).constructor=l,l.convert=function(u,c){return u.__proto__=c||l.prototype,u},l.template={prop:{src:null,container:null,overlay:null,canvas:null,img:null,pdf:null,pageSize:null,callback:function(){}},progress:{val:0,state:null,n:0,stack:[]},opt:{filename:"file.pdf",margin:[0,0,0,0],enableLinks:!0,x:0,y:0,html2canvas:{},jsPDF:{},backgroundColor:"transparent"}},l.prototype.from=function(u,c){return this.then(function(){switch(c=c||(function(h){switch(r(h)){case"string":return"string";case"element":return h.nodeName.toLowerCase()==="canvas"?"canvas":"element";default:return"unknown"}})(u),c){case"string":return this.then(n).then(function(h){return this.set({src:a("div",{innerHTML:u,dompurify:h})})});case"element":return this.set({src:u});case"canvas":return this.set({canvas:u});case"img":return this.set({img:u});default:return this.error("Unknown source type.")}})},l.prototype.to=function(u){switch(u){case"container":return this.toContainer();case"canvas":return this.toCanvas();case"img":return this.toImg();case"pdf":return this.toPdf();default:return this.error("Invalid target.")}},l.prototype.toContainer=function(){return this.thenList([function(){return this.prop.src||this.error("Cannot duplicate - no source HTML.")},function(){return this.prop.pageSize||this.setPageSize()}]).then(function(){var u={position:"relative",display:"inline-block",width:(typeof this.opt.width!="number"||isNaN(this.opt.width)||typeof this.opt.windowWidth!="number"||isNaN(this.opt.windowWidth)?Math.max(this.prop.src.clientWidth,this.prop.src.scrollWidth,this.prop.src.offsetWidth):this.opt.windowWidth)+"px",left:0,right:0,top:0,margin:"auto",backgroundColor:this.opt.backgroundColor},c=s(this.prop.src,this.opt.html2canvas.javascriptEnabled);c.tagName==="BODY"&&(u.height=Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight)+"px"),this.prop.overlay=a("div",{className:"html2pdf__overlay",style:{position:"fixed",overflow:"hidden",zIndex:1e3,left:"-100000px",right:0,bottom:0,top:0}}),this.prop.container=a("div",{className:"html2pdf__container",style:u}),this.prop.container.appendChild(c),this.prop.container.firstChild.appendChild(a("div",{style:{clear:"both",border:"0 none transparent",margin:0,padding:0,height:0}})),this.prop.container.style.float="none",this.prop.overlay.appendChild(this.prop.container),document.body.appendChild(this.prop.overlay),this.prop.container.firstChild.style.position="relative",this.prop.container.height=Math.max(this.prop.container.firstChild.clientHeight,this.prop.container.firstChild.scrollHeight,this.prop.container.firstChild.offsetHeight)+"px"})},l.prototype.toCanvas=function(){var u=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(u).then(e).then(function(c){var h=Object.assign({},this.opt.html2canvas);return delete h.onrendered,c(this.prop.container,h)}).then(function(c){(this.opt.html2canvas.onrendered||function(){})(c),this.prop.canvas=c,document.body.removeChild(this.prop.overlay)})},l.prototype.toContext2d=function(){var u=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(u).then(e).then(function(c){var h=this.opt.jsPDF,d=this.opt.fontFaces,g=typeof this.opt.width!="number"||isNaN(this.opt.width)||typeof this.opt.windowWidth!="number"||isNaN(this.opt.windowWidth)?1:this.opt.width/this.opt.windowWidth,y=Object.assign({async:!0,allowTaint:!0,scale:g,scrollX:this.opt.scrollX||0,scrollY:this.opt.scrollY||0,backgroundColor:"#ffffff",imageTimeout:15e3,logging:!0,proxy:null,removeContainer:!0,foreignObjectRendering:!1,useCORS:!1},this.opt.html2canvas);if(delete y.onrendered,h.context2d.autoPaging=this.opt.autoPaging===void 0||this.opt.autoPaging,h.context2d.posX=this.opt.x,h.context2d.posY=this.opt.y,h.context2d.margin=this.opt.margin,h.context2d.fontFaces=d,d)for(var m=0;m<d.length;++m){var x=d[m],E=x.src.find(function(A){return A.format==="truetype"});E&&h.addFont(E.url,x.ref.name,x.ref.style)}return y.windowHeight=y.windowHeight||0,y.windowHeight=y.windowHeight==0?Math.max(this.prop.container.clientHeight,this.prop.container.scrollHeight,this.prop.container.offsetHeight):y.windowHeight,h.context2d.save(!0),c(this.prop.container,y)}).then(function(c){this.opt.jsPDF.context2d.restore(!0),(this.opt.html2canvas.onrendered||function(){})(c),this.prop.canvas=c,document.body.removeChild(this.prop.overlay)})},l.prototype.toImg=function(){return this.thenList([function(){return this.prop.canvas||this.toCanvas()}]).then(function(){var u=this.prop.canvas.toDataURL("image/"+this.opt.image.type,this.opt.image.quality);this.prop.img=document.createElement("img"),this.prop.img.src=u})},l.prototype.toPdf=function(){return this.thenList([function(){return this.toContext2d()}]).then(function(){this.prop.pdf=this.prop.pdf||this.opt.jsPDF})},l.prototype.output=function(u,c,h){return(h=h||"pdf").toLowerCase()==="img"||h.toLowerCase()==="image"?this.outputImg(u,c):this.outputPdf(u,c)},l.prototype.outputPdf=function(u,c){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){return this.prop.pdf.output(u,c)})},l.prototype.outputImg=function(u){return this.thenList([function(){return this.prop.img||this.toImg()}]).then(function(){switch(u){case void 0:case"img":return this.prop.img;case"datauristring":case"dataurlstring":return this.prop.img.src;case"datauri":case"dataurl":return document.location.href=this.prop.img.src;default:throw'Image output type "'+u+'" is not supported.'}})},l.prototype.save=function(u){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).set(u?{filename:u}:null).then(function(){this.prop.pdf.save(this.opt.filename)})},l.prototype.doCallback=function(){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){this.prop.callback(this.prop.pdf)})},l.prototype.set=function(u){if(r(u)!=="object")return this;var c=Object.keys(u||{}).map(function(h){if(h in l.template.prop)return function(){this.prop[h]=u[h]};switch(h){case"margin":return this.setMargin.bind(this,u.margin);case"jsPDF":return function(){return this.opt.jsPDF=u.jsPDF,this.setPageSize()};case"pageSize":return this.setPageSize.bind(this,u.pageSize);default:return function(){this.opt[h]=u[h]}}},this);return this.then(function(){return this.thenList(c)})},l.prototype.get=function(u,c){return this.then(function(){var h=u in l.template.prop?this.prop[u]:this.opt[u];return c?c(h):h})},l.prototype.setMargin=function(u){return this.then(function(){switch(r(u)){case"number":u=[u,u,u,u];case"array":if(u.length===2&&(u=[u[0],u[1],u[0],u[1]]),u.length===4)break;default:return this.error("Invalid margin array.")}this.opt.margin=u}).then(this.setPageSize)},l.prototype.setPageSize=function(u){function c(h,d){return Math.floor(h*d/72*96)}return this.then(function(){(u=u||Lt.getPageSize(this.opt.jsPDF)).hasOwnProperty("inner")||(u.inner={width:u.width-this.opt.margin[1]-this.opt.margin[3],height:u.height-this.opt.margin[0]-this.opt.margin[2]},u.inner.px={width:c(u.inner.width,u.k),height:c(u.inner.height,u.k)},u.inner.ratio=u.inner.height/u.inner.width),this.prop.pageSize=u})},l.prototype.setProgress=function(u,c,h,d){return u!=null&&(this.progress.val=u),c!=null&&(this.progress.state=c),h!=null&&(this.progress.n=h),d!=null&&(this.progress.stack=d),this.progress.ratio=this.progress.val/this.progress.state,this},l.prototype.updateProgress=function(u,c,h,d){return this.setProgress(u?this.progress.val+u:null,c||null,h?this.progress.n+h:null,d?this.progress.stack.concat(d):null)},l.prototype.then=function(u,c){var h=this;return this.thenCore(u,c,function(d,g){return h.updateProgress(null,null,1,[d]),Promise.prototype.then.call(this,function(y){return h.updateProgress(null,d),y}).then(d,g).then(function(y){return h.updateProgress(1),y})})},l.prototype.thenCore=function(u,c,h){h=h||Promise.prototype.then;var d=this;u&&(u=u.bind(d)),c&&(c=c.bind(d));var g=Promise.toString().indexOf("[native code]")!==-1&&Promise.name==="Promise"?d:l.convert(Object.assign({},d),Promise.prototype),y=h.call(g,u,c);return l.convert(y,d.__proto__)},l.prototype.thenExternal=function(u,c){return Promise.prototype.then.call(this,u,c)},l.prototype.thenList=function(u){var c=this;return u.forEach(function(h){c=c.thenCore(h)}),c},l.prototype.catch=function(u){u&&(u=u.bind(this));var c=Promise.prototype.catch.call(this,u);return l.convert(c,this)},l.prototype.catchExternal=function(u){return Promise.prototype.catch.call(this,u)},l.prototype.error=function(u){return this.then(function(){throw new Error(u)})},l.prototype.using=l.prototype.set,l.prototype.saveAs=l.prototype.save,l.prototype.export=l.prototype.output,l.prototype.run=l.prototype.then,Lt.getPageSize=function(u,c,h){if(Rn(u)==="object"){var d=u;u=d.orientation,c=d.unit||c,h=d.format||h}c=c||"mm",h=h||"a4",u=(""+(u||"P")).toLowerCase();var g,y=(""+h).toLowerCase(),m={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};switch(c){case"pt":g=1;break;case"mm":g=72/25.4;break;case"cm":g=72/2.54;break;case"in":g=72;break;case"px":g=.75;break;case"pc":case"em":g=12;break;case"ex":g=6;break;default:throw"Invalid unit: "+c}var x,E=0,A=0;if(m.hasOwnProperty(y))E=m[y][1]/g,A=m[y][0]/g;else try{E=h[1],A=h[0]}catch{throw new Error("Invalid format: "+h)}if(u==="p"||u==="portrait")u="p",A>E&&(x=A,A=E,E=x);else{if(u!=="l"&&u!=="landscape")throw"Invalid orientation: "+u;u="l",E>A&&(x=A,A=E,E=x)}return{width:A,height:E,unit:c,k:g,orientation:u}},t.html=function(u,c){(c=c||{}).callback=c.callback||function(){},c.html2canvas=c.html2canvas||{},c.html2canvas.canvas=c.html2canvas.canvas||this.canvas,c.jsPDF=c.jsPDF||this,c.fontFaces=c.fontFaces?c.fontFaces.map(F1):null;var h=new l(c);return c.worker?h:h.from(u).doCallback()}})(Lt.API),Lt.API.addJS=function(t){return HS=t,this.internal.events.subscribe("postPutResources",function(){Yp=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/Names [(EmbeddedJS) "+(Yp+1)+" 0 R]"),this.internal.out(">>"),this.internal.out("endobj"),qS=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /JavaScript"),this.internal.out("/JS ("+HS+")"),this.internal.out(">>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){Yp!==void 0&&qS!==void 0&&this.internal.out("/Names <</JavaScript "+Yp+" 0 R>>")}),this},(function(t){var e;t.events.push(["postPutResources",function(){var n=this,r=/^(\d+) 0 obj$/;if(this.outline.root.children.length>0)for(var a=n.outline.render().split(/\r\n/),s=0;s<a.length;s++){var l=a[s],u=r.exec(l);if(u!=null){var c=u[1];n.internal.newObjectDeferredBegin(c,!1)}n.internal.write(l)}if(this.outline.createNamedDestinations){var h=this.internal.pages.length,d=[];for(s=0;s<h;s++){var g=n.internal.newObject();d.push(g);var y=n.internal.getPageInfo(s+1);n.internal.write("<< /D["+y.objId+" 0 R /XYZ null null null]>> endobj")}var m=n.internal.newObject();for(n.internal.write("<< /Names [ "),s=0;s<d.length;s++)n.internal.write("(page_"+(s+1)+")"+d[s]+" 0 R");n.internal.write(" ] >>","endobj"),e=n.internal.newObject(),n.internal.write("<< /Dests "+m+" 0 R"),n.internal.write(">>","endobj")}}]),t.events.push(["putCatalog",function(){var n=this;n.outline.root.children.length>0&&(n.internal.write("/Outlines",this.outline.makeRef(this.outline.root)),this.outline.createNamedDestinations&&n.internal.write("/Names "+e+" 0 R"))}]),t.events.push(["initialized",function(){var n=this;n.outline={createNamedDestinations:!1,root:{children:[]}},n.outline.add=function(r,a,s){var l={title:a,options:s,children:[]};return r==null&&(r=this.root),r.children.push(l),l},n.outline.render=function(){return this.ctx={},this.ctx.val="",this.ctx.pdf=n,this.genIds_r(this.root),this.renderRoot(this.root),this.renderItems(this.root),this.ctx.val},n.outline.genIds_r=function(r){r.id=n.internal.newObjectDeferred();for(var a=0;a<r.children.length;a++)this.genIds_r(r.children[a])},n.outline.renderRoot=function(r){this.objStart(r),this.line("/Type /Outlines"),r.children.length>0&&(this.line("/First "+this.makeRef(r.children[0])),this.line("/Last "+this.makeRef(r.children[r.children.length-1]))),this.line("/Count "+this.count_r({count:0},r)),this.objEnd()},n.outline.renderItems=function(r){for(var a=this.ctx.pdf.internal.getVerticalCoordinateString,s=0;s<r.children.length;s++){var l=r.children[s];this.objStart(l),this.line("/Title "+this.makeString(l.title)),this.line("/Parent "+this.makeRef(r)),s>0&&this.line("/Prev "+this.makeRef(r.children[s-1])),s<r.children.length-1&&this.line("/Next "+this.makeRef(r.children[s+1])),l.children.length>0&&(this.line("/First "+this.makeRef(l.children[0])),this.line("/Last "+this.makeRef(l.children[l.children.length-1])));var u=this.count=this.count_r({count:0},l);if(u>0&&this.line("/Count "+u),l.options&&l.options.pageNumber){var c=n.internal.getPageInfo(l.options.pageNumber);this.line("/Dest ["+c.objId+" 0 R /XYZ 0 "+a(0)+" 0]")}this.objEnd()}for(var h=0;h<r.children.length;h++)this.renderItems(r.children[h])},n.outline.line=function(r){this.ctx.val+=r+`\r
307
- `},n.outline.makeRef=function(r){return r.id+" 0 R"},n.outline.makeString=function(r){return"("+n.internal.pdfEscape(r)+")"},n.outline.objStart=function(r){this.ctx.val+=`\r
308
- `+r.id+` 0 obj\r
309
- <<\r
310
- `},n.outline.objEnd=function(){this.ctx.val+=`>> \r
311
- endobj\r
312
- `},n.outline.count_r=function(r,a){for(var s=0;s<a.children.length;s++)r.count++,this.count_r(r,a.children[s]);return r.count}}])})(Lt.API),(function(t){var e=[192,193,194,195,196,197,198,199];t.processJPEG=function(n,r,a,s,l,u){var c,h=this.decode.DCT_DECODE,d=null;if(typeof n=="string"||this.__addimage__.isArrayBuffer(n)||this.__addimage__.isArrayBufferView(n)){switch(n=l||n,n=this.__addimage__.isArrayBuffer(n)?new Uint8Array(n):n,c=(function(g){for(var y,m=256*g.charCodeAt(4)+g.charCodeAt(5),x=g.length,E={width:0,height:0,numcomponents:1},A=4;A<x;A+=2){if(A+=m,e.indexOf(g.charCodeAt(A+1))!==-1){y=256*g.charCodeAt(A+5)+g.charCodeAt(A+6),E={width:256*g.charCodeAt(A+7)+g.charCodeAt(A+8),height:y,numcomponents:g.charCodeAt(A+9)};break}m=256*g.charCodeAt(A+2)+g.charCodeAt(A+3)}return E})(n=this.__addimage__.isArrayBufferView(n)?this.__addimage__.arrayBufferToBinaryString(n):n),c.numcomponents){case 1:u=this.color_spaces.DEVICE_GRAY;break;case 4:u=this.color_spaces.DEVICE_CMYK;break;case 3:u=this.color_spaces.DEVICE_RGB}d={data:n,width:c.width,height:c.height,colorSpace:u,bitsPerComponent:8,filter:h,index:r,alias:a}}return d}})(Lt.API),Lt.API.processPNG=function(t,e,n,r){if(this.__addimage__.isArrayBuffer(t)&&(t=new Uint8Array(t)),this.__addimage__.isArrayBufferView(t)){var a,s=NB(t,{checkCrc:!0}),l=s.width,u=s.height,c=s.channels,h=s.palette,d=s.depth;a=h&&c===1?(function($){for(var B=$.width,ne=$.height,I=$.data,z=$.palette,J=$.depth,ae=!1,me=[],Z=[],ce=void 0,oe=!1,ge=0,he=0;he<z.length;he++){var U=ro(z[he],4),j=U[0],Y=U[1],K=U[2],ie=U[3];me.push(j,Y,K),ie!=null&&(ie===0?(ge++,Z.length<1&&Z.push(he)):ie<255&&(oe=!0))}if(oe||ge>1){ae=!0,Z=void 0;var V=B*ne;ce=new Uint8Array(V);for(var se=new DataView(I.buffer),be=0;be<V;be++){var xe=B1(se,be,J),Oe=ro(z[xe],4)[3];ce[be]=Oe}}else ge===0&&(Z=void 0);return{colorSpace:"Indexed",colorsPerPixel:1,sMaskBitsPerComponent:ae?8:void 0,colorBytes:I,alphaBytes:ce,needSMask:ae,palette:me,mask:Z}})(s):c===2||c===4?(function($){for(var B=$.data,ne=$.width,I=$.height,z=$.channels,J=$.depth,ae=z===2?"DeviceGray":"DeviceRGB",me=z-1,Z=ne*I,ce=me,oe=Z*ce,ge=1*Z,he=Math.ceil(oe*J/8),U=Math.ceil(ge*J/8),j=new Uint8Array(he),Y=new Uint8Array(U),K=new DataView(B.buffer),ie=new DataView(j.buffer),V=new DataView(Y.buffer),se=!1,be=0;be<Z;be++){for(var xe=be*z,Oe=0;Oe<ce;Oe++)QS(ie,B1(K,xe+Oe,J),be*ce+Oe,J);var Me=B1(K,xe+ce,J);Me<(1<<J)-1&&(se=!0),QS(V,Me,1*be,J)}return{colorSpace:ae,colorsPerPixel:me,sMaskBitsPerComponent:se?J:void 0,colorBytes:j,alphaBytes:Y,needSMask:se}})(s):(function($){var B=$.data,ne=$.channels===1?"DeviceGray":"DeviceRGB";return{colorSpace:ne,colorsPerPixel:ne==="DeviceGray"?1:3,colorBytes:B instanceof Uint16Array?(function(I){for(var z=I.length,J=new Uint8Array(2*z),ae=new DataView(J.buffer,J.byteOffset,J.byteLength),me=0;me<z;me++)ae.setUint16(2*me,I[me],!1);return J})(B):B,needSMask:!1}})(s);var g,y,m,x=a,E=x.colorSpace,A=x.colorsPerPixel,N=x.sMaskBitsPerComponent,O=x.colorBytes,T=x.alphaBytes,D=x.needSMask,F=x.palette,Q=x.mask,P=null;return r!==Lt.API.image_compression.NONE&&typeof qv=="function"?(P=(function($){var B;switch($){case Lt.API.image_compression.FAST:B=11;break;case Lt.API.image_compression.MEDIUM:B=13;break;case Lt.API.image_compression.SLOW:B=14;break;default:B=12}return B})(r),g=this.decode.FLATE_DECODE,y="/Predictor ".concat(P," /Colors ").concat(A," /BitsPerComponent ").concat(d," /Columns ").concat(l),t=WS(O,Math.ceil(l*A*d/8),A,d,r),D&&(m=WS(T,Math.ceil(l*N/8),1,N,r))):(g=void 0,y=void 0,t=O,D&&(m=T)),(this.__addimage__.isArrayBuffer(t)||this.__addimage__.isArrayBufferView(t))&&(t=this.__addimage__.arrayBufferToBinaryString(t)),(m&&this.__addimage__.isArrayBuffer(m)||this.__addimage__.isArrayBufferView(m))&&(m=this.__addimage__.arrayBufferToBinaryString(m)),{alias:n,data:t,index:e,filter:g,decodeParameters:y,transparency:Q,palette:F,sMask:m,predictor:P,width:l,height:u,bitsPerComponent:d,sMaskBitsPerComponent:N,colorSpace:E}}},(function(t){t.processGIF89A=function(e,n,r,a){var s=new GB(e),l=s.width,u=s.height,c=[];s.decodeAndBlitFrameRGBA(0,c);var h={data:c,width:l,height:u},d=new $1(100).encode(h,100);return t.processJPEG.call(this,d,n,r,a)},t.processGIF87A=t.processGIF89A})(Lt.API),Qs.prototype.parseHeader=function(){if(this.fileSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.reserved=this.datav.getUint32(this.pos,!0),this.pos+=4,this.offset=this.datav.getUint32(this.pos,!0),this.pos+=4,this.headerSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.width=this.datav.getUint32(this.pos,!0),this.pos+=4,this.height=this.datav.getInt32(this.pos,!0),this.pos+=4,this.planes=this.datav.getUint16(this.pos,!0),this.pos+=2,this.bitPP=this.datav.getUint16(this.pos,!0),this.pos+=2,this.compress=this.datav.getUint32(this.pos,!0),this.pos+=4,this.rawSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.hr=this.datav.getUint32(this.pos,!0),this.pos+=4,this.vr=this.datav.getUint32(this.pos,!0),this.pos+=4,this.colors=this.datav.getUint32(this.pos,!0),this.pos+=4,this.importantColors=this.datav.getUint32(this.pos,!0),this.pos+=4,this.bitPP===16&&this.is_with_alpha&&(this.bitPP=15),this.bitPP<15){var t=this.colors===0?1<<this.bitPP:this.colors;this.palette=new Array(t);for(var e=0;e<t;e++){var n=this.datav.getUint8(this.pos++,!0),r=this.datav.getUint8(this.pos++,!0),a=this.datav.getUint8(this.pos++,!0),s=this.datav.getUint8(this.pos++,!0);this.palette[e]={red:a,green:r,blue:n,quad:s}}}this.height<0&&(this.height*=-1,this.bottom_up=!1)},Qs.prototype.parseBGR=function(){this.pos=this.offset;try{var t="bit"+this.bitPP,e=this.width*this.height*4;this.data=new Uint8Array(e),this[t]()}catch(n){hr.log("bit decode error:"+n)}},Qs.prototype.bit1=function(){var t,e=Math.ceil(this.width/8),n=e%4;for(t=this.height-1;t>=0;t--){for(var r=this.bottom_up?t:this.height-1-t,a=0;a<e;a++)for(var s=this.datav.getUint8(this.pos++,!0),l=r*this.width*4+8*a*4,u=0;u<8&&8*a+u<this.width;u++){var c=this.palette[s>>7-u&1];this.data[l+4*u]=c.blue,this.data[l+4*u+1]=c.green,this.data[l+4*u+2]=c.red,this.data[l+4*u+3]=255}n!==0&&(this.pos+=4-n)}},Qs.prototype.bit4=function(){for(var t=Math.ceil(this.width/2),e=t%4,n=this.height-1;n>=0;n--){for(var r=this.bottom_up?n:this.height-1-n,a=0;a<t;a++){var s=this.datav.getUint8(this.pos++,!0),l=r*this.width*4+2*a*4,u=s>>4,c=15&s,h=this.palette[u];if(this.data[l]=h.blue,this.data[l+1]=h.green,this.data[l+2]=h.red,this.data[l+3]=255,2*a+1>=this.width)break;h=this.palette[c],this.data[l+4]=h.blue,this.data[l+4+1]=h.green,this.data[l+4+2]=h.red,this.data[l+4+3]=255}e!==0&&(this.pos+=4-e)}},Qs.prototype.bit8=function(){for(var t=this.width%4,e=this.height-1;e>=0;e--){for(var n=this.bottom_up?e:this.height-1-e,r=0;r<this.width;r++){var a=this.datav.getUint8(this.pos++,!0),s=n*this.width*4+4*r;if(a<this.palette.length){var l=this.palette[a];this.data[s]=l.red,this.data[s+1]=l.green,this.data[s+2]=l.blue,this.data[s+3]=255}else this.data[s]=255,this.data[s+1]=255,this.data[s+2]=255,this.data[s+3]=255}t!==0&&(this.pos+=4-t)}},Qs.prototype.bit15=function(){for(var t=this.width%3,e=parseInt("11111",2),n=this.height-1;n>=0;n--){for(var r=this.bottom_up?n:this.height-1-n,a=0;a<this.width;a++){var s=this.datav.getUint16(this.pos,!0);this.pos+=2;var l=(s&e)/e*255|0,u=(s>>5&e)/e*255|0,c=(s>>10&e)/e*255|0,h=s>>15?255:0,d=r*this.width*4+4*a;this.data[d]=c,this.data[d+1]=u,this.data[d+2]=l,this.data[d+3]=h}this.pos+=t}},Qs.prototype.bit16=function(){for(var t=this.width%3,e=parseInt("11111",2),n=parseInt("111111",2),r=this.height-1;r>=0;r--){for(var a=this.bottom_up?r:this.height-1-r,s=0;s<this.width;s++){var l=this.datav.getUint16(this.pos,!0);this.pos+=2;var u=(l&e)/e*255|0,c=(l>>5&n)/n*255|0,h=(l>>11)/e*255|0,d=a*this.width*4+4*s;this.data[d]=h,this.data[d+1]=c,this.data[d+2]=u,this.data[d+3]=255}this.pos+=t}},Qs.prototype.bit24=function(){for(var t=this.height-1;t>=0;t--){for(var e=this.bottom_up?t:this.height-1-t,n=0;n<this.width;n++){var r=this.datav.getUint8(this.pos++,!0),a=this.datav.getUint8(this.pos++,!0),s=this.datav.getUint8(this.pos++,!0),l=e*this.width*4+4*n;this.data[l]=s,this.data[l+1]=a,this.data[l+2]=r,this.data[l+3]=255}this.pos+=this.width%4}},Qs.prototype.bit32=function(){for(var t=this.height-1;t>=0;t--)for(var e=this.bottom_up?t:this.height-1-t,n=0;n<this.width;n++){var r=this.datav.getUint8(this.pos++,!0),a=this.datav.getUint8(this.pos++,!0),s=this.datav.getUint8(this.pos++,!0),l=this.datav.getUint8(this.pos++,!0),u=e*this.width*4+4*n;this.data[u]=s,this.data[u+1]=a,this.data[u+2]=r,this.data[u+3]=l}},Qs.prototype.getData=function(){return this.data},(function(t){t.processBMP=function(e,n,r,a){var s=new Qs(e,!1),l=s.width,u=s.height,c={data:s.getData(),width:l,height:u},h=new $1(100).encode(c,100);return t.processJPEG.call(this,h,n,r,a)}})(Lt.API),t_.prototype.getData=function(){return this.data},(function(t){t.processWEBP=function(e,n,r,a){var s=new t_(e),l=s.width,u=s.height,c={data:s.getData(),width:l,height:u},h=new $1(100).encode(c,100);return t.processJPEG.call(this,h,n,r,a)}})(Lt.API),Lt.API.processRGBA=function(t,e,n){for(var r=t.data,a=r.length,s=new Uint8Array(a/4*3),l=new Uint8Array(a/4),u=0,c=0,h=0;h<a;h+=4){var d=r[h],g=r[h+1],y=r[h+2],m=r[h+3];s[u++]=d,s[u++]=g,s[u++]=y,l[c++]=m}var x=this.__addimage__.arrayBufferToBinaryString(s);return{alpha:this.__addimage__.arrayBufferToBinaryString(l),data:x,index:e,alias:n,colorSpace:"DeviceRGB",bitsPerComponent:8,width:t.width,height:t.height}},Lt.API.setLanguage=function(t){return this.internal.languageSettings===void 0&&(this.internal.languageSettings={},this.internal.languageSettings.isSubscribed=!1),{af:"Afrikaans",sq:"Albanian",ar:"Arabic (Standard)","ar-DZ":"Arabic (Algeria)","ar-BH":"Arabic (Bahrain)","ar-EG":"Arabic (Egypt)","ar-IQ":"Arabic (Iraq)","ar-JO":"Arabic (Jordan)","ar-KW":"Arabic (Kuwait)","ar-LB":"Arabic (Lebanon)","ar-LY":"Arabic (Libya)","ar-MA":"Arabic (Morocco)","ar-OM":"Arabic (Oman)","ar-QA":"Arabic (Qatar)","ar-SA":"Arabic (Saudi Arabia)","ar-SY":"Arabic (Syria)","ar-TN":"Arabic (Tunisia)","ar-AE":"Arabic (U.A.E.)","ar-YE":"Arabic (Yemen)",an:"Aragonese",hy:"Armenian",as:"Assamese",ast:"Asturian",az:"Azerbaijani",eu:"Basque",be:"Belarusian",bn:"Bengali",bs:"Bosnian",br:"Breton",bg:"Bulgarian",my:"Burmese",ca:"Catalan",ch:"Chamorro",ce:"Chechen",zh:"Chinese","zh-HK":"Chinese (Hong Kong)","zh-CN":"Chinese (PRC)","zh-SG":"Chinese (Singapore)","zh-TW":"Chinese (Taiwan)",cv:"Chuvash",co:"Corsican",cr:"Cree",hr:"Croatian",cs:"Czech",da:"Danish",nl:"Dutch (Standard)","nl-BE":"Dutch (Belgian)",en:"English","en-AU":"English (Australia)","en-BZ":"English (Belize)","en-CA":"English (Canada)","en-IE":"English (Ireland)","en-JM":"English (Jamaica)","en-NZ":"English (New Zealand)","en-PH":"English (Philippines)","en-ZA":"English (South Africa)","en-TT":"English (Trinidad & Tobago)","en-GB":"English (United Kingdom)","en-US":"English (United States)","en-ZW":"English (Zimbabwe)",eo:"Esperanto",et:"Estonian",fo:"Faeroese",fj:"Fijian",fi:"Finnish",fr:"French (Standard)","fr-BE":"French (Belgium)","fr-CA":"French (Canada)","fr-FR":"French (France)","fr-LU":"French (Luxembourg)","fr-MC":"French (Monaco)","fr-CH":"French (Switzerland)",fy:"Frisian",fur:"Friulian",gd:"Gaelic (Scots)","gd-IE":"Gaelic (Irish)",gl:"Galacian",ka:"Georgian",de:"German (Standard)","de-AT":"German (Austria)","de-DE":"German (Germany)","de-LI":"German (Liechtenstein)","de-LU":"German (Luxembourg)","de-CH":"German (Switzerland)",el:"Greek",gu:"Gujurati",ht:"Haitian",he:"Hebrew",hi:"Hindi",hu:"Hungarian",is:"Icelandic",id:"Indonesian",iu:"Inuktitut",ga:"Irish",it:"Italian (Standard)","it-CH":"Italian (Switzerland)",ja:"Japanese",kn:"Kannada",ks:"Kashmiri",kk:"Kazakh",km:"Khmer",ky:"Kirghiz",tlh:"Klingon",ko:"Korean","ko-KP":"Korean (North Korea)","ko-KR":"Korean (South Korea)",la:"Latin",lv:"Latvian",lt:"Lithuanian",lb:"Luxembourgish",mk:"North Macedonia",ms:"Malay",ml:"Malayalam",mt:"Maltese",mi:"Maori",mr:"Marathi",mo:"Moldavian",nv:"Navajo",ng:"Ndonga",ne:"Nepali",no:"Norwegian",nb:"Norwegian (Bokmal)",nn:"Norwegian (Nynorsk)",oc:"Occitan",or:"Oriya",om:"Oromo",fa:"Persian","fa-IR":"Persian/Iran",pl:"Polish",pt:"Portuguese","pt-BR":"Portuguese (Brazil)",pa:"Punjabi","pa-IN":"Punjabi (India)","pa-PK":"Punjabi (Pakistan)",qu:"Quechua",rm:"Rhaeto-Romanic",ro:"Romanian","ro-MO":"Romanian (Moldavia)",ru:"Russian","ru-MO":"Russian (Moldavia)",sz:"Sami (Lappish)",sg:"Sango",sa:"Sanskrit",sc:"Sardinian",sd:"Sindhi",si:"Singhalese",sr:"Serbian",sk:"Slovak",sl:"Slovenian",so:"Somani",sb:"Sorbian",es:"Spanish","es-AR":"Spanish (Argentina)","es-BO":"Spanish (Bolivia)","es-CL":"Spanish (Chile)","es-CO":"Spanish (Colombia)","es-CR":"Spanish (Costa Rica)","es-DO":"Spanish (Dominican Republic)","es-EC":"Spanish (Ecuador)","es-SV":"Spanish (El Salvador)","es-GT":"Spanish (Guatemala)","es-HN":"Spanish (Honduras)","es-MX":"Spanish (Mexico)","es-NI":"Spanish (Nicaragua)","es-PA":"Spanish (Panama)","es-PY":"Spanish (Paraguay)","es-PE":"Spanish (Peru)","es-PR":"Spanish (Puerto Rico)","es-ES":"Spanish (Spain)","es-UY":"Spanish (Uruguay)","es-VE":"Spanish (Venezuela)",sx:"Sutu",sw:"Swahili",sv:"Swedish","sv-FI":"Swedish (Finland)","sv-SV":"Swedish (Sweden)",ta:"Tamil",tt:"Tatar",te:"Teluga",th:"Thai",tig:"Tigre",ts:"Tsonga",tn:"Tswana",tr:"Turkish",tk:"Turkmen",uk:"Ukrainian",hsb:"Upper Sorbian",ur:"Urdu",ve:"Venda",vi:"Vietnamese",vo:"Volapuk",wa:"Walloon",cy:"Welsh",xh:"Xhosa",ji:"Yiddish",zu:"Zulu"}[t]!==void 0&&(this.internal.languageSettings.languageCode=t,this.internal.languageSettings.isSubscribed===!1&&(this.internal.events.subscribe("putCatalog",function(){this.internal.write("/Lang ("+this.internal.languageSettings.languageCode+")")}),this.internal.languageSettings.isSubscribed=!0)),this},hf=Lt.API,Gp=hf.getCharWidthsArray=function(t,e){var n,r,a=(e=e||{}).font||this.internal.getFont(),s=e.fontSize||this.internal.getFontSize(),l=e.charSpace||this.internal.getCharSpace(),u=e.widths?e.widths:a.metadata.Unicode.widths,c=u.fof?u.fof:1,h=e.kerning?e.kerning:a.metadata.Unicode.kerning,d=h.fof?h.fof:1,g=e.doKerning!==!1,y=0,m=t.length,x=0,E=u[0]||c,A=[];for(n=0;n<m;n++)r=t.charCodeAt(n),typeof a.metadata.widthOfString=="function"?A.push((a.metadata.widthOfGlyph(a.metadata.characterToGlyph(r))+l*(1e3/s)||0)/1e3):(y=g&&Rn(h[r])==="object"&&!isNaN(parseInt(h[r][x],10))?h[r][x]/d:0,A.push((u[r]||E)/c+y)),x=r;return A},VS=hf.getStringUnitWidth=function(t,e){var n=(e=e||{}).fontSize||this.internal.getFontSize(),r=e.font||this.internal.getFont(),a=e.charSpace||this.internal.getCharSpace();return hf.processArabic&&(t=hf.processArabic(t)),typeof r.metadata.widthOfString=="function"?r.metadata.widthOfString(t,n,a)/n:Gp.apply(this,arguments).reduce(function(s,l){return s+l},0)},YS=function(t,e,n,r){for(var a=[],s=0,l=t.length,u=0;s!==l&&u+e[s]<n;)u+=e[s],s++;a.push(t.slice(0,s));var c=s;for(u=0;s!==l;)u+e[s]>r&&(a.push(t.slice(c,s)),u=0,c=s),u+=e[s],s++;return c!==s&&a.push(t.slice(c,s)),a},GS=function(t,e,n){n||(n={});var r,a,s,l,u,c,h,d=[],g=[d],y=n.textIndent||0,m=0,x=0,E=t.split(" "),A=Gp.apply(this,[" ",n])[0];if(c=n.lineIndent===-1?E[0].length+2:n.lineIndent||0){var N=Array(c).join(" "),O=[];E.map(function(D){(D=D.split(/\s*\n/)).length>1?O=O.concat(D.map(function(F,Q){return(Q&&F.length?`
313
- `:"")+F})):O.push(D[0])}),E=O,c=VS.apply(this,[N,n])}for(s=0,l=E.length;s<l;s++){var T=0;if(r=E[s],c&&r[0]==`
314
- `&&(r=r.substr(1),T=1),y+m+(x=(a=Gp.apply(this,[r,n])).reduce(function(D,F){return D+F},0))>e||T){if(x>e){for(u=YS.apply(this,[r,a,e-(y+m),e]),d.push(u.shift()),d=[u.pop()];u.length;)g.push([u.shift()]);x=a.slice(r.length-(d[0]?d[0].length:0)).reduce(function(D,F){return D+F},0)}else d=[r];g.push(d),y=x+c,m=A}else d.push(r),y+=m+x,m=A}return h=c?function(D,F){return(F?N:"")+D.join(" ")}:function(D){return D.join(" ")},g.map(h)},hf.splitTextToSize=function(t,e,n){var r,a=(n=n||{}).fontSize||this.internal.getFontSize(),s=(function(d){if(d.widths&&d.kerning)return{widths:d.widths,kerning:d.kerning};var g=this.internal.getFont(d.fontName,d.fontStyle),y="Unicode";return g.metadata[y]?{widths:g.metadata[y].widths||{0:1},kerning:g.metadata[y].kerning||{}}:{font:g.metadata,fontSize:this.internal.getFontSize(),charSpace:this.internal.getCharSpace()}}).call(this,n);r=Array.isArray(t)?t:String(t).split(/\r?\n/);var l=1*this.internal.scaleFactor*e/a;s.textIndent=n.textIndent?1*n.textIndent*this.internal.scaleFactor/a:0,s.lineIndent=n.lineIndent;var u,c,h=[];for(u=0,c=r.length;u<c;u++)h=h.concat(GS.apply(this,[r[u],l,s]));return h},(function(t){t.__fontmetrics__=t.__fontmetrics__||{};for(var e="0123456789abcdef",n="klmnopqrstuvwxyz",r={},a={},s=0;s<16;s++)r[n[s]]=e[s],a[e[s]]=n[s];var l=function(y){return"0x"+parseInt(y,10).toString(16)},u=t.__fontmetrics__.compress=function(y){var m,x,E,A,N=["{"];for(var O in y){if(m=y[O],isNaN(parseInt(O,10))?x="'"+O+"'":(O=parseInt(O,10),x=(x=l(O).slice(2)).slice(0,-1)+a[x.slice(-1)]),typeof m=="number")m<0?(E=l(m).slice(3),A="-"):(E=l(m).slice(2),A=""),E=A+E.slice(0,-1)+a[E.slice(-1)];else{if(Rn(m)!=="object")throw new Error("Don't know what to do with value type "+Rn(m)+".");E=u(m)}N.push(x+E)}return N.push("}"),N.join("")},c=t.__fontmetrics__.uncompress=function(y){if(typeof y!="string")throw new Error("Invalid argument passed to uncompress.");for(var m,x,E,A,N={},O=1,T=N,D=[],F="",Q="",P=y.length-1,$=1;$<P;$+=1)(A=y[$])=="'"?m?(E=m.join(""),m=void 0):m=[]:m?m.push(A):A=="{"?(D.push([T,E]),T={},E=void 0):A=="}"?((x=D.pop())[0][x[1]]=T,E=void 0,T=x[0]):A=="-"?O=-1:E===void 0?r.hasOwnProperty(A)?(F+=r[A],E=parseInt(F,16)*O,O=1,F=""):F+=A:r.hasOwnProperty(A)?(Q+=r[A],T[E]=parseInt(Q,16)*O,O=1,E=void 0,Q=""):Q+=A;return N},h={codePages:["WinAnsiEncoding"],WinAnsiEncoding:c("{19m8n201n9q201o9r201s9l201t9m201u8m201w9n201x9o201y8o202k8q202l8r202m9p202q8p20aw8k203k8t203t8v203u9v2cq8s212m9t15m8w15n9w2dw9s16k8u16l9u17s9z17x8y17y9y}")},d={Unicode:{Courier:h,"Courier-Bold":h,"Courier-BoldOblique":h,"Courier-Oblique":h,Helvetica:h,"Helvetica-Bold":h,"Helvetica-BoldOblique":h,"Helvetica-Oblique":h,"Times-Roman":h,"Times-Bold":h,"Times-BoldItalic":h,"Times-Italic":h}},g={Unicode:{"Courier-Oblique":c("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-BoldItalic":c("{'widths'{k3o2q4ycx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2r202m2n2n3m2o3m2p5n202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5n4l4m4m4m4n4m4o4s4p4m4q4m4r4s4s4y4t2r4u3m4v4m4w3x4x5t4y4s4z4s5k3x5l4s5m4m5n3r5o3x5p4s5q4m5r5t5s4m5t3x5u3x5v2l5w1w5x2l5y3t5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q2l6r3m6s3r6t1w6u1w6v3m6w1w6x4y6y3r6z3m7k3m7l3m7m2r7n2r7o1w7p3r7q2w7r4m7s3m7t2w7u2r7v2n7w1q7x2n7y3t202l3mcl4mal2ram3man3mao3map3mar3mas2lat4uau1uav3maw3way4uaz2lbk2sbl3t'fof'6obo2lbp3tbq3mbr1tbs2lbu1ybv3mbz3mck4m202k3mcm4mcn4mco4mcp4mcq5ycr4mcs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz2w203k6o212m6o2dw2l2cq2l3t3m3u2l17s3x19m3m}'kerning'{cl{4qu5kt5qt5rs17ss5ts}201s{201ss}201t{cks4lscmscnscoscpscls2wu2yu201ts}201x{2wu2yu}2k{201ts}2w{4qx5kx5ou5qx5rs17su5tu}2x{17su5tu5ou}2y{4qx5kx5ou5qx5rs17ss5ts}'fof'-6ofn{17sw5tw5ou5qw5rs}7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qs}3v{17su5tu5os5qs}7p{17su5tu}ck{4qu5kt5qt5rs17ss5ts}4l{4qu5kt5qt5rs17ss5ts}cm{4qu5kt5qt5rs17ss5ts}cn{4qu5kt5qt5rs17ss5ts}co{4qu5kt5qt5rs17ss5ts}cp{4qu5kt5qt5rs17ss5ts}6l{4qu5ou5qw5rt17su5tu}5q{ckuclucmucnucoucpu4lu}5r{ckuclucmucnucoucpu4lu}7q{cksclscmscnscoscps4ls}6p{4qu5ou5qw5rt17sw5tw}ek{4qu5ou5qw5rt17su5tu}el{4qu5ou5qw5rt17su5tu}em{4qu5ou5qw5rt17su5tu}en{4qu5ou5qw5rt17su5tu}eo{4qu5ou5qw5rt17su5tu}ep{4qu5ou5qw5rt17su5tu}es{17ss5ts5qs4qu}et{4qu5ou5qw5rt17sw5tw}eu{4qu5ou5qw5rt17ss5ts}ev{17ss5ts5qs4qu}6z{17sw5tw5ou5qw5rs}fm{17sw5tw5ou5qw5rs}7n{201ts}fo{17sw5tw5ou5qw5rs}fp{17sw5tw5ou5qw5rs}fq{17sw5tw5ou5qw5rs}7r{cksclscmscnscoscps4ls}fs{17sw5tw5ou5qw5rs}ft{17su5tu}fu{17su5tu}fv{17su5tu}fw{17su5tu}fz{cksclscmscnscoscps4ls}}}"),"Helvetica-Bold":c("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"),Courier:c("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-BoldOblique":c("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Bold":c("{'widths'{k3q2q5ncx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2l202m2n2n3m2o3m2p6o202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5x4l4s4m4m4n4s4o4s4p4m4q3x4r4y4s4y4t2r4u3m4v4y4w4m4x5y4y4s4z4y5k3x5l4y5m4s5n3r5o4m5p4s5q4s5r6o5s4s5t4s5u4m5v2l5w1w5x2l5y3u5z3m6k2l6l3m6m3r6n2w6o3r6p2w6q2l6r3m6s3r6t1w6u2l6v3r6w1w6x5n6y3r6z3m7k3r7l3r7m2w7n2r7o2l7p3r7q3m7r4s7s3m7t3m7u2w7v2r7w1q7x2r7y3o202l3mcl4sal2lam3man3mao3map3mar3mas2lat4uau1yav3maw3tay4uaz2lbk2sbl3t'fof'6obo2lbp3rbr1tbs2lbu2lbv3mbz3mck4s202k3mcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3rek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3m3u2l17s4s19m3m}'kerning'{cl{4qt5ks5ot5qy5rw17sv5tv}201t{cks4lscmscnscoscpscls4wv}2k{201ts}2w{4qu5ku7mu5os5qx5ru17su5tu}2x{17su5tu5ou5qs}2y{4qv5kv7mu5ot5qz5ru17su5tu}'fof'-6o7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qu}3v{17su5tu5os5qu}fu{17su5tu5ou5qu}7p{17su5tu5ou5qu}ck{4qt5ks5ot5qy5rw17sv5tv}4l{4qt5ks5ot5qy5rw17sv5tv}cm{4qt5ks5ot5qy5rw17sv5tv}cn{4qt5ks5ot5qy5rw17sv5tv}co{4qt5ks5ot5qy5rw17sv5tv}cp{4qt5ks5ot5qy5rw17sv5tv}6l{17st5tt5ou5qu}17s{ckuclucmucnucoucpu4lu4wu}5o{ckuclucmucnucoucpu4lu4wu}5q{ckzclzcmzcnzcozcpz4lz4wu}5r{ckxclxcmxcnxcoxcpx4lx4wu}5t{ckuclucmucnucoucpu4lu4wu}7q{ckuclucmucnucoucpu4lu}6p{17sw5tw5ou5qu}ek{17st5tt5qu}el{17st5tt5ou5qu}em{17st5tt5qu}en{17st5tt5qu}eo{17st5tt5qu}ep{17st5tt5ou5qu}es{17ss5ts5qu}et{17sw5tw5ou5qu}eu{17sw5tw5ou5qu}ev{17ss5ts5qu}6z{17sw5tw5ou5qu5rs}fm{17sw5tw5ou5qu5rs}fn{17sw5tw5ou5qu5rs}fo{17sw5tw5ou5qu5rs}fp{17sw5tw5ou5qu5rs}fq{17sw5tw5ou5qu5rs}7r{cktcltcmtcntcotcpt4lt5os}fs{17sw5tw5ou5qu5rs}ft{17su5tu5ou5qu}7m{5os}fv{17su5tu5ou5qu}fw{17su5tu5ou5qu}fz{cksclscmscnscoscps4ls}}}"),Symbol:c("{'widths'{k3uaw4r19m3m2k1t2l2l202m2y2n3m2p5n202q6o3k3m2s2l2t2l2v3r2w1t3m3m2y1t2z1wbk2sbl3r'fof'6o3n3m3o3m3p3m3q3m3r3m3s3m3t3m3u1w3v1w3w3r3x3r3y3r3z2wbp3t3l3m5v2l5x2l5z3m2q4yfr3r7v3k7w1o7x3k}'kerning'{'fof'-6o}}"),Helvetica:c("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}"),"Helvetica-BoldOblique":c("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"),ZapfDingbats:c("{'widths'{k4u2k1w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-Bold":c("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Italic":c("{'widths'{k3n2q4ycx2l201n3m201o5t201s2l201t2l201u2l201w3r201x3r201y3r2k1t2l2l202m2n2n3m2o3m2p5n202q5t2r1p2s2l2t2l2u3m2v4n2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w4n3x4n3y4n3z3m4k5w4l3x4m3x4n4m4o4s4p3x4q3x4r4s4s4s4t2l4u2w4v4m4w3r4x5n4y4m4z4s5k3x5l4s5m3x5n3m5o3r5p4s5q3x5r5n5s3x5t3r5u3r5v2r5w1w5x2r5y2u5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q1w6r3m6s3m6t1w6u1w6v2w6w1w6x4s6y3m6z3m7k3m7l3m7m2r7n2r7o1w7p3m7q2w7r4m7s2w7t2w7u2r7v2s7w1v7x2s7y3q202l3mcl3xal2ram3man3mao3map3mar3mas2lat4wau1vav3maw4nay4waz2lbk2sbl4n'fof'6obo2lbp3mbq3obr1tbs2lbu1zbv3mbz3mck3x202k3mcm3xcn3xco3xcp3xcq5tcr4mcs3xct3xcu3xcv3xcw2l2m2ucy2lcz2ldl4mdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr4nfs3mft3mfu3mfv3mfw3mfz2w203k6o212m6m2dw2l2cq2l3t3m3u2l17s3r19m3m}'kerning'{cl{5kt4qw}201s{201sw}201t{201tw2wy2yy6q-t}201x{2wy2yy}2k{201tw}2w{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}2x{17ss5ts5os}2y{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}'fof'-6o6t{17ss5ts5qs}7t{5os}3v{5qs}7p{17su5tu5qs}ck{5kt4qw}4l{5kt4qw}cm{5kt4qw}cn{5kt4qw}co{5kt4qw}cp{5kt4qw}6l{4qs5ks5ou5qw5ru17su5tu}17s{2ks}5q{ckvclvcmvcnvcovcpv4lv}5r{ckuclucmucnucoucpu4lu}5t{2ks}6p{4qs5ks5ou5qw5ru17su5tu}ek{4qs5ks5ou5qw5ru17su5tu}el{4qs5ks5ou5qw5ru17su5tu}em{4qs5ks5ou5qw5ru17su5tu}en{4qs5ks5ou5qw5ru17su5tu}eo{4qs5ks5ou5qw5ru17su5tu}ep{4qs5ks5ou5qw5ru17su5tu}es{5ks5qs4qs}et{4qs5ks5ou5qw5ru17su5tu}eu{4qs5ks5qw5ru17su5tu}ev{5ks5qs4qs}ex{17ss5ts5qs}6z{4qv5ks5ou5qw5ru17su5tu}fm{4qv5ks5ou5qw5ru17su5tu}fn{4qv5ks5ou5qw5ru17su5tu}fo{4qv5ks5ou5qw5ru17su5tu}fp{4qv5ks5ou5qw5ru17su5tu}fq{4qv5ks5ou5qw5ru17su5tu}7r{5os}fs{4qv5ks5ou5qw5ru17su5tu}ft{17su5tu5qs}fu{17su5tu5qs}fv{17su5tu5qs}fw{17su5tu5qs}}}"),"Times-Roman":c("{'widths'{k3n2q4ycx2l201n3m201o6o201s2l201t2l201u2l201w2w201x2w201y2w2k1t2l2l202m2n2n3m2o3m2p5n202q6o2r1m2s2l2t2l2u3m2v3s2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v1w3w3s3x3s3y3s3z2w4k5w4l4s4m4m4n4m4o4s4p3x4q3r4r4s4s4s4t2l4u2r4v4s4w3x4x5t4y4s4z4s5k3r5l4s5m4m5n3r5o3x5p4s5q4s5r5y5s4s5t4s5u3x5v2l5w1w5x2l5y2z5z3m6k2l6l2w6m3m6n2w6o3m6p2w6q2l6r3m6s3m6t1w6u1w6v3m6w1w6x4y6y3m6z3m7k3m7l3m7m2l7n2r7o1w7p3m7q3m7r4s7s3m7t3m7u2w7v3k7w1o7x3k7y3q202l3mcl4sal2lam3man3mao3map3mar3mas2lat4wau1vav3maw3say4waz2lbk2sbl3s'fof'6obo2lbp3mbq2xbr1tbs2lbu1zbv3mbz2wck4s202k3mcm4scn4sco4scp4scq5tcr4mcs3xct3xcu3xcv3xcw2l2m2tcy2lcz2ldl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek2wel2wem2wen2weo2wep2weq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr3sfs3mft3mfu3mfv3mfw3mfz3m203k6o212m6m2dw2l2cq2l3t3m3u1w17s4s19m3m}'kerning'{cl{4qs5ku17sw5ou5qy5rw201ss5tw201ws}201s{201ss}201t{ckw4lwcmwcnwcowcpwclw4wu201ts}2k{201ts}2w{4qs5kw5os5qx5ru17sx5tx}2x{17sw5tw5ou5qu}2y{4qs5kw5os5qx5ru17sx5tx}'fof'-6o7t{ckuclucmucnucoucpu4lu5os5rs}3u{17su5tu5qs}3v{17su5tu5qs}7p{17sw5tw5qs}ck{4qs5ku17sw5ou5qy5rw201ss5tw201ws}4l{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cm{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cn{4qs5ku17sw5ou5qy5rw201ss5tw201ws}co{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cp{4qs5ku17sw5ou5qy5rw201ss5tw201ws}6l{17su5tu5os5qw5rs}17s{2ktclvcmvcnvcovcpv4lv4wuckv}5o{ckwclwcmwcnwcowcpw4lw4wu}5q{ckyclycmycnycoycpy4ly4wu5ms}5r{cktcltcmtcntcotcpt4lt4ws}5t{2ktclvcmvcnvcovcpv4lv4wuckv}7q{cksclscmscnscoscps4ls}6p{17su5tu5qw5rs}ek{5qs5rs}el{17su5tu5os5qw5rs}em{17su5tu5os5qs5rs}en{17su5qs5rs}eo{5qs5rs}ep{17su5tu5os5qw5rs}es{5qs}et{17su5tu5qw5rs}eu{17su5tu5qs5rs}ev{5qs}6z{17sv5tv5os5qx5rs}fm{5os5qt5rs}fn{17sv5tv5os5qx5rs}fo{17sv5tv5os5qx5rs}fp{5os5qt5rs}fq{5os5qt5rs}7r{ckuclucmucnucoucpu4lu5os}fs{17sv5tv5os5qx5rs}ft{17ss5ts5qs}fu{17sw5tw5qs}fv{17sw5tw5qs}fw{17ss5ts5qs}fz{ckuclucmucnucoucpu4lu5os5rs}}}"),"Helvetica-Oblique":c("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}")}};t.events.push(["addFont",function(y){var m=y.font,x=g.Unicode[m.postScriptName];x&&(m.metadata.Unicode={},m.metadata.Unicode.widths=x.widths,m.metadata.Unicode.kerning=x.kerning);var E=d.Unicode[m.postScriptName];E&&(m.metadata.Unicode.encoding=E,m.encoding=E.codePages[0])}])})(Lt.API),(function(t){var e=function(n){for(var r=n.length,a=new Uint8Array(r),s=0;s<r;s++)a[s]=n.charCodeAt(s);return a};t.API.events.push(["addFont",function(n){var r=void 0,a=n.font,s=n.instance;if(!a.isStandardFont){if(s===void 0)throw new Error("Font does not exist in vFS, import fonts or remove declaration doc.addFont('"+a.postScriptName+"').");if(typeof(r=s.existsFileInVFS(a.postScriptName)===!1?s.loadFile(a.postScriptName):s.getFileFromVFS(a.postScriptName))!="string")throw new Error("Font is not stored as string-data in vFS, import fonts or remove declaration doc.addFont('"+a.postScriptName+"').");(function(l,u){u=/^\x00\x01\x00\x00/.test(u)?e(u):e(am(u)),l.metadata=t.API.TTFFont.open(u),l.metadata.Unicode=l.metadata.Unicode||{encoding:{},kerning:{},widths:[]},l.metadata.glyIdsUsed=[0]})(a,r)}}])})(Lt),Lt.API.addSvgAsImage=function(t,e,n,r,a,s,l,u){if(isNaN(e)||isNaN(n))throw hr.error("jsPDF.addSvgAsImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");if(isNaN(r)||isNaN(a))throw hr.error("jsPDF.addSvgAsImage: Invalid measurements",arguments),new Error("Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage");var c=document.createElement("canvas");c.width=r,c.height=a;var h=c.getContext("2d");h.fillStyle="#fff",h.fillRect(0,0,c.width,c.height);var d={ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0},g=this;return(tn.canvg?Promise.resolve(tn.canvg):w1(()=>import("./index.es-BE6LkVtq.js"),[])).catch(function(y){return Promise.reject(new Error("Could not load canvg: "+y))}).then(function(y){return y.default?y.default:y}).then(function(y){return y.fromString(h,t,d)},function(){return Promise.reject(new Error("Could not load canvg."))}).then(function(y){return y.render(d)}).then(function(){g.addImage(c.toDataURL("image/jpeg",1),e,n,r,a,l,u)})},Lt.API.putTotalPages=function(t){var e,n=0;parseInt(this.internal.getFont().id.substr(1),10)<15?(e=new RegExp(t,"g"),n=this.internal.getNumberOfPages()):(e=new RegExp(this.pdfEscape16(t,this.internal.getFont()),"g"),n=this.pdfEscape16(this.internal.getNumberOfPages()+"",this.internal.getFont()));for(var r=1;r<=this.internal.getNumberOfPages();r++)for(var a=0;a<this.internal.pages[r].length;a++)this.internal.pages[r][a]=this.internal.pages[r][a].replace(e,n);return this},Lt.API.viewerPreferences=function(t,e){var n;t=t||{},e=e||!1;var r,a,s,l={HideToolbar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideMenubar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideWindowUI:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},FitWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},CenterWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},DisplayDocTitle:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.4},NonFullScreenPageMode:{defaultValue:"UseNone",value:"UseNone",type:"name",explicitSet:!1,valueSet:["UseNone","UseOutlines","UseThumbs","UseOC"],pdfVersion:1.3},Direction:{defaultValue:"L2R",value:"L2R",type:"name",explicitSet:!1,valueSet:["L2R","R2L"],pdfVersion:1.3},ViewArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},ViewClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintScaling:{defaultValue:"AppDefault",value:"AppDefault",type:"name",explicitSet:!1,valueSet:["AppDefault","None"],pdfVersion:1.6},Duplex:{defaultValue:"",value:"none",type:"name",explicitSet:!1,valueSet:["Simplex","DuplexFlipShortEdge","DuplexFlipLongEdge","none"],pdfVersion:1.7},PickTrayByPDFSize:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.7},PrintPageRange:{defaultValue:"",value:"",type:"array",explicitSet:!1,valueSet:null,pdfVersion:1.7},NumCopies:{defaultValue:1,value:1,type:"integer",explicitSet:!1,valueSet:null,pdfVersion:1.7}},u=Object.keys(l),c=[],h=0,d=0,g=0;function y(x,E){var A,N=!1;for(A=0;A<x.length;A+=1)x[A]===E&&(N=!0);return N}if(this.internal.viewerpreferences===void 0&&(this.internal.viewerpreferences={},this.internal.viewerpreferences.configuration=JSON.parse(JSON.stringify(l)),this.internal.viewerpreferences.isSubscribed=!1),n=this.internal.viewerpreferences.configuration,t==="reset"||e===!0){var m=u.length;for(g=0;g<m;g+=1)n[u[g]].value=n[u[g]].defaultValue,n[u[g]].explicitSet=!1}if(Rn(t)==="object"){for(a in t)if(s=t[a],y(u,a)&&s!==void 0){if(n[a].type==="boolean"&&typeof s=="boolean")n[a].value=s;else if(n[a].type==="name"&&y(n[a].valueSet,s))n[a].value=s;else if(n[a].type==="integer"&&Number.isInteger(s))n[a].value=s;else if(n[a].type==="array"){for(h=0;h<s.length;h+=1)if(r=!0,s[h].length===1&&typeof s[h][0]=="number")c.push(String(s[h]-1));else if(s[h].length>1){for(d=0;d<s[h].length;d+=1)typeof s[h][d]!="number"&&(r=!1);r===!0&&c.push([s[h][0]-1,s[h][1]-1].join(" "))}n[a].value="["+c.join(" ")+"]"}else n[a].value=n[a].defaultValue;n[a].explicitSet=!0}}return this.internal.viewerpreferences.isSubscribed===!1&&(this.internal.events.subscribe("putCatalog",function(){var x,E=[];for(x in n)n[x].explicitSet===!0&&(n[x].type==="name"?E.push("/"+x+" /"+n[x].value):E.push("/"+x+" "+n[x].value));E.length!==0&&this.internal.write(`/ViewerPreferences
315
- <<
316
- `+E.join(`
317
- `)+`
318
- >>`)}),this.internal.viewerpreferences.isSubscribed=!0),this.internal.viewerpreferences.configuration=n,this},(function(t){var e=function(){var r='<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><rdf:Description rdf:about="" xmlns:jspdf="'+this.internal.__metadata__.namespaceuri+'"><jspdf:metadata>',a=unescape(encodeURIComponent('<x:xmpmeta xmlns:x="adobe:ns:meta/">')),s=unescape(encodeURIComponent(r)),l=unescape(encodeURIComponent(this.internal.__metadata__.metadata)),u=unescape(encodeURIComponent("</jspdf:metadata></rdf:Description></rdf:RDF>")),c=unescape(encodeURIComponent("</x:xmpmeta>")),h=s.length+l.length+u.length+a.length+c.length;this.internal.__metadata__.metadata_object_number=this.internal.newObject(),this.internal.write("<< /Type /Metadata /Subtype /XML /Length "+h+" >>"),this.internal.write("stream"),this.internal.write(a+s+l+u+c),this.internal.write("endstream"),this.internal.write("endobj")},n=function(){this.internal.__metadata__.metadata_object_number&&this.internal.write("/Metadata "+this.internal.__metadata__.metadata_object_number+" 0 R")};t.addMetadata=function(r,a){return this.internal.__metadata__===void 0&&(this.internal.__metadata__={metadata:r,namespaceuri:a||"http://jspdf.default.namespaceuri/"},this.internal.events.subscribe("putCatalog",n),this.internal.events.subscribe("postPutResources",e)),this}})(Lt.API),(function(t){var e=t.API,n=e.pdfEscape16=function(s,l){for(var u,c=l.metadata.Unicode.widths,h=["","0","00","000","0000"],d=[""],g=0,y=s.length;g<y;++g){if(u=l.metadata.characterToGlyph(s.charCodeAt(g)),l.metadata.glyIdsUsed.push(u),l.metadata.toUnicode[u]=s.charCodeAt(g),c.indexOf(u)==-1&&(c.push(u),c.push([parseInt(l.metadata.widthOfGlyph(u),10)])),u=="0")return d.join("");u=u.toString(16),d.push(h[4-u.length],u)}return d.join("")},r=function(s){var l,u,c,h,d,g,y;for(d=`/CIDInit /ProcSet findresource begin
319
- 12 dict begin
320
- begincmap
321
- /CIDSystemInfo <<
322
- /Registry (Adobe)
323
- /Ordering (UCS)
324
- /Supplement 0
325
- >> def
326
- /CMapName /Adobe-Identity-UCS def
327
- /CMapType 2 def
328
- 1 begincodespacerange
329
- <0000><ffff>
330
- endcodespacerange`,c=[],g=0,y=(u=Object.keys(s).sort(function(m,x){return m-x})).length;g<y;g++)l=u[g],c.length>=100&&(d+=`
331
- `+c.length+` beginbfchar
332
- `+c.join(`
333
- `)+`
334
- endbfchar`,c=[]),s[l]!==void 0&&s[l]!==null&&typeof s[l].toString=="function"&&(h=("0000"+s[l].toString(16)).slice(-4),l=("0000"+(+l).toString(16)).slice(-4),c.push("<"+l+"><"+h+">"));return c.length&&(d+=`
335
- `+c.length+` beginbfchar
336
- `+c.join(`
337
- `)+`
338
- endbfchar
339
- `),d+`endcmap
340
- CMapName currentdict /CMap defineresource pop
341
- end
342
- end`};e.events.push(["putFont",function(s){(function(l){var u=l.font,c=l.out,h=l.newObject,d=l.putStream;if(u.metadata instanceof t.API.TTFFont&&u.encoding==="Identity-H"){for(var g=u.metadata.Unicode.widths,y=u.metadata.subset.encode(u.metadata.glyIdsUsed,1),m="",x=0;x<y.length;x++)m+=String.fromCharCode(y[x]);var E=h();d({data:m,addLength1:!0,objectId:E}),c("endobj");var A=h();d({data:r(u.metadata.toUnicode),addLength1:!0,objectId:A}),c("endobj");var N=h();c("<<"),c("/Type /FontDescriptor"),c("/FontName /"+yf(u.fontName)),c("/FontFile2 "+E+" 0 R"),c("/FontBBox "+t.API.PDFObject.convert(u.metadata.bbox)),c("/Flags "+u.metadata.flags),c("/StemV "+u.metadata.stemV),c("/ItalicAngle "+u.metadata.italicAngle),c("/Ascent "+u.metadata.ascender),c("/Descent "+u.metadata.decender),c("/CapHeight "+u.metadata.capHeight),c(">>"),c("endobj");var O=h();c("<<"),c("/Type /Font"),c("/BaseFont /"+yf(u.fontName)),c("/FontDescriptor "+N+" 0 R"),c("/W "+t.API.PDFObject.convert(g)),c("/CIDToGIDMap /Identity"),c("/DW 1000"),c("/Subtype /CIDFontType2"),c("/CIDSystemInfo"),c("<<"),c("/Supplement 0"),c("/Registry (Adobe)"),c("/Ordering ("+u.encoding+")"),c(">>"),c(">>"),c("endobj"),u.objectNumber=h(),c("<<"),c("/Type /Font"),c("/Subtype /Type0"),c("/ToUnicode "+A+" 0 R"),c("/BaseFont /"+yf(u.fontName)),c("/Encoding /"+u.encoding),c("/DescendantFonts ["+O+" 0 R]"),c(">>"),c("endobj"),u.isAlreadyPutted=!0}})(s)}]),e.events.push(["putFont",function(s){(function(l){var u=l.font,c=l.out,h=l.newObject,d=l.putStream;if(u.metadata instanceof t.API.TTFFont&&u.encoding==="WinAnsiEncoding"){for(var g=u.metadata.rawData,y="",m=0;m<g.length;m++)y+=String.fromCharCode(g[m]);var x=h();d({data:y,addLength1:!0,objectId:x}),c("endobj");var E=h();d({data:r(u.metadata.toUnicode),addLength1:!0,objectId:E}),c("endobj");var A=h();c("<<"),c("/Descent "+u.metadata.decender),c("/CapHeight "+u.metadata.capHeight),c("/StemV "+u.metadata.stemV),c("/Type /FontDescriptor"),c("/FontFile2 "+x+" 0 R"),c("/Flags 96"),c("/FontBBox "+t.API.PDFObject.convert(u.metadata.bbox)),c("/FontName /"+yf(u.fontName)),c("/ItalicAngle "+u.metadata.italicAngle),c("/Ascent "+u.metadata.ascender),c(">>"),c("endobj"),u.objectNumber=h();for(var N=0;N<u.metadata.hmtx.widths.length;N++)u.metadata.hmtx.widths[N]=parseInt(u.metadata.hmtx.widths[N]*(1e3/u.metadata.head.unitsPerEm));c("<</Subtype/TrueType/Type/Font/ToUnicode "+E+" 0 R/BaseFont/"+yf(u.fontName)+"/FontDescriptor "+A+" 0 R/Encoding/"+u.encoding+" /FirstChar 29 /LastChar 255 /Widths "+t.API.PDFObject.convert(u.metadata.hmtx.widths)+">>"),c("endobj"),u.isAlreadyPutted=!0}})(s)}]);var a=function(s){var l,u=s.text||"",c=s.x,h=s.y,d=s.options||{},g=s.mutex||{},y=g.pdfEscape,m=g.activeFontKey,x=g.fonts,E=m,A="",N=0,O="",T=x[E].encoding;if(x[E].encoding!=="Identity-H")return{text:u,x:c,y:h,options:d,mutex:g};for(O=u,E=m,Array.isArray(u)&&(O=u[0]),N=0;N<O.length;N+=1)x[E].metadata.hasOwnProperty("cmap")&&(l=x[E].metadata.cmap.unicode.codeMap[O[N].charCodeAt(0)]),l||O[N].charCodeAt(0)<256&&x[E].metadata.hasOwnProperty("Unicode")?A+=O[N]:A+="";var D="";return parseInt(E.slice(1))<14||T==="WinAnsiEncoding"?D=y(A,E).split("").map(function(F){return F.charCodeAt(0).toString(16)}).join(""):T==="Identity-H"&&(D=n(A,x[E])),g.isHex=!0,{text:D,x:c,y:h,options:d,mutex:g}};e.events.push(["postProcessText",function(s){var l=s.text||"",u=[],c={text:l,x:s.x,y:s.y,options:s.options,mutex:s.mutex};if(Array.isArray(l)){var h=0;for(h=0;h<l.length;h+=1)Array.isArray(l[h])&&l[h].length===3?u.push([a(Object.assign({},c,{text:l[h][0]})).text,l[h][1],l[h][2]]):u.push(a(Object.assign({},c,{text:l[h]})).text);s.text=u}else s.text=a(Object.assign({},c,{text:l})).text}])})(Lt),(function(t){var e=function(){return this.internal.vFS===void 0&&(this.internal.vFS={}),!0};t.existsFileInVFS=function(n){return e.call(this),this.internal.vFS[n]!==void 0},t.addFileToVFS=function(n,r){return e.call(this),this.internal.vFS[n]=r,this},t.getFileFromVFS=function(n){return e.call(this),this.internal.vFS[n]!==void 0?this.internal.vFS[n]:null}})(Lt.API),(function(t){t.__bidiEngine__=t.prototype.__bidiEngine__=function(r){var a,s,l,u,c,h,d,g=e,y=[[0,3,0,1,0,0,0],[0,3,0,1,2,2,0],[0,3,0,17,2,0,1],[0,3,5,5,4,1,0],[0,3,21,21,4,0,1],[0,3,5,5,4,2,0]],m=[[2,0,1,1,0,1,0],[2,0,1,1,0,2,0],[2,0,2,1,3,2,0],[2,0,2,33,3,1,1]],x={L:0,R:1,EN:2,AN:3,N:4,B:5,S:6},E={0:0,5:1,6:2,7:3,32:4,251:5,254:6,255:7},A=["(",")","(","<",">","<","[","]","[","{","}","{","«","»","«","‹","›","‹","⁅","⁆","⁅","⁽","⁾","⁽","₍","₎","₍","≤","≥","≤","〈","〉","〈","﹙","﹚","﹙","﹛","﹜","﹛","﹝","﹞","﹝","﹤","﹥","﹤"],N=new RegExp(/^([1-4|9]|1[0-9]|2[0-9]|3[0168]|4[04589]|5[012]|7[78]|159|16[0-9]|17[0-2]|21[569]|22[03489]|250)$/),O=!1,T=0;this.__bidiEngine__={};var D=function(I){var z=I.charCodeAt(),J=z>>8,ae=E[J];return ae!==void 0?g[256*ae+(255&z)]:J===252||J===253?"AL":N.test(J)?"L":J===8?"R":"N"},F=function(I){for(var z,J=0;J<I.length;J++){if((z=D(I.charAt(J)))==="L")return!1;if(z==="R")return!0}return!1},Q=function(I,z,J,ae){var me,Z,ce,oe,ge=z[ae];switch(ge){case"L":case"R":case"LRE":case"RLE":case"LRO":case"RLO":case"PDF":O=!1;break;case"N":case"AN":break;case"EN":O&&(ge="AN");break;case"AL":O=!0,ge="R";break;case"WS":case"BN":ge="N";break;case"CS":ae<1||ae+1>=z.length||(me=J[ae-1])!=="EN"&&me!=="AN"||(Z=z[ae+1])!=="EN"&&Z!=="AN"?ge="N":O&&(Z="AN"),ge=Z===me?Z:"N";break;case"ES":ge=(me=ae>0?J[ae-1]:"B")==="EN"&&ae+1<z.length&&z[ae+1]==="EN"?"EN":"N";break;case"ET":if(ae>0&&J[ae-1]==="EN"){ge="EN";break}if(O){ge="N";break}for(ce=ae+1,oe=z.length;ce<oe&&z[ce]==="ET";)ce++;ge=ce<oe&&z[ce]==="EN"?"EN":"N";break;case"NSM":if(l&&!u){for(oe=z.length,ce=ae+1;ce<oe&&z[ce]==="NSM";)ce++;if(ce<oe){var he=I[ae],U=he>=1425&&he<=2303||he===64286;if(me=z[ce],U&&(me==="R"||me==="AL")){ge="R";break}}}ge=ae<1||(me=z[ae-1])==="B"?"N":J[ae-1];break;case"B":O=!1,a=!0,ge=T;break;case"S":s=!0,ge="N"}return ge},P=function(I,z,J){var ae=I.split("");return J&&$(ae,J,{hiLevel:T}),ae.reverse(),z&&z.reverse(),ae.join("")},$=function(I,z,J){var ae,me,Z,ce,oe,ge=-1,he=I.length,U=0,j=[],Y=T?m:y,K=[];for(O=!1,a=!1,s=!1,me=0;me<he;me++)K[me]=D(I[me]);for(Z=0;Z<he;Z++){if(oe=U,j[Z]=Q(I,K,j,Z),ae=240&(U=Y[oe][x[j[Z]]]),U&=15,z[Z]=ce=Y[U][5],ae>0)if(ae===16){for(me=ge;me<Z;me++)z[me]=1;ge=-1}else ge=-1;if(Y[U][6])ge===-1&&(ge=Z);else if(ge>-1){for(me=ge;me<Z;me++)z[me]=ce;ge=-1}K[Z]==="B"&&(z[Z]=0),J.hiLevel|=ce}s&&(function(ie,V,se){for(var be=0;be<se;be++)if(ie[be]==="S"){V[be]=T;for(var xe=be-1;xe>=0&&ie[xe]==="WS";xe--)V[xe]=T}})(K,z,he)},B=function(I,z,J,ae,me){if(!(me.hiLevel<I)){if(I===1&&T===1&&!a)return z.reverse(),void(J&&J.reverse());for(var Z,ce,oe,ge,he=z.length,U=0;U<he;){if(ae[U]>=I){for(oe=U+1;oe<he&&ae[oe]>=I;)oe++;for(ge=U,ce=oe-1;ge<ce;ge++,ce--)Z=z[ge],z[ge]=z[ce],z[ce]=Z,J&&(Z=J[ge],J[ge]=J[ce],J[ce]=Z);U=oe}U++}}},ne=function(I,z,J){var ae=I.split(""),me={hiLevel:T};return J||(J=[]),$(ae,J,me),(function(Z,ce,oe){if(oe.hiLevel!==0&&d)for(var ge,he=0;he<Z.length;he++)ce[he]===1&&(ge=A.indexOf(Z[he]))>=0&&(Z[he]=A[ge+1])})(ae,J,me),B(2,ae,z,J,me),B(1,ae,z,J,me),ae.join("")};return this.__bidiEngine__.doBidiReorder=function(I,z,J){if((function(me,Z){if(Z)for(var ce=0;ce<me.length;ce++)Z[ce]=ce;u===void 0&&(u=F(me)),h===void 0&&(h=F(me))})(I,z),l||!c||h)if(l&&c&&u^h)T=u?1:0,I=P(I,z,J);else if(!l&&c&&h)T=u?1:0,I=ne(I,z,J),I=P(I,z);else if(!l||u||c||h){if(l&&!c&&u^h)I=P(I,z),u?(T=0,I=ne(I,z,J)):(T=1,I=ne(I,z,J),I=P(I,z));else if(l&&u&&!c&&h)T=1,I=ne(I,z,J),I=P(I,z);else if(!l&&!c&&u^h){var ae=d;u?(T=1,I=ne(I,z,J),T=0,d=!1,I=ne(I,z,J),d=ae):(T=0,I=ne(I,z,J),I=P(I,z),T=1,d=!1,I=ne(I,z,J),d=ae,I=P(I,z))}}else T=0,I=ne(I,z,J);else T=u?1:0,I=ne(I,z,J);return I},this.__bidiEngine__.setOptions=function(I){I&&(l=I.isInputVisual,c=I.isOutputVisual,u=I.isInputRtl,h=I.isOutputRtl,d=I.isSymmetricSwapping)},this.__bidiEngine__.setOptions(r),this.__bidiEngine__};var e=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","N","N","ET","ET","ET","N","N","N","N","N","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","N","ET","ET","ET","ET","N","N","N","N","L","N","N","BN","N","N","ET","ET","EN","EN","N","L","N","N","N","EN","L","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","N","N","N","N","N","ET","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","R","NSM","R","NSM","NSM","R","NSM","NSM","R","NSM","N","N","N","N","N","N","N","N","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","N","N","N","N","N","R","R","R","R","R","N","N","N","N","N","N","N","N","N","N","N","AN","AN","AN","AN","AN","AN","N","N","AL","ET","ET","AL","CS","AL","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","AN","AN","AN","AN","AN","AN","AN","AN","AN","ET","AN","AN","AL","AL","AL","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","N","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","NSM","NSM","N","NSM","NSM","NSM","NSM","AL","AL","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","AL","AL","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AL","N","N","N","N","N","N","N","N","N","N","N","N","N","N","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","R","R","N","N","N","N","R","N","N","N","N","N","WS","WS","WS","WS","WS","WS","WS","WS","WS","WS","WS","BN","BN","BN","L","R","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","WS","B","LRE","RLE","PDF","LRO","RLO","CS","ET","ET","ET","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","CS","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","WS","BN","BN","BN","BN","BN","N","LRI","RLI","FSI","PDI","BN","BN","BN","BN","BN","BN","EN","L","N","N","EN","EN","EN","EN","EN","EN","ES","ES","N","N","N","L","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","ES","ES","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","L","L","N","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","N","N","N","N","N","R","NSM","R","R","R","R","R","R","R","R","R","R","ES","R","R","R","R","R","R","R","R","R","R","R","R","R","N","R","R","R","R","R","N","R","N","R","R","N","R","R","N","R","R","R","R","R","R","R","R","R","R","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","CS","N","CS","N","N","CS","N","N","N","N","N","N","N","N","N","ET","N","N","ES","ES","N","N","N","N","N","ET","ET","N","N","N","N","N","AL","AL","AL","AL","AL","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","N","BN","N","N","N","ET","ET","ET","N","N","N","N","N","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","L","L","L","L","L","L","N","N","L","L","L","L","L","L","N","N","L","L","L","L","L","L","N","N","L","L","L","N","N","N","ET","ET","N","N","N","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N"],n=new t.__bidiEngine__({isInputVisual:!0});t.API.events.push(["postProcessText",function(r){var a=r.text;r.x,r.y;var s=r.options||{};r.mutex,s.lang;var l=[];if(s.isInputVisual=typeof s.isInputVisual!="boolean"||s.isInputVisual,n.setOptions(s),Object.prototype.toString.call(a)==="[object Array]"){var u=0;for(l=[],u=0;u<a.length;u+=1)Object.prototype.toString.call(a[u])==="[object Array]"?l.push([n.doBidiReorder(a[u][0]),a[u][1],a[u][2]]):l.push([n.doBidiReorder(a[u])]);r.text=l}else r.text=n.doBidiReorder(a);n.setOptions({isInputVisual:!0})}])})(Lt),Lt.API.TTFFont=(function(){function t(e){var n;if(this.rawData=e,n=this.contents=new pu(e),this.contents.pos=4,n.readString(4)==="ttcf")throw new Error("TTCF not supported.");n.pos=0,this.parse(),this.subset=new l$(this),this.registerTTF()}return t.open=function(e){return new t(e)},t.prototype.parse=function(){return this.directory=new WB(this.contents),this.head=new JB(this),this.name=new t$(this),this.cmap=new $6(this),this.toUnicode={},this.hhea=new XB(this),this.maxp=new n$(this),this.hmtx=new r$(this),this.post=new QB(this),this.os2=new ZB(this),this.loca=new o$(this),this.glyf=new a$(this),this.ascender=this.os2.exists&&this.os2.ascender||this.hhea.ascender,this.decender=this.os2.exists&&this.os2.decender||this.hhea.decender,this.lineGap=this.os2.exists&&this.os2.lineGap||this.hhea.lineGap,this.bbox=[this.head.xMin,this.head.yMin,this.head.xMax,this.head.yMax]},t.prototype.registerTTF=function(){var e,n,r,a,s;if(this.scaleFactor=1e3/this.head.unitsPerEm,this.bbox=(function(){var l,u,c,h;for(h=[],l=0,u=(c=this.bbox).length;l<u;l++)e=c[l],h.push(Math.round(e*this.scaleFactor));return h}).call(this),this.stemV=0,this.post.exists?(r=255&(a=this.post.italic_angle),32768&(n=a>>16)&&(n=-(1+(65535^n))),this.italicAngle=+(n+"."+r)):this.italicAngle=0,this.ascender=Math.round(this.ascender*this.scaleFactor),this.decender=Math.round(this.decender*this.scaleFactor),this.lineGap=Math.round(this.lineGap*this.scaleFactor),this.capHeight=this.os2.exists&&this.os2.capHeight||this.ascender,this.xHeight=this.os2.exists&&this.os2.xHeight||0,this.familyClass=(this.os2.exists&&this.os2.familyClass||0)>>8,this.isSerif=(s=this.familyClass)===1||s===2||s===3||s===4||s===5||s===7,this.isScript=this.familyClass===10,this.flags=0,this.post.isFixedPitch&&(this.flags|=1),this.isSerif&&(this.flags|=2),this.isScript&&(this.flags|=8),this.italicAngle!==0&&(this.flags|=64),this.flags|=32,!this.cmap.unicode)throw new Error("No unicode cmap for font")},t.prototype.characterToGlyph=function(e){var n;return((n=this.cmap.unicode)!=null?n.codeMap[e]:void 0)||0},t.prototype.widthOfGlyph=function(e){var n;return n=1e3/this.head.unitsPerEm,this.hmtx.forGlyph(e).advance*n},t.prototype.widthOfString=function(e,n,r){var a,s,l,u;for(l=0,s=0,u=(e=""+e).length;0<=u?s<u:s>u;s=0<=u?++s:--s)a=e.charCodeAt(s),l+=this.widthOfGlyph(this.characterToGlyph(a))+r*(1e3/n)||0;return l*(n/1e3)},t.prototype.lineHeight=function(e,n){var r;return n==null&&(n=!1),r=n?this.lineGap:0,(this.ascender+r-this.decender)/1e3*e},t})();var oo,pu=(function(){function t(e){this.data=e??[],this.pos=0,this.length=this.data.length}return t.prototype.readByte=function(){return this.data[this.pos++]},t.prototype.writeByte=function(e){return this.data[this.pos++]=e},t.prototype.readUInt32=function(){return 16777216*this.readByte()+(this.readByte()<<16)+(this.readByte()<<8)+this.readByte()},t.prototype.writeUInt32=function(e){return this.writeByte(e>>>24&255),this.writeByte(e>>16&255),this.writeByte(e>>8&255),this.writeByte(255&e)},t.prototype.readInt32=function(){var e;return(e=this.readUInt32())>=2147483648?e-4294967296:e},t.prototype.writeInt32=function(e){return e<0&&(e+=4294967296),this.writeUInt32(e)},t.prototype.readUInt16=function(){return this.readByte()<<8|this.readByte()},t.prototype.writeUInt16=function(e){return this.writeByte(e>>8&255),this.writeByte(255&e)},t.prototype.readInt16=function(){var e;return(e=this.readUInt16())>=32768?e-65536:e},t.prototype.writeInt16=function(e){return e<0&&(e+=65536),this.writeUInt16(e)},t.prototype.readString=function(e){var n,r;for(r=[],n=0;0<=e?n<e:n>e;n=0<=e?++n:--n)r[n]=String.fromCharCode(this.readByte());return r.join("")},t.prototype.writeString=function(e){var n,r,a;for(a=[],n=0,r=e.length;0<=r?n<r:n>r;n=0<=r?++n:--n)a.push(this.writeByte(e.charCodeAt(n)));return a},t.prototype.readShort=function(){return this.readInt16()},t.prototype.writeShort=function(e){return this.writeInt16(e)},t.prototype.readLongLong=function(){var e,n,r,a,s,l,u,c;return e=this.readByte(),n=this.readByte(),r=this.readByte(),a=this.readByte(),s=this.readByte(),l=this.readByte(),u=this.readByte(),c=this.readByte(),128&e?-1*(72057594037927940*(255^e)+281474976710656*(255^n)+1099511627776*(255^r)+4294967296*(255^a)+16777216*(255^s)+65536*(255^l)+256*(255^u)+(255^c)+1):72057594037927940*e+281474976710656*n+1099511627776*r+4294967296*a+16777216*s+65536*l+256*u+c},t.prototype.writeLongLong=function(e){var n,r;return n=Math.floor(e/4294967296),r=4294967295&e,this.writeByte(n>>24&255),this.writeByte(n>>16&255),this.writeByte(n>>8&255),this.writeByte(255&n),this.writeByte(r>>24&255),this.writeByte(r>>16&255),this.writeByte(r>>8&255),this.writeByte(255&r)},t.prototype.readInt=function(){return this.readInt32()},t.prototype.writeInt=function(e){return this.writeInt32(e)},t.prototype.read=function(e){var n,r;for(n=[],r=0;0<=e?r<e:r>e;r=0<=e?++r:--r)n.push(this.readByte());return n},t.prototype.write=function(e){var n,r,a,s;for(s=[],r=0,a=e.length;r<a;r++)n=e[r],s.push(this.writeByte(n));return s},t})(),WB=(function(){var t;function e(n){var r,a,s;for(this.scalarType=n.readInt(),this.tableCount=n.readShort(),this.searchRange=n.readShort(),this.entrySelector=n.readShort(),this.rangeShift=n.readShort(),this.tables={},a=0,s=this.tableCount;0<=s?a<s:a>s;a=0<=s?++a:--a)r={tag:n.readString(4),checksum:n.readInt(),offset:n.readInt(),length:n.readInt()},this.tables[r.tag]=r}return e.prototype.encode=function(n){var r,a,s,l,u,c,h,d,g,y,m,x,E;for(E in m=Object.keys(n).length,c=Math.log(2),g=16*Math.floor(Math.log(m)/c),l=Math.floor(g/c),d=16*m-g,(a=new pu).writeInt(this.scalarType),a.writeShort(m),a.writeShort(g),a.writeShort(l),a.writeShort(d),s=16*m,h=a.pos+s,u=null,x=[],n)for(y=n[E],a.writeString(E),a.writeInt(t(y)),a.writeInt(h),a.writeInt(y.length),x=x.concat(y),E==="head"&&(u=h),h+=y.length;h%4;)x.push(0),h++;return a.write(x),r=2981146554-t(a.data),a.pos=u+8,a.writeUInt32(r),a.data},t=function(n){var r,a,s,l;for(n=z6.call(n);n.length%4;)n.push(0);for(s=new pu(n),a=0,r=0,l=n.length;r<l;r=r+=4)a+=s.readUInt32();return 4294967295&a},e})(),KB={}.hasOwnProperty,Po=function(t,e){for(var n in e)KB.call(e,n)&&(t[n]=e[n]);function r(){this.constructor=t}return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t};oo=(function(){function t(e){var n;this.file=e,n=this.file.directory.tables[this.tag],this.exists=!!n,n&&(this.offset=n.offset,this.length=n.length,this.parse(this.file.contents))}return t.prototype.parse=function(){},t.prototype.encode=function(){},t.prototype.raw=function(){return this.exists?(this.file.contents.pos=this.offset,this.file.contents.read(this.length)):null},t})();var JB=(function(){function t(){return t.__super__.constructor.apply(this,arguments)}return Po(t,oo),t.prototype.tag="head",t.prototype.parse=function(e){return e.pos=this.offset,this.version=e.readInt(),this.revision=e.readInt(),this.checkSumAdjustment=e.readInt(),this.magicNumber=e.readInt(),this.flags=e.readShort(),this.unitsPerEm=e.readShort(),this.created=e.readLongLong(),this.modified=e.readLongLong(),this.xMin=e.readShort(),this.yMin=e.readShort(),this.xMax=e.readShort(),this.yMax=e.readShort(),this.macStyle=e.readShort(),this.lowestRecPPEM=e.readShort(),this.fontDirectionHint=e.readShort(),this.indexToLocFormat=e.readShort(),this.glyphDataFormat=e.readShort()},t.prototype.encode=function(e){var n;return(n=new pu).writeInt(this.version),n.writeInt(this.revision),n.writeInt(this.checkSumAdjustment),n.writeInt(this.magicNumber),n.writeShort(this.flags),n.writeShort(this.unitsPerEm),n.writeLongLong(this.created),n.writeLongLong(this.modified),n.writeShort(this.xMin),n.writeShort(this.yMin),n.writeShort(this.xMax),n.writeShort(this.yMax),n.writeShort(this.macStyle),n.writeShort(this.lowestRecPPEM),n.writeShort(this.fontDirectionHint),n.writeShort(e),n.writeShort(this.glyphDataFormat),n.data},t})(),n_=(function(){function t(e,n){var r,a,s,l,u,c,h,d,g,y,m,x,E,A,N,O,T;switch(this.platformID=e.readUInt16(),this.encodingID=e.readShort(),this.offset=n+e.readInt(),g=e.pos,e.pos=this.offset,this.format=e.readUInt16(),this.length=e.readUInt16(),this.language=e.readUInt16(),this.isUnicode=this.platformID===3&&this.encodingID===1&&this.format===4||this.platformID===0&&this.format===4,this.codeMap={},this.format){case 0:for(c=0;c<256;++c)this.codeMap[c]=e.readByte();break;case 4:for(m=e.readUInt16(),y=m/2,e.pos+=6,s=(function(){var D,F;for(F=[],c=D=0;0<=y?D<y:D>y;c=0<=y?++D:--D)F.push(e.readUInt16());return F})(),e.pos+=2,E=(function(){var D,F;for(F=[],c=D=0;0<=y?D<y:D>y;c=0<=y?++D:--D)F.push(e.readUInt16());return F})(),h=(function(){var D,F;for(F=[],c=D=0;0<=y?D<y:D>y;c=0<=y?++D:--D)F.push(e.readUInt16());return F})(),d=(function(){var D,F;for(F=[],c=D=0;0<=y?D<y:D>y;c=0<=y?++D:--D)F.push(e.readUInt16());return F})(),a=(this.length-e.pos+this.offset)/2,u=(function(){var D,F;for(F=[],c=D=0;0<=a?D<a:D>a;c=0<=a?++D:--D)F.push(e.readUInt16());return F})(),c=N=0,T=s.length;N<T;c=++N)for(A=s[c],r=O=x=E[c];x<=A?O<=A:O>=A;r=x<=A?++O:--O)d[c]===0?l=r+h[c]:(l=u[d[c]/2+(r-x)-(y-c)]||0)!==0&&(l+=h[c]),this.codeMap[r]=65535&l}e.pos=g}return t.encode=function(e,n){var r,a,s,l,u,c,h,d,g,y,m,x,E,A,N,O,T,D,F,Q,P,$,B,ne,I,z,J,ae,me,Z,ce,oe,ge,he,U,j,Y,K,ie,V,se,be,xe,Oe,Me,Ue;switch(ae=new pu,l=Object.keys(e).sort(function(Be,Ke){return Be-Ke}),n){case"macroman":for(E=0,A=(function(){var Be=[];for(x=0;x<256;++x)Be.push(0);return Be})(),O={0:0},s={},me=0,ge=l.length;me<ge;me++)O[xe=e[a=l[me]]]==null&&(O[xe]=++E),s[a]={old:e[a],new:O[e[a]]},A[a]=O[e[a]];return ae.writeUInt16(1),ae.writeUInt16(0),ae.writeUInt32(12),ae.writeUInt16(0),ae.writeUInt16(262),ae.writeUInt16(0),ae.write(A),{charMap:s,subtable:ae.data,maxGlyphID:E+1};case"unicode":for(z=[],g=[],T=0,O={},r={},N=h=null,Z=0,he=l.length;Z<he;Z++)O[F=e[a=l[Z]]]==null&&(O[F]=++T),r[a]={old:F,new:O[F]},u=O[F]-a,N!=null&&u===h||(N&&g.push(N),z.push(a),h=u),N=a;for(N&&g.push(N),g.push(65535),z.push(65535),ne=2*(B=z.length),$=2*Math.pow(Math.log(B)/Math.LN2,2),y=Math.log($/2)/Math.LN2,P=2*B-$,c=[],Q=[],m=[],x=ce=0,U=z.length;ce<U;x=++ce){if(I=z[x],d=g[x],I===65535){c.push(0),Q.push(0);break}if(I-(J=r[I].new)>=32768)for(c.push(0),Q.push(2*(m.length+B-x)),a=oe=I;I<=d?oe<=d:oe>=d;a=I<=d?++oe:--oe)m.push(r[a].new);else c.push(J-I),Q.push(0)}for(ae.writeUInt16(3),ae.writeUInt16(1),ae.writeUInt32(12),ae.writeUInt16(4),ae.writeUInt16(16+8*B+2*m.length),ae.writeUInt16(0),ae.writeUInt16(ne),ae.writeUInt16($),ae.writeUInt16(y),ae.writeUInt16(P),se=0,j=g.length;se<j;se++)a=g[se],ae.writeUInt16(a);for(ae.writeUInt16(0),be=0,Y=z.length;be<Y;be++)a=z[be],ae.writeUInt16(a);for(Oe=0,K=c.length;Oe<K;Oe++)u=c[Oe],ae.writeUInt16(u);for(Me=0,ie=Q.length;Me<ie;Me++)D=Q[Me],ae.writeUInt16(D);for(Ue=0,V=m.length;Ue<V;Ue++)E=m[Ue],ae.writeUInt16(E);return{charMap:r,subtable:ae.data,maxGlyphID:T+1}}},t})(),$6=(function(){function t(){return t.__super__.constructor.apply(this,arguments)}return Po(t,oo),t.prototype.tag="cmap",t.prototype.parse=function(e){var n,r,a;for(e.pos=this.offset,this.version=e.readUInt16(),a=e.readUInt16(),this.tables=[],this.unicode=null,r=0;0<=a?r<a:r>a;r=0<=a?++r:--r)n=new n_(e,this.offset),this.tables.push(n),n.isUnicode&&this.unicode==null&&(this.unicode=n);return!0},t.encode=function(e,n){var r,a;return n==null&&(n="macroman"),r=n_.encode(e,n),(a=new pu).writeUInt16(0),a.writeUInt16(1),r.table=a.data.concat(r.subtable),r},t})(),XB=(function(){function t(){return t.__super__.constructor.apply(this,arguments)}return Po(t,oo),t.prototype.tag="hhea",t.prototype.parse=function(e){return e.pos=this.offset,this.version=e.readInt(),this.ascender=e.readShort(),this.decender=e.readShort(),this.lineGap=e.readShort(),this.advanceWidthMax=e.readShort(),this.minLeftSideBearing=e.readShort(),this.minRightSideBearing=e.readShort(),this.xMaxExtent=e.readShort(),this.caretSlopeRise=e.readShort(),this.caretSlopeRun=e.readShort(),this.caretOffset=e.readShort(),e.pos+=8,this.metricDataFormat=e.readShort(),this.numberOfMetrics=e.readUInt16()},t})(),ZB=(function(){function t(){return t.__super__.constructor.apply(this,arguments)}return Po(t,oo),t.prototype.tag="OS/2",t.prototype.parse=function(e){if(e.pos=this.offset,this.version=e.readUInt16(),this.averageCharWidth=e.readShort(),this.weightClass=e.readUInt16(),this.widthClass=e.readUInt16(),this.type=e.readShort(),this.ySubscriptXSize=e.readShort(),this.ySubscriptYSize=e.readShort(),this.ySubscriptXOffset=e.readShort(),this.ySubscriptYOffset=e.readShort(),this.ySuperscriptXSize=e.readShort(),this.ySuperscriptYSize=e.readShort(),this.ySuperscriptXOffset=e.readShort(),this.ySuperscriptYOffset=e.readShort(),this.yStrikeoutSize=e.readShort(),this.yStrikeoutPosition=e.readShort(),this.familyClass=e.readShort(),this.panose=(function(){var n,r;for(r=[],n=0;n<10;++n)r.push(e.readByte());return r})(),this.charRange=(function(){var n,r;for(r=[],n=0;n<4;++n)r.push(e.readInt());return r})(),this.vendorID=e.readString(4),this.selection=e.readShort(),this.firstCharIndex=e.readShort(),this.lastCharIndex=e.readShort(),this.version>0&&(this.ascent=e.readShort(),this.descent=e.readShort(),this.lineGap=e.readShort(),this.winAscent=e.readShort(),this.winDescent=e.readShort(),this.codePageRange=(function(){var n,r;for(r=[],n=0;n<2;n=++n)r.push(e.readInt());return r})(),this.version>1))return this.xHeight=e.readShort(),this.capHeight=e.readShort(),this.defaultChar=e.readShort(),this.breakChar=e.readShort(),this.maxContext=e.readShort()},t})(),QB=(function(){function t(){return t.__super__.constructor.apply(this,arguments)}return Po(t,oo),t.prototype.tag="post",t.prototype.parse=function(e){var n,r,a;switch(e.pos=this.offset,this.format=e.readInt(),this.italicAngle=e.readInt(),this.underlinePosition=e.readShort(),this.underlineThickness=e.readShort(),this.isFixedPitch=e.readInt(),this.minMemType42=e.readInt(),this.maxMemType42=e.readInt(),this.minMemType1=e.readInt(),this.maxMemType1=e.readInt(),this.format){case 65536:case 196608:break;case 131072:var s;for(r=e.readUInt16(),this.glyphNameIndex=[],s=0;0<=r?s<r:s>r;s=0<=r?++s:--s)this.glyphNameIndex.push(e.readUInt16());for(this.names=[],a=[];e.pos<this.offset+this.length;)n=e.readByte(),a.push(this.names.push(e.readString(n)));return a;case 151552:return r=e.readUInt16(),this.offsets=e.read(r);case 262144:return this.map=(function(){var l,u,c;for(c=[],s=l=0,u=this.file.maxp.numGlyphs;0<=u?l<u:l>u;s=0<=u?++l:--l)c.push(e.readUInt32());return c}).call(this)}},t})(),e$=function(t,e){this.raw=t,this.length=t.length,this.platformID=e.platformID,this.encodingID=e.encodingID,this.languageID=e.languageID},t$=(function(){function t(){return t.__super__.constructor.apply(this,arguments)}return Po(t,oo),t.prototype.tag="name",t.prototype.parse=function(e){var n,r,a,s,l,u,c,h,d,g,y;for(e.pos=this.offset,e.readShort(),n=e.readShort(),u=e.readShort(),r=[],s=0;0<=n?s<n:s>n;s=0<=n?++s:--s)r.push({platformID:e.readShort(),encodingID:e.readShort(),languageID:e.readShort(),nameID:e.readShort(),length:e.readShort(),offset:this.offset+u+e.readShort()});for(c={},s=d=0,g=r.length;d<g;s=++d)a=r[s],e.pos=a.offset,h=e.readString(a.length),l=new e$(h,a),c[y=a.nameID]==null&&(c[y]=[]),c[a.nameID].push(l);this.strings=c,this.copyright=c[0],this.fontFamily=c[1],this.fontSubfamily=c[2],this.uniqueSubfamily=c[3],this.fontName=c[4],this.version=c[5];try{this.postscriptName=c[6][0].raw.replace(/[\x00-\x19\x80-\xff]/g,"")}catch{this.postscriptName=c[4][0].raw.replace(/[\x00-\x19\x80-\xff]/g,"")}return this.trademark=c[7],this.manufacturer=c[8],this.designer=c[9],this.description=c[10],this.vendorUrl=c[11],this.designerUrl=c[12],this.license=c[13],this.licenseUrl=c[14],this.preferredFamily=c[15],this.preferredSubfamily=c[17],this.compatibleFull=c[18],this.sampleText=c[19]},t})(),n$=(function(){function t(){return t.__super__.constructor.apply(this,arguments)}return Po(t,oo),t.prototype.tag="maxp",t.prototype.parse=function(e){return e.pos=this.offset,this.version=e.readInt(),this.numGlyphs=e.readUInt16(),this.maxPoints=e.readUInt16(),this.maxContours=e.readUInt16(),this.maxCompositePoints=e.readUInt16(),this.maxComponentContours=e.readUInt16(),this.maxZones=e.readUInt16(),this.maxTwilightPoints=e.readUInt16(),this.maxStorage=e.readUInt16(),this.maxFunctionDefs=e.readUInt16(),this.maxInstructionDefs=e.readUInt16(),this.maxStackElements=e.readUInt16(),this.maxSizeOfInstructions=e.readUInt16(),this.maxComponentElements=e.readUInt16(),this.maxComponentDepth=e.readUInt16()},t})(),r$=(function(){function t(){return t.__super__.constructor.apply(this,arguments)}return Po(t,oo),t.prototype.tag="hmtx",t.prototype.parse=function(e){var n,r,a,s,l,u,c;for(e.pos=this.offset,this.metrics=[],n=0,u=this.file.hhea.numberOfMetrics;0<=u?n<u:n>u;n=0<=u?++n:--n)this.metrics.push({advance:e.readUInt16(),lsb:e.readInt16()});for(a=this.file.maxp.numGlyphs-this.file.hhea.numberOfMetrics,this.leftSideBearings=(function(){var h,d;for(d=[],n=h=0;0<=a?h<a:h>a;n=0<=a?++h:--h)d.push(e.readInt16());return d})(),this.widths=(function(){var h,d,g,y;for(y=[],h=0,d=(g=this.metrics).length;h<d;h++)s=g[h],y.push(s.advance);return y}).call(this),r=this.widths[this.widths.length-1],c=[],n=l=0;0<=a?l<a:l>a;n=0<=a?++l:--l)c.push(this.widths.push(r));return c},t.prototype.forGlyph=function(e){return e in this.metrics?this.metrics[e]:{advance:this.metrics[this.metrics.length-1].advance,lsb:this.leftSideBearings[e-this.metrics.length]}},t})(),z6=[].slice,a$=(function(){function t(){return t.__super__.constructor.apply(this,arguments)}return Po(t,oo),t.prototype.tag="glyf",t.prototype.parse=function(){return this.cache={}},t.prototype.glyphFor=function(e){var n,r,a,s,l,u,c,h,d,g;return e in this.cache?this.cache[e]:(s=this.file.loca,n=this.file.contents,r=s.indexOf(e),(a=s.lengthOf(e))===0?this.cache[e]=null:(n.pos=this.offset+r,l=(u=new pu(n.read(a))).readShort(),h=u.readShort(),g=u.readShort(),c=u.readShort(),d=u.readShort(),this.cache[e]=l===-1?new s$(u,h,g,c,d):new i$(u,l,h,g,c,d),this.cache[e]))},t.prototype.encode=function(e,n,r){var a,s,l,u,c;for(l=[],s=[],u=0,c=n.length;u<c;u++)a=e[n[u]],s.push(l.length),a&&(l=l.concat(a.encode(r)));return s.push(l.length),{table:l,offsets:s}},t})(),i$=(function(){function t(e,n,r,a,s,l){this.raw=e,this.numberOfContours=n,this.xMin=r,this.yMin=a,this.xMax=s,this.yMax=l,this.compound=!1}return t.prototype.encode=function(){return this.raw.data},t})(),s$=(function(){function t(e,n,r,a,s){var l,u;for(this.raw=e,this.xMin=n,this.yMin=r,this.xMax=a,this.yMax=s,this.compound=!0,this.glyphIDs=[],this.glyphOffsets=[],l=this.raw;u=l.readShort(),this.glyphOffsets.push(l.pos),this.glyphIDs.push(l.readUInt16()),32&u;)l.pos+=1&u?4:2,128&u?l.pos+=8:64&u?l.pos+=4:8&u&&(l.pos+=2)}return t.prototype.encode=function(){var e,n,r;for(n=new pu(z6.call(this.raw.data)),e=0,r=this.glyphIDs.length;e<r;++e)n.pos=this.glyphOffsets[e];return n.data},t})(),o$=(function(){function t(){return t.__super__.constructor.apply(this,arguments)}return Po(t,oo),t.prototype.tag="loca",t.prototype.parse=function(e){var n,r;return e.pos=this.offset,n=this.file.head.indexToLocFormat,this.offsets=n===0?(function(){var a,s;for(s=[],r=0,a=this.length;r<a;r+=2)s.push(2*e.readUInt16());return s}).call(this):(function(){var a,s;for(s=[],r=0,a=this.length;r<a;r+=4)s.push(e.readUInt32());return s}).call(this)},t.prototype.indexOf=function(e){return this.offsets[e]},t.prototype.lengthOf=function(e){return this.offsets[e+1]-this.offsets[e]},t.prototype.encode=function(e,n){for(var r=new Uint32Array(this.offsets.length),a=0,s=0,l=0;l<r.length;++l)if(r[l]=a,s<n.length&&n[s]==l){++s,r[l]=a;var u=this.offsets[l],c=this.offsets[l+1]-u;c>0&&(a+=c)}for(var h=new Array(4*r.length),d=0;d<r.length;++d)h[4*d+3]=255&r[d],h[4*d+2]=(65280&r[d])>>8,h[4*d+1]=(16711680&r[d])>>16,h[4*d]=(4278190080&r[d])>>24;return h},t})(),l$=(function(){function t(e){this.font=e,this.subset={},this.unicodes={},this.next=33}return t.prototype.generateCmap=function(){var e,n,r,a,s;for(n in a=this.font.cmap.tables[0].codeMap,e={},s=this.subset)r=s[n],e[n]=a[r];return e},t.prototype.glyphsFor=function(e){var n,r,a,s,l,u,c;for(a={},l=0,u=e.length;l<u;l++)a[s=e[l]]=this.font.glyf.glyphFor(s);for(s in n=[],a)(r=a[s])!=null&&r.compound&&n.push.apply(n,r.glyphIDs);if(n.length>0)for(s in c=this.glyphsFor(n))r=c[s],a[s]=r;return a},t.prototype.encode=function(e,n){var r,a,s,l,u,c,h,d,g,y,m,x,E,A,N;for(a in r=$6.encode(this.generateCmap(),"unicode"),l=this.glyphsFor(e),m={0:0},N=r.charMap)m[(c=N[a]).old]=c.new;for(x in y=r.maxGlyphID,l)x in m||(m[x]=y++);return d=(function(O){var T,D;for(T in D={},O)D[O[T]]=T;return D})(m),g=Object.keys(d).sort(function(O,T){return O-T}),E=(function(){var O,T,D;for(D=[],O=0,T=g.length;O<T;O++)u=g[O],D.push(d[u]);return D})(),s=this.font.glyf.encode(l,E,m),h=this.font.loca.encode(s.offsets,E),A={cmap:this.font.cmap.raw(),glyf:s.table,loca:h,hmtx:this.font.hmtx.raw(),hhea:this.font.hhea.raw(),maxp:this.font.maxp.raw(),post:this.font.post.raw(),name:this.font.name.raw(),head:this.font.head.encode(n)},this.font.os2.exists&&(A["OS/2"]=this.font.os2.raw()),this.font.directory.encode(A)},t})();Lt.API.PDFObject=(function(){var t;function e(){}return t=function(n,r){return(Array(r+1).join("0")+n).slice(-r)},e.convert=function(n){var r,a,s,l;if(Array.isArray(n))return"["+(function(){var u,c,h;for(h=[],u=0,c=n.length;u<c;u++)r=n[u],h.push(e.convert(r));return h})().join(" ")+"]";if(typeof n=="string")return"/"+n;if(n!=null&&n.isString)return"("+n+")";if(n instanceof Date)return"(D:"+t(n.getUTCFullYear(),4)+t(n.getUTCMonth(),2)+t(n.getUTCDate(),2)+t(n.getUTCHours(),2)+t(n.getUTCMinutes(),2)+t(n.getUTCSeconds(),2)+"Z)";if({}.toString.call(n)==="[object Object]"){for(a in s=["<<"],n)l=n[a],s.push("/"+a+" "+e.convert(l));return s.push(">>"),s.join(`
343
- `)}return""+n},e})();function q6(t,e,n,r,a){r=r||{};var s=1.15,l=a.internal.scaleFactor,u=a.internal.getFontSize()/l,c=a.getLineHeightFactor?a.getLineHeightFactor():s,h=u*c,d=/\r\n|\r|\n/g,g="",y=1;if((r.valign==="middle"||r.valign==="bottom"||r.halign==="center"||r.halign==="right")&&(g=typeof t=="string"?t.split(d):t,y=g.length||1),n+=u*(2-s),r.valign==="middle"?n-=y/2*h:r.valign==="bottom"&&(n-=y*h),r.halign==="center"||r.halign==="right"){var m=u;if(r.halign==="center"&&(m*=.5),g&&y>=1){for(var x=0;x<g.length;x++)a.text(g[x],e-a.getStringUnitWidth(g[x])*m,n),n+=h;return a}e-=a.getStringUnitWidth(t)*m}return r.halign==="justify"?a.text(t,e,n,{maxWidth:r.maxWidth||100,align:"justify"}):a.text(t,e,n),a}var r_={},Df=(function(){function t(e){this.jsPDFDocument=e,this.userStyles={textColor:e.getTextColor?this.jsPDFDocument.getTextColor():0,fontSize:e.internal.getFontSize(),fontStyle:e.internal.getFont().fontStyle,font:e.internal.getFont().fontName,lineWidth:e.getLineWidth?this.jsPDFDocument.getLineWidth():0,lineColor:e.getDrawColor?this.jsPDFDocument.getDrawColor():0}}return t.setDefaults=function(e,n){n===void 0&&(n=null),n?n.__autoTableDocumentDefaults=e:r_=e},t.unifyColor=function(e){return Array.isArray(e)?e:typeof e=="number"?[e,e,e]:typeof e=="string"?[e]:null},t.prototype.applyStyles=function(e,n){var r,a,s;n===void 0&&(n=!1),e.fontStyle&&this.jsPDFDocument.setFontStyle&&this.jsPDFDocument.setFontStyle(e.fontStyle);var l=this.jsPDFDocument.internal.getFont(),u=l.fontStyle,c=l.fontName;if(e.font&&(c=e.font),e.fontStyle){u=e.fontStyle;var h=this.getFontList()[c];h&&h.indexOf(u)===-1&&this.jsPDFDocument.setFontStyle&&(this.jsPDFDocument.setFontStyle(h[0]),u=h[0])}if(this.jsPDFDocument.setFont(c,u),e.fontSize&&this.jsPDFDocument.setFontSize(e.fontSize),!n){var d=t.unifyColor(e.fillColor);d&&(r=this.jsPDFDocument).setFillColor.apply(r,d),d=t.unifyColor(e.textColor),d&&(a=this.jsPDFDocument).setTextColor.apply(a,d),d=t.unifyColor(e.lineColor),d&&(s=this.jsPDFDocument).setDrawColor.apply(s,d),typeof e.lineWidth=="number"&&this.jsPDFDocument.setLineWidth(e.lineWidth)}},t.prototype.splitTextToSize=function(e,n,r){return this.jsPDFDocument.splitTextToSize(e,n,r)},t.prototype.rect=function(e,n,r,a,s){return this.jsPDFDocument.rect(e,n,r,a,s)},t.prototype.getLastAutoTable=function(){return this.jsPDFDocument.lastAutoTable||null},t.prototype.getTextWidth=function(e){return this.jsPDFDocument.getTextWidth(e)},t.prototype.getDocument=function(){return this.jsPDFDocument},t.prototype.setPage=function(e){this.jsPDFDocument.setPage(e)},t.prototype.addPage=function(){return this.jsPDFDocument.addPage()},t.prototype.getFontList=function(){return this.jsPDFDocument.getFontList()},t.prototype.getGlobalOptions=function(){return r_||{}},t.prototype.getDocumentOptions=function(){return this.jsPDFDocument.__autoTableDocumentDefaults||{}},t.prototype.pageSize=function(){var e=this.jsPDFDocument.internal.pageSize;return e.width==null&&(e={width:e.getWidth(),height:e.getHeight()}),e},t.prototype.scaleFactor=function(){return this.jsPDFDocument.internal.scaleFactor},t.prototype.getLineHeightFactor=function(){var e=this.jsPDFDocument;return e.getLineHeightFactor?e.getLineHeightFactor():1.15},t.prototype.getLineHeight=function(e){return e/this.scaleFactor()*this.getLineHeightFactor()},t.prototype.pageNumber=function(){var e=this.jsPDFDocument.internal.getCurrentPageInfo();return e?e.pageNumber:this.jsPDFDocument.internal.getNumberOfPages()},t})(),Xv=function(t,e){return Xv=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(n[a]=r[a])},Xv(t,e)};function H6(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Xv(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var V6=(function(t){H6(e,t);function e(n){var r=t.call(this)||this;return r._element=n,r}return e})(Array);function u$(t){return{font:"helvetica",fontStyle:"normal",overflow:"linebreak",fillColor:!1,textColor:20,halign:"left",valign:"top",fontSize:10,cellPadding:5/t,lineColor:200,lineWidth:0,cellWidth:"auto",minCellHeight:0,minCellWidth:0}}function c$(t){var e={striped:{table:{fillColor:255,textColor:80,fontStyle:"normal"},head:{textColor:255,fillColor:[41,128,185],fontStyle:"bold"},body:{},foot:{textColor:255,fillColor:[41,128,185],fontStyle:"bold"},alternateRow:{fillColor:245}},grid:{table:{fillColor:255,textColor:80,fontStyle:"normal",lineWidth:.1},head:{textColor:255,fillColor:[26,188,156],fontStyle:"bold",lineWidth:0},body:{},foot:{textColor:255,fillColor:[26,188,156],fontStyle:"bold",lineWidth:0},alternateRow:{}},plain:{head:{fontStyle:"bold"},foot:{fontStyle:"bold"}}};return e[t]}function Fm(t,e,n){n.applyStyles(e,!0);var r=Array.isArray(t)?t:[t],a=r.map(function(s){return n.getTextWidth(s)}).reduce(function(s,l){return Math.max(s,l)},0);return a}function Y6(t,e,n,r){var a=e.settings.tableLineWidth,s=e.settings.tableLineColor;t.applyStyles({lineWidth:a,lineColor:s});var l=G6(a,!1);l&&t.rect(n.x,n.y,e.getWidth(t.pageSize().width),r.y-n.y,l)}function G6(t,e){var n=t>0,r=e||e===0;return n&&r?"DF":n?"S":r?"F":null}function mg(t,e){var n,r,a,s;if(t=t||e,Array.isArray(t)){if(t.length>=4)return{top:t[0],right:t[1],bottom:t[2],left:t[3]};if(t.length===3)return{top:t[0],right:t[1],bottom:t[2],left:t[1]};if(t.length===2)return{top:t[0],right:t[1],bottom:t[0],left:t[1]};t.length===1?t=t[0]:t=e}return typeof t=="object"?(typeof t.vertical=="number"&&(t.top=t.vertical,t.bottom=t.vertical),typeof t.horizontal=="number"&&(t.right=t.horizontal,t.left=t.horizontal),{left:(n=t.left)!==null&&n!==void 0?n:e,top:(r=t.top)!==null&&r!==void 0?r:e,right:(a=t.right)!==null&&a!==void 0?a:e,bottom:(s=t.bottom)!==null&&s!==void 0?s:e}):(typeof t!="number"&&(t=e),{top:t,right:t,bottom:t,left:t})}function W6(t,e){var n=mg(e.settings.margin,0);return t.pageSize().width-(n.left+n.right)}function f$(t,e,n,r,a){var s={},l=1.3333333333333333,u=z1(e,function(T){return a.getComputedStyle(T).backgroundColor});u!=null&&(s.fillColor=u);var c=z1(e,function(T){return a.getComputedStyle(T).color});c!=null&&(s.textColor=c);var h=d$(r,n);h&&(s.cellPadding=h);var d="borderTopColor",g=l*n,y=r.borderTopWidth;if(r.borderBottomWidth===y&&r.borderRightWidth===y&&r.borderLeftWidth===y){var m=(parseFloat(y)||0)/g;m&&(s.lineWidth=m)}else s.lineWidth={top:(parseFloat(r.borderTopWidth)||0)/g,right:(parseFloat(r.borderRightWidth)||0)/g,bottom:(parseFloat(r.borderBottomWidth)||0)/g,left:(parseFloat(r.borderLeftWidth)||0)/g},s.lineWidth.top||(s.lineWidth.right?d="borderRightColor":s.lineWidth.bottom?d="borderBottomColor":s.lineWidth.left&&(d="borderLeftColor"));var x=z1(e,function(T){return a.getComputedStyle(T)[d]});x!=null&&(s.lineColor=x);var E=["left","right","center","justify"];E.indexOf(r.textAlign)!==-1&&(s.halign=r.textAlign),E=["middle","bottom","top"],E.indexOf(r.verticalAlign)!==-1&&(s.valign=r.verticalAlign);var A=parseInt(r.fontSize||"");isNaN(A)||(s.fontSize=A/l);var N=h$(r);N&&(s.fontStyle=N);var O=(r.fontFamily||"").toLowerCase();return t.indexOf(O)!==-1&&(s.font=O),s}function h$(t){var e="";return(t.fontWeight==="bold"||t.fontWeight==="bolder"||parseInt(t.fontWeight)>=700)&&(e="bold"),(t.fontStyle==="italic"||t.fontStyle==="oblique")&&(e+="italic"),e}function z1(t,e){var n=K6(t,e);if(!n)return null;var r=n.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d*\.?\d*))?\)$/);if(!r||!Array.isArray(r))return null;var a=[parseInt(r[1]),parseInt(r[2]),parseInt(r[3])],s=parseInt(r[4]);return s===0||isNaN(a[0])||isNaN(a[1])||isNaN(a[2])?null:a}function K6(t,e){var n=e(t);return n==="rgba(0, 0, 0, 0)"||n==="transparent"||n==="initial"||n==="inherit"?t.parentElement==null?null:K6(t.parentElement,e):n}function d$(t,e){var n=[t.paddingTop,t.paddingRight,t.paddingBottom,t.paddingLeft],r=96/(72/e),a=(parseInt(t.lineHeight)-parseInt(t.fontSize))/e/2,s=n.map(function(u){return parseInt(u||"0")/r}),l=mg(s,0);return a>l.top&&(l.top=a),a>l.bottom&&(l.bottom=a),l}function J6(t,e,n,r,a){var s,l;r===void 0&&(r=!1),a===void 0&&(a=!1);var u;typeof e=="string"?u=n.document.querySelector(e):u=e;var c=Object.keys(t.getFontList()),h=t.scaleFactor(),d=[],g=[],y=[];if(!u)return console.error("Html table could not be found with input: ",e),{head:d,body:g,foot:y};for(var m=0;m<u.rows.length;m++){var x=u.rows[m],E=(l=(s=x==null?void 0:x.parentElement)===null||s===void 0?void 0:s.tagName)===null||l===void 0?void 0:l.toLowerCase(),A=p$(c,h,n,x,r,a);A&&(E==="thead"?d.push(A):E==="tfoot"?y.push(A):g.push(A))}return{head:d,body:g,foot:y}}function p$(t,e,n,r,a,s){for(var l=new V6(r),u=0;u<r.cells.length;u++){var c=r.cells[u],h=n.getComputedStyle(c);if(a||h.display!=="none"){var d=void 0;s&&(d=f$(t,c,e,h,n)),l.push({rowSpan:c.rowSpan,colSpan:c.colSpan,styles:d,_element:c,content:m$(c)})}}var g=n.getComputedStyle(r);if(l.length>0&&(a||g.display!=="none"))return l}function m$(t){var e=t.cloneNode(!0);return e.innerHTML=e.innerHTML.replace(/\n/g,"").replace(/ +/g," "),e.innerHTML=e.innerHTML.split(/<br.*?>/).map(function(n){return n.trim()}).join(`
344
- `),e.innerText||e.textContent||""}function g$(t,e,n){for(var r=0,a=[t,e,n];r<a.length;r++){var s=a[r];s&&typeof s!="object"&&console.error("The options parameter should be of type object, is: "+typeof s),s.startY&&typeof s.startY!="number"&&(console.error("Invalid value for startY option",s.startY),delete s.startY)}}function ml(t,e,n,r,a){if(t==null)throw new TypeError("Cannot convert undefined or null to object");for(var s=Object(t),l=1;l<arguments.length;l++){var u=arguments[l];if(u!=null)for(var c in u)Object.prototype.hasOwnProperty.call(u,c)&&(s[c]=u[c])}return s}function X6(t,e){var n=new Df(t),r=n.getDocumentOptions(),a=n.getGlobalOptions();g$(a,r,e);var s=ml({},a,r,e),l;typeof window<"u"&&(l=window);var u=v$(a,r,e),c=y$(a,r,e),h=b$(n,s),d=x$(n,s,l);return{id:e.tableId,content:d,hooks:c,styles:u,settings:h}}function v$(t,e,n){for(var r={styles:{},headStyles:{},bodyStyles:{},footStyles:{},alternateRowStyles:{},columnStyles:{}},a=function(c){if(c==="columnStyles"){var h=t[c],d=e[c],g=n[c];r.columnStyles=ml({},h,d,g)}else{var y=[t,e,n],m=y.map(function(x){return x[c]||{}});r[c]=ml({},m[0],m[1],m[2])}},s=0,l=Object.keys(r);s<l.length;s++){var u=l[s];a(u)}return r}function y$(t,e,n){for(var r=[t,e,n],a={didParseCell:[],willDrawCell:[],didDrawCell:[],willDrawPage:[],didDrawPage:[]},s=0,l=r;s<l.length;s++){var u=l[s];u.didParseCell&&a.didParseCell.push(u.didParseCell),u.willDrawCell&&a.willDrawCell.push(u.willDrawCell),u.didDrawCell&&a.didDrawCell.push(u.didDrawCell),u.willDrawPage&&a.willDrawPage.push(u.willDrawPage),u.didDrawPage&&a.didDrawPage.push(u.didDrawPage)}return a}function b$(t,e){var n,r,a,s,l,u,c,h,d,g,y,m,x=mg(e.margin,40/t.scaleFactor()),E=(n=w$(t,e.startY))!==null&&n!==void 0?n:x.top,A;e.showFoot===!0?A="everyPage":e.showFoot===!1?A="never":A=(r=e.showFoot)!==null&&r!==void 0?r:"everyPage";var N;e.showHead===!0?N="everyPage":e.showHead===!1?N="never":N=(a=e.showHead)!==null&&a!==void 0?a:"everyPage";var O=(s=e.useCss)!==null&&s!==void 0?s:!1,T=e.theme||(O?"plain":"striped"),D=!!e.horizontalPageBreak,F=(l=e.horizontalPageBreakRepeat)!==null&&l!==void 0?l:null;return{includeHiddenHtml:(u=e.includeHiddenHtml)!==null&&u!==void 0?u:!1,useCss:O,theme:T,startY:E,margin:x,pageBreak:(c=e.pageBreak)!==null&&c!==void 0?c:"auto",rowPageBreak:(h=e.rowPageBreak)!==null&&h!==void 0?h:"auto",tableWidth:(d=e.tableWidth)!==null&&d!==void 0?d:"auto",showHead:N,showFoot:A,tableLineWidth:(g=e.tableLineWidth)!==null&&g!==void 0?g:0,tableLineColor:(y=e.tableLineColor)!==null&&y!==void 0?y:200,horizontalPageBreak:D,horizontalPageBreakRepeat:F,horizontalPageBreakBehaviour:(m=e.horizontalPageBreakBehaviour)!==null&&m!==void 0?m:"afterAllRows"}}function w$(t,e){var n=t.getLastAutoTable(),r=t.scaleFactor(),a=t.pageNumber(),s=!1;if(n&&n.startPageNumber){var l=n.startPageNumber+n.pageNumber-1;s=l===a}return typeof e=="number"?e:(e==null||e===!1)&&s&&(n==null?void 0:n.finalY)!=null?n.finalY+20/r:null}function x$(t,e,n){var r=e.head||[],a=e.body||[],s=e.foot||[];if(e.html){var l=e.includeHiddenHtml;if(n){var u=J6(t,e.html,n,l,e.useCss)||{};r=u.head||r,a=u.body||r,s=u.foot||r}else console.error("Cannot parse html in non browser environment")}var c=e.columns||S$(r,a,s);return{columns:c,head:r,body:a,foot:s}}function S$(t,e,n){var r=t[0]||e[0]||n[0]||[],a=[];return Object.keys(r).filter(function(s){return s!=="_element"}).forEach(function(s){var l=1,u;Array.isArray(r)?u=r[parseInt(s)]:u=r[s],typeof u=="object"&&!Array.isArray(u)&&(l=(u==null?void 0:u.colSpan)||1);for(var c=0;c<l;c++){var h=void 0;Array.isArray(r)?h=a.length:h=s+(c>0?"_".concat(c):"");var d={dataKey:h};a.push(d)}}),a}var Zv=(function(){function t(e,n,r){this.table=n,this.pageNumber=n.pageNumber,this.settings=n.settings,this.cursor=r,this.doc=e.getDocument()}return t})(),_$=(function(t){H6(e,t);function e(n,r,a,s,l,u){var c=t.call(this,n,r,u)||this;return c.cell=a,c.row=s,c.column=l,c.section=s.section,c}return e})(Zv),E$=(function(){function t(e,n){this.pageNumber=1,this.id=e.id,this.settings=e.settings,this.styles=e.styles,this.hooks=e.hooks,this.columns=n.columns,this.head=n.head,this.body=n.body,this.foot=n.foot}return t.prototype.getHeadHeight=function(e){return this.head.reduce(function(n,r){return n+r.getMaxCellHeight(e)},0)},t.prototype.getFootHeight=function(e){return this.foot.reduce(function(n,r){return n+r.getMaxCellHeight(e)},0)},t.prototype.allRows=function(){return this.head.concat(this.body).concat(this.foot)},t.prototype.callCellHooks=function(e,n,r,a,s,l){for(var u=0,c=n;u<c.length;u++){var h=c[u],d=new _$(e,this,r,a,s,l),g=h(d)===!1;if(r.text=Array.isArray(r.text)?r.text:[r.text],g)return!1}return!0},t.prototype.callEndPageHooks=function(e,n){e.applyStyles(e.userStyles);for(var r=0,a=this.hooks.didDrawPage;r<a.length;r++){var s=a[r];s(new Zv(e,this,n))}},t.prototype.callWillDrawPageHooks=function(e,n){for(var r=0,a=this.hooks.willDrawPage;r<a.length;r++){var s=a[r];s(new Zv(e,this,n))}},t.prototype.getWidth=function(e){if(typeof this.settings.tableWidth=="number")return this.settings.tableWidth;if(this.settings.tableWidth==="wrap"){var n=this.columns.reduce(function(a,s){return a+s.wrappedWidth},0);return n}else{var r=this.settings.margin;return e-r.left-r.right}},t})(),Z6=(function(){function t(e,n,r,a,s){s===void 0&&(s=!1),this.height=0,this.raw=e,e instanceof V6&&(this.raw=e._element,this.element=e._element),this.index=n,this.section=r,this.cells=a,this.spansMultiplePages=s}return t.prototype.getMaxCellHeight=function(e){var n=this;return e.reduce(function(r,a){var s;return Math.max(r,((s=n.cells[a.index])===null||s===void 0?void 0:s.height)||0)},0)},t.prototype.hasRowSpan=function(e){var n=this;return e.filter(function(r){var a=n.cells[r.index];return a?a.rowSpan>1:!1}).length>0},t.prototype.canEntireRowFit=function(e,n){return this.getMaxCellHeight(n)<=e},t.prototype.getMinimumRowHeight=function(e,n){var r=this;return e.reduce(function(a,s){var l=r.cells[s.index];if(!l)return 0;var u=n.getLineHeight(l.styles.fontSize),c=l.padding("vertical"),h=c+u;return h>a?h:a},0)},t})(),Q6=(function(){function t(e,n,r){var a;this.contentHeight=0,this.contentWidth=0,this.wrappedWidth=0,this.minReadableWidth=0,this.minWidth=0,this.width=0,this.height=0,this.x=0,this.y=0,this.styles=n,this.section=r,this.raw=e;var s=e;e!=null&&typeof e=="object"&&!Array.isArray(e)?(this.rowSpan=e.rowSpan||1,this.colSpan=e.colSpan||1,s=(a=e.content)!==null&&a!==void 0?a:e,e._element&&(this.raw=e._element)):(this.rowSpan=1,this.colSpan=1);var l=s!=null?""+s:"",u=/\r\n|\r|\n/g;this.text=l.split(u)}return t.prototype.getTextPos=function(){var e;if(this.styles.valign==="top")e=this.y+this.padding("top");else if(this.styles.valign==="bottom")e=this.y+this.height-this.padding("bottom");else{var n=this.height-this.padding("vertical");e=this.y+n/2+this.padding("top")}var r;if(this.styles.halign==="right")r=this.x+this.width-this.padding("right");else if(this.styles.halign==="center"){var a=this.width-this.padding("horizontal");r=this.x+a/2+this.padding("left")}else r=this.x+this.padding("left");return{x:r,y:e}},t.prototype.getContentHeight=function(e,n){n===void 0&&(n=1.15);var r=Array.isArray(this.text)?this.text.length:1,a=this.styles.fontSize/e*n,s=r*a+this.padding("vertical");return Math.max(s,this.styles.minCellHeight)},t.prototype.padding=function(e){var n=mg(this.styles.cellPadding,0);return e==="vertical"?n.top+n.bottom:e==="horizontal"?n.left+n.right:n[e]},t})(),A$=(function(){function t(e,n,r){this.wrappedWidth=0,this.minReadableWidth=0,this.minWidth=0,this.width=0,this.dataKey=e,this.raw=n,this.index=r}return t.prototype.getMaxCustomCellWidth=function(e){for(var n=0,r=0,a=e.allRows();r<a.length;r++){var s=a[r],l=s.cells[this.index];l&&typeof l.styles.cellWidth=="number"&&(n=Math.max(n,l.styles.cellWidth))}return n},t})();function N$(t,e){C$(t,e);var n=[],r=0;e.columns.forEach(function(s){var l=s.getMaxCustomCellWidth(e);l?s.width=l:(s.width=s.wrappedWidth,n.push(s)),r+=s.width});var a=e.getWidth(t.pageSize().width)-r;a&&(a=Qv(n,a,function(s){return Math.max(s.minReadableWidth,s.minWidth)})),a&&(a=Qv(n,a,function(s){return s.minWidth})),a=Math.abs(a),!e.settings.horizontalPageBreak&&a>.1/t.scaleFactor()&&(a=a<1?a:Math.round(a),console.log("Of the table content, ".concat(a," units width could not fit page"))),L$(e),O$(e,t),T$(e)}function C$(t,e){var n=t.scaleFactor(),r=e.settings.horizontalPageBreak,a=W6(t,e);e.allRows().forEach(function(s){for(var l=0,u=e.columns;l<u.length;l++){var c=u[l],h=s.cells[c.index];if(h){var d=e.hooks.didParseCell;e.callCellHooks(t,d,h,s,c,null);var g=h.padding("horizontal");h.contentWidth=Fm(h.text,h.styles,t)+g;var y=Fm(h.text.join(" ").split(/[^\S\u00A0]+/),h.styles,t);if(h.minReadableWidth=y+h.padding("horizontal"),typeof h.styles.cellWidth=="number")h.minWidth=h.styles.cellWidth,h.wrappedWidth=h.styles.cellWidth;else if(h.styles.cellWidth==="wrap"||r===!0)h.contentWidth>a?(h.minWidth=a,h.wrappedWidth=a):(h.minWidth=h.contentWidth,h.wrappedWidth=h.contentWidth);else{var m=10/n;h.minWidth=h.styles.minCellWidth||m,h.wrappedWidth=h.contentWidth,h.minWidth>h.wrappedWidth&&(h.wrappedWidth=h.minWidth)}}}}),e.allRows().forEach(function(s){for(var l=0,u=e.columns;l<u.length;l++){var c=u[l],h=s.cells[c.index];if(h&&h.colSpan===1)c.wrappedWidth=Math.max(c.wrappedWidth,h.wrappedWidth),c.minWidth=Math.max(c.minWidth,h.minWidth),c.minReadableWidth=Math.max(c.minReadableWidth,h.minReadableWidth);else{var d=e.styles.columnStyles[c.dataKey]||e.styles.columnStyles[c.index]||{},g=d.cellWidth||d.minCellWidth;g&&typeof g=="number"&&(c.minWidth=g,c.wrappedWidth=g)}h&&(h.colSpan>1&&!c.minWidth&&(c.minWidth=h.minWidth),h.colSpan>1&&!c.wrappedWidth&&(c.wrappedWidth=h.minWidth))}})}function Qv(t,e,n){for(var r=e,a=t.reduce(function(m,x){return m+x.wrappedWidth},0),s=0;s<t.length;s++){var l=t[s],u=l.wrappedWidth/a,c=r*u,h=l.width+c,d=n(l),g=h<d?d:h;e-=g-l.width,l.width=g}if(e=Math.round(e*1e10)/1e10,e){var y=t.filter(function(m){return e<0?m.width>n(m):!0});y.length&&(e=Qv(y,e,n))}return e}function T$(t){for(var e={},n=1,r=t.allRows(),a=0;a<r.length;a++)for(var s=r[a],l=0,u=t.columns;l<u.length;l++){var c=u[l],h=e[c.index];if(n>1)n--,delete s.cells[c.index];else if(h)h.cell.height+=s.height,n=h.cell.colSpan,delete s.cells[c.index],h.left--,h.left<=1&&delete e[c.index];else{var d=s.cells[c.index];if(!d)continue;if(d.height=s.height,d.rowSpan>1){var g=r.length-a,y=d.rowSpan>g?g:d.rowSpan;e[c.index]={cell:d,left:y,row:s}}}}}function L$(t){for(var e=t.allRows(),n=0;n<e.length;n++)for(var r=e[n],a=null,s=0,l=0,u=0;u<t.columns.length;u++){var c=t.columns[u];if(l-=1,l>1&&t.columns[u+1])s+=c.width,delete r.cells[c.index];else if(a){var h=a;delete r.cells[c.index],a=null,h.width=c.width+s}else{var h=r.cells[c.index];if(!h)continue;if(l=h.colSpan,s=0,h.colSpan>1){a=h,s+=c.width;continue}h.width=c.width+s}}}function O$(t,e){for(var n={count:0,height:0},r=0,a=t.allRows();r<a.length;r++){for(var s=a[r],l=0,u=t.columns;l<u.length;l++){var c=u[l],h=s.cells[c.index];if(h){e.applyStyles(h.styles,!0);var d=h.width-h.padding("horizontal");if(h.styles.overflow==="linebreak")h.text=e.splitTextToSize(h.text,d+1/e.scaleFactor(),{fontSize:h.styles.fontSize});else if(h.styles.overflow==="ellipsize")h.text=a_(h.text,d,h.styles,e,"...");else if(h.styles.overflow==="hidden")h.text=a_(h.text,d,h.styles,e,"");else if(typeof h.styles.overflow=="function"){var g=h.styles.overflow(h.text,d);typeof g=="string"?h.text=[g]:h.text=g}h.contentHeight=h.getContentHeight(e.scaleFactor(),e.getLineHeightFactor());var y=h.contentHeight/h.rowSpan;h.rowSpan>1&&n.count*n.height<y*h.rowSpan?n={height:y,count:h.rowSpan}:n&&n.count>0&&n.height>y&&(y=n.height),y>s.height&&(s.height=y)}}n.count--}}function a_(t,e,n,r,a){return t.map(function(s){return j$(s,e,n,r,a)})}function j$(t,e,n,r,a){var s=1e4*r.scaleFactor();if(e=Math.ceil(e*s)/s,e>=Fm(t,n,r))return t;for(;e<Fm(t+a,n,r)&&!(t.length<=1);)t=t.substring(0,t.length-1);return t.trim()+a}function eE(t,e){var n=new Df(t),r=R$(e,n.scaleFactor()),a=new E$(e,r);return N$(n,a),n.applyStyles(n.userStyles),a}function R$(t,e){var n=t.content,r=k$(n.columns);if(n.head.length===0){var a=i_(r,"head");a&&n.head.push(a)}if(n.foot.length===0){var a=i_(r,"foot");a&&n.foot.push(a)}var s=t.settings.theme,l=t.styles;return{columns:r,head:q1("head",n.head,r,l,s,e),body:q1("body",n.body,r,l,s,e),foot:q1("foot",n.foot,r,l,s,e)}}function q1(t,e,n,r,a,s){var l={},u=e.map(function(c,h){for(var d=0,g={},y=0,m=0,x=0,E=n;x<E.length;x++){var A=E[x];if(l[A.index]==null||l[A.index].left===0)if(m===0){var N=void 0;Array.isArray(c)?N=c[A.index-y-d]:N=c[A.dataKey];var O={};typeof N=="object"&&!Array.isArray(N)&&(O=(N==null?void 0:N.styles)||{});var T=M$(t,A,h,a,r,s,O),D=new Q6(N,T,t);g[A.dataKey]=D,g[A.index]=D,m=D.colSpan-1,l[A.index]={left:D.rowSpan-1,times:m}}else m--,y++;else l[A.index].left--,m=l[A.index].times,d++}return new Z6(c,h,t,g)});return u}function i_(t,e){var n={};return t.forEach(function(r){if(r.raw!=null){var a=D$(e,r.raw);a!=null&&(n[r.dataKey]=a)}}),Object.keys(n).length>0?n:null}function D$(t,e){if(t==="head"){if(typeof e=="object")return e.header||null;if(typeof e=="string"||typeof e=="number")return e}else if(t==="foot"&&typeof e=="object")return e.footer;return null}function k$(t){return t.map(function(e,n){var r,a;return typeof e=="object"?a=(r=e.dataKey)!==null&&r!==void 0?r:n:a=n,new A$(a,e,n)})}function M$(t,e,n,r,a,s,l){var u=c$(r),c;t==="head"?c=a.headStyles:t==="body"?c=a.bodyStyles:t==="foot"&&(c=a.footStyles);var h=ml({},u.table,u[t],a.styles,c),d=a.columnStyles[e.dataKey]||a.columnStyles[e.index]||{},g=t==="body"?d:{},y=t==="body"&&n%2===0?ml({},u.alternateRow,a.alternateRowStyles):{},m=u$(s),x=ml({},m,h,y,g);return ml(x,l)}function P$(t,e,n){var r;n===void 0&&(n={});var a=W6(t,e),s=new Map,l=[],u=[],c=[];Array.isArray(e.settings.horizontalPageBreakRepeat)?c=e.settings.horizontalPageBreakRepeat:(typeof e.settings.horizontalPageBreakRepeat=="string"||typeof e.settings.horizontalPageBreakRepeat=="number")&&(c=[e.settings.horizontalPageBreakRepeat]),c.forEach(function(y){var m=e.columns.find(function(x){return x.dataKey===y||x.index===y});m&&!s.has(m.index)&&(s.set(m.index,!0),l.push(m.index),u.push(e.columns[m.index]),a-=m.wrappedWidth)});for(var h=!0,d=(r=n==null?void 0:n.start)!==null&&r!==void 0?r:0;d<e.columns.length;){if(s.has(d)){d++;continue}var g=e.columns[d].wrappedWidth;if(h||a>=g)h=!1,l.push(d),u.push(e.columns[d]),a-=g;else break;d++}return{colIndexes:l,columns:u,lastIndex:d-1}}function I$(t,e){for(var n=[],r=0;r<e.columns.length;r++){var a=P$(t,e,{start:r});a.columns.length&&(n.push(a),r=a.lastIndex)}return n}function tE(t,e){var n=e.settings,r=n.startY,a=n.margin,s={x:a.left,y:r},l=e.getHeadHeight(e.columns)+e.getFootHeight(e.columns),u=r+a.bottom+l;if(n.pageBreak==="avoid"){var c=e.body,h=c.reduce(function(y,m){return y+m.height},0);u+=h}var d=new Df(t);(n.pageBreak==="always"||n.startY!=null&&u>d.pageSize().height)&&(rE(d),s.y=a.top),e.callWillDrawPageHooks(d,s);var g=ml({},s);e.startPageNumber=d.pageNumber(),n.horizontalPageBreak?F$(d,e,g,s):(d.applyStyles(d.userStyles),(n.showHead==="firstPage"||n.showHead==="everyPage")&&e.head.forEach(function(y){return bl(d,e,y,s,e.columns)}),d.applyStyles(d.userStyles),e.body.forEach(function(y,m){var x=m===e.body.length-1;Um(d,e,y,x,g,s,e.columns)}),d.applyStyles(d.userStyles),(n.showFoot==="lastPage"||n.showFoot==="everyPage")&&e.foot.forEach(function(y){return bl(d,e,y,s,e.columns)})),Y6(d,e,g,s),e.callEndPageHooks(d,s),e.finalY=s.y,t.lastAutoTable=e,d.applyStyles(d.userStyles)}function F$(t,e,n,r){var a=I$(t,e),s=e.settings;if(s.horizontalPageBreakBehaviour==="afterAllRows")a.forEach(function(h,d){t.applyStyles(t.userStyles),d>0?Hh(t,e,n,r,h.columns,!0):s_(t,e,r,h.columns),U$(t,e,n,r,h.columns),H1(t,e,r,h.columns)});else for(var l=-1,u=a[0],c=function(){var h=l;if(u){t.applyStyles(t.userStyles);var d=u.columns;l>=0?Hh(t,e,n,r,d,!0):s_(t,e,r,d),h=o_(t,e,l+1,r,d),H1(t,e,r,d)}var g=h-l;a.slice(1).forEach(function(y){t.applyStyles(t.userStyles),Hh(t,e,n,r,y.columns,!0),o_(t,e,l+1,r,y.columns,g),H1(t,e,r,y.columns)}),l=h};l<e.body.length-1;)c()}function s_(t,e,n,r){var a=e.settings;t.applyStyles(t.userStyles),(a.showHead==="firstPage"||a.showHead==="everyPage")&&e.head.forEach(function(s){return bl(t,e,s,n,r)})}function U$(t,e,n,r,a){t.applyStyles(t.userStyles),e.body.forEach(function(s,l){var u=l===e.body.length-1;Um(t,e,s,u,n,r,a)})}function o_(t,e,n,r,a,s){t.applyStyles(t.userStyles),s=s??e.body.length;var l=Math.min(n+s,e.body.length),u=-1;return e.body.slice(n,l).forEach(function(c,h){var d=n+h===e.body.length-1,g=nE(t,e,d,r);c.canEntireRowFit(g,a)&&(bl(t,e,c,r,a),u=n+h)}),u}function H1(t,e,n,r){var a=e.settings;t.applyStyles(t.userStyles),(a.showFoot==="lastPage"||a.showFoot==="everyPage")&&e.foot.forEach(function(s){return bl(t,e,s,n,r)})}function B$(t,e,n){var r=n.getLineHeight(t.styles.fontSize),a=t.padding("vertical"),s=Math.floor((e-a)/r);return Math.max(0,s)}function $$(t,e,n,r){var a={};t.spansMultiplePages=!0,t.height=0;for(var s=0,l=0,u=n.columns;l<u.length;l++){var c=u[l],h=t.cells[c.index];if(h){Array.isArray(h.text)||(h.text=[h.text]);var d=new Q6(h.raw,h.styles,h.section);d=ml(d,h),d.text=[];var g=B$(h,e,r);h.text.length>g&&(d.text=h.text.splice(g,h.text.length));var y=r.scaleFactor(),m=r.getLineHeightFactor();h.contentHeight=h.getContentHeight(y,m),h.contentHeight>=e&&(h.contentHeight=e,d.styles.minCellHeight-=e),h.contentHeight>t.height&&(t.height=h.contentHeight),d.contentHeight=d.getContentHeight(y,m),d.contentHeight>s&&(s=d.contentHeight),a[c.index]=d}}var x=new Z6(t.raw,-1,t.section,a,!0);x.height=s;for(var E=0,A=n.columns;E<A.length;E++){var c=A[E],d=x.cells[c.index];d&&(d.height=x.height);var h=t.cells[c.index];h&&(h.height=t.height)}return x}function z$(t,e,n,r){var a=t.pageSize().height,s=r.settings.margin,l=s.top+s.bottom,u=a-l;e.section==="body"&&(u-=r.getHeadHeight(r.columns)+r.getFootHeight(r.columns));var c=e.getMinimumRowHeight(r.columns,t),h=c<n;if(c>u)return console.log("Will not be able to print row ".concat(e.index," correctly since it's minimum height is larger than page height")),!0;if(!h)return!1;var d=e.hasRowSpan(r.columns),g=e.getMaxCellHeight(r.columns)>u;return g?(d&&console.log("The content of row ".concat(e.index," will not be drawn correctly since drawing rows with a height larger than the page height and has cells with rowspans is not supported.")),!0):!(d||r.settings.rowPageBreak==="avoid")}function Um(t,e,n,r,a,s,l){var u=nE(t,e,r,s);if(n.canEntireRowFit(u,l))bl(t,e,n,s,l);else if(z$(t,n,u,e)){var c=$$(n,u,e,t);bl(t,e,n,s,l),Hh(t,e,a,s,l),Um(t,e,c,r,a,s,l)}else Hh(t,e,a,s,l),Um(t,e,n,r,a,s,l)}function bl(t,e,n,r,a){r.x=e.settings.margin.left;for(var s=0,l=a;s<l.length;s++){var u=l[s],c=n.cells[u.index];if(!c){r.x+=u.width;continue}t.applyStyles(c.styles),c.x=r.x,c.y=r.y;var h=e.callCellHooks(t,e.hooks.willDrawCell,c,n,u,r);if(h===!1){r.x+=u.width;continue}q$(t,c,r);var d=c.getTextPos();q6(c.text,d.x,d.y,{halign:c.styles.halign,valign:c.styles.valign,maxWidth:Math.ceil(c.width-c.padding("left")-c.padding("right"))},t.getDocument()),e.callCellHooks(t,e.hooks.didDrawCell,c,n,u,r),r.x+=u.width}r.y+=n.height}function q$(t,e,n){var r=e.styles;if(t.getDocument().setFillColor(t.getDocument().getFillColor()),typeof r.lineWidth=="number"){var a=G6(r.lineWidth,r.fillColor);a&&t.rect(e.x,n.y,e.width,e.height,a)}else typeof r.lineWidth=="object"&&(r.fillColor&&t.rect(e.x,n.y,e.width,e.height,"F"),H$(t,e,n,r.lineWidth))}function H$(t,e,n,r){var a,s,l,u;r.top&&(a=n.x,s=n.y,l=n.x+e.width,u=n.y,r.right&&(l+=.5*r.right),r.left&&(a-=.5*r.left),c(r.top,a,s,l,u)),r.bottom&&(a=n.x,s=n.y+e.height,l=n.x+e.width,u=n.y+e.height,r.right&&(l+=.5*r.right),r.left&&(a-=.5*r.left),c(r.bottom,a,s,l,u)),r.left&&(a=n.x,s=n.y,l=n.x,u=n.y+e.height,r.top&&(s-=.5*r.top),r.bottom&&(u+=.5*r.bottom),c(r.left,a,s,l,u)),r.right&&(a=n.x+e.width,s=n.y,l=n.x+e.width,u=n.y+e.height,r.top&&(s-=.5*r.top),r.bottom&&(u+=.5*r.bottom),c(r.right,a,s,l,u));function c(h,d,g,y,m){t.getDocument().setLineWidth(h),t.getDocument().line(d,g,y,m,"S")}}function nE(t,e,n,r){var a=e.settings.margin.bottom,s=e.settings.showFoot;return(s==="everyPage"||s==="lastPage"&&n)&&(a+=e.getFootHeight(e.columns)),t.pageSize().height-r.y-a}function Hh(t,e,n,r,a,s){a===void 0&&(a=[]),s===void 0&&(s=!1),t.applyStyles(t.userStyles),e.settings.showFoot==="everyPage"&&!s&&e.foot.forEach(function(u){return bl(t,e,u,r,a)}),e.callEndPageHooks(t,r);var l=e.settings.margin;Y6(t,e,n,r),rE(t),e.pageNumber++,r.x=l.left,r.y=l.top,n.y=l.top,e.callWillDrawPageHooks(t,r),e.settings.showHead==="everyPage"&&(e.head.forEach(function(u){return bl(t,e,u,r,a)}),t.applyStyles(t.userStyles))}function rE(t){var e=t.pageNumber();t.setPage(e+1);var n=t.pageNumber();return n===e?(t.addPage(),!0):!1}function V$(t){t.API.autoTable=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=e[0],a=X6(this,r),s=eE(this,a);return tE(this,s),this},t.API.lastAutoTable=!1,t.API.autoTableText=function(e,n,r,a){q6(e,n,r,a,this)},t.API.autoTableSetDefaults=function(e){return Df.setDefaults(e,this),this},t.autoTableSetDefaults=function(e,n){Df.setDefaults(e,n)},t.API.autoTableHtmlToJson=function(e,n){var r;if(n===void 0&&(n=!1),typeof window>"u")return console.error("Cannot run autoTableHtmlToJson in non browser environment"),null;var a=new Df(this),s=J6(a,e,window,n,!1),l=s.head,u=s.body,c=((r=l[0])===null||r===void 0?void 0:r.map(function(h){return h.content}))||[];return{columns:c,rows:u,data:u}}}var V1;function Y$(t,e){var n=X6(t,e),r=eE(t,n);tE(t,r)}try{if(typeof window<"u"&&window){var l_=window,u_=l_.jsPDF||((V1=l_.jspdf)===null||V1===void 0?void 0:V1.jsPDF);u_&&V$(u_)}}catch(t){console.error("Could not apply autoTable plugin",t)}const c_=()=>_.jsx("div",{className:"flex items-center justify-center h-full",children:_.jsx("div",{className:"w-5 h-5 border-2 border-primary border-t-transparent rounded-full animate-spin"})}),G$=({onCSV:t,onPDF:e,onCancel:n,downloading:r})=>{const{t:a}=kr();return _.jsx("div",{className:"fixed inset-0 bg-black/50 flex justify-center items-center z-50",children:_.jsx("div",{className:"bg-white rounded-lg p-6 max-w-xs w-full shadow-lg",children:_.jsxs("div",{className:"flex flex-col gap-3",children:[_.jsx("button",{className:"bg-green-600 text-white rounded py-2 font-medium hover:cursor-pointer",onClick:t,disabled:r,children:r?_.jsx(c_,{}):a("SAVE AS CSV")}),_.jsx("button",{className:"bg-blue-600 text-white rounded py-2 font-medium hover:cursor-pointer",onClick:e,disabled:r,children:r?_.jsx(c_,{}):a("SAVE AS PDF")}),_.jsx("button",{className:"text-gray-500 mt-2 hover:cursor-pointer",onClick:n,disabled:r,children:a("CANCEL")})]})})})},W$=t=>new Promise((e,n)=>{const r=new Image;r.crossOrigin="anonymous",r.onload=()=>{const a=document.createElement("canvas");a.width=r.width,a.height=r.height;const s=a.getContext("2d");if(!s){n("Canvas context is null");return}s.drawImage(r,0,0);try{const l=a.toDataURL("image/png");e(l)}catch(l){n("Failed to convert image to base64: "+l)}},r.onerror=a=>n("Image load error: "+a),r.src=t}),aE="prayerApp",kf="prayer_ranges";async function K$(t,e){await(await Gr(aE,1,{upgrade(r){r.objectStoreNames.contains(kf)||r.createObjectStore(kf,{keyPath:"key"})}})).put(kf,{key:t,data:e,timestamp:Date.now()})}async function J$(t){const n=await(await Gr(aE,1,{upgrade(r){r.objectStoreNames.contains(kf)||r.createObjectStore(kf,{keyPath:"key"})}})).get(kf,t);return n&&Date.now()-n.timestamp<1440*60*1e3?n:null}function f_(t){const e=t.getFullYear(),n=(t.getMonth()+1).toString().padStart(2,"0"),r=t.getDate().toString().padStart(2,"0");return`${e}-${n}-${r}`}function X$({locationId:t,periodFrom:e,periodTo:n,asrMethod:r,prayerMethod:a}){const[s,l]=k.useState([]),[u,c]=k.useState(!1),h=async(g=!0)=>{g&&c(!1);const y=f_(e),m=f_(n),x=`prayer_range_${t}_${y}_${m}`;try{const E=await J$(x);if(E&&l(E.data),!navigator.onLine){g&&c(!0);return}const A=new AbortController,N=setTimeout(()=>A.abort(),1e4),O=await Promise.race([Sj(t,y,m,r,a),new Promise((T,D)=>setTimeout(()=>D(new Error("Request timeout")),1e4))]);clearTimeout(N),A.abort(),l(O),await K$(x,O)}catch(E){console.error("Error fetching prayer times range: ",E),await fa(E,{message:"Error fetching prayer times range",function:"usePrayerTimesRange"}),E.name==="AbortError"||E.message.includes("timeout")?Un("warning","Slow connection, showing cached data"):Un("error","An unexpected error occured!")}finally{g&&c(!0)}};return k.useEffect(()=>{h(!0)},[t,e,n,r,a]),k.useEffect(()=>{if(!navigator.onLine)return;let g=null;return g=ft.channel(`prayer_times_range:${t}`).on("postgres_changes",{event:"*",schema:"public",table:"prayertime",filter:`location_iso=eq.${t}`},()=>{h(!1)}).subscribe(),()=>{g==null||g.unsubscribe()}},[t]),{prayerTimes:s,ready:u,refetch:()=>h(!0)}}const h_={7:{text:"text-white",footer:"text-[#27391C]",button:"bg-[#D9D9D9] text-[#27391C] mb-3 mr-3"},8:{text:"text-[#543A14]",footer:"text-[#543A14]",button:"bg-[#F0BB78] text-[#27391C] mb-3 mr-3"},9:{text:"text-[#E5D0AC]",footer:"text-[#6D2323]",button:"bg-[#E5D0AC] text-[#27391C] mb-3 mr-3"}},iE=({isView:t})=>{const{language:e,colorScheme:n,locationId:r,selectedMosque:a,periodFrom:s,periodTo:l,asrMethod:u,prayerMethod:c}=Ii(),[h,d]=k.useState(!1),[g,y]=k.useState(!1),m=Pi(),{org_nr:x}=xr(),{t:E}=kr(),A=e==="ar",{udThemeId:N}=bd(x),{masjidName:O,masjidLogo:T,masjidAddress:D,masjidContact:F}=gd(a==null?void 0:a.value),Q=n.isDefault,P=h_[N]||h_[7],{prayerTimes:$,ready:B}=X$({locationId:r,periodFrom:s,periodTo:l,asrMethod:u,prayerMethod:c}),ne=()=>{if(y(!0),$.length===0){Un("error","No prayer times to download."),y(!1),d(!1);return}const J=["Date","Fajr","Sunrise","Dhuhr","Asr","Maghrib","Isha"],ae=$.map(ge=>[new Date(ge.date).toLocaleDateString("en-IN"),ge.fajr,ge.sunrise,ge.dhuhr,ge.asr,ge.maghrib,ge.isha]),me=[J,...ae].map(ge=>ge.join(",")).join(`
345
- `),Z=new Blob([me],{type:"text/csv;charset=utf-8;"}),ce=URL.createObjectURL(Z),oe=document.createElement("a");oe.href=ce,oe.setAttribute("download",`prayer-timetable-${new Date().toISOString().slice(0,10)}.csv`),document.body.appendChild(oe),oe.click(),document.body.removeChild(oe),URL.revokeObjectURL(ce),y(!1),d(!1)},I=async()=>{if(y(!0),$.length===0){Un("error","No prayer times to download."),y(!1),d(!1);return}const J=new Lt({orientation:"portrait",unit:"mm",format:[210,350]}),ae=J.internal.pageSize.getWidth();let me="/img/IRN-logo.png";if(T)try{me=T!=null&&T.startsWith("http")?await W$(T):`data:image/png;base64,${T}`}catch(V){console.warn("Could not convert mosque logo to base64, using fallback.",V)}try{J.addImage(me,"PNG",14,8,30,20)}catch(V){console.warn("Error adding logo to PDF:",V)}const Z=12,ce=14,oe=[O||"Islamic Resource Network",D||"Contact us: info@irn.no",F||"Phone: +47 123 456 789"].filter(Boolean);J.setFontSize(14);const ge=J.getFont().fontName;J.setFont(ge,"bold");const he=oe[0];let U=J.getTextWidth(he);J.text(he,ae-ce-U,Z),J.setFontSize(10),J.setFont(ge,"normal");let j=7;for(let V=1;V<oe.length;V++){const se=oe[V],be=J.getTextWidth(se);J.text(se,ae-ce-be,Z+j*V)}J.setFontSize(16),J.text("Prayer Timetable",14,50);const Y=["Date","Fajr","Sunrise","Dhuhr","Asr","Maghrib","Isha"],K=$.map(V=>[new Date(V.date).toLocaleDateString("en-IN"),V.fajr,V.sunrise,V.dhuhr,V.asr,V.maghrib,V.isha]);Y$(J,{startY:40,head:[Y],body:K,styles:{fontSize:10,cellPadding:2},headStyles:{fillColor:[58,125,68]}});const ie=`prayer-timetable-${new Date().toISOString().slice(0,10)}.pdf`;J.save(ie),y(!1),d(!1)},z=J=>{const ae=new Date(J),me=ae.getDate().toString().padStart(2,"0"),Z=(ae.getMonth()+1).toString().padStart(2,"0"),ce=ae.getFullYear().toString().slice(-2);return`${me}-${Z}-${ce}`};return B?_.jsxs("div",{className:"w-full h-full font-DM flex flex-col justify-between",style:{direction:A?"rtl":"ltr"},children:[_.jsxs("div",{className:"flex-1 border shadow-md rounded-xl px-4 py-1 mb-2 backdrop-blur-md flex flex-col justify-between",style:{color:Q?P.text:n.prayerTimesColor.text,backgroundColor:t?Q?"#ffffff33":n.prayerTimesColor.bg:"#F8F5E9"},children:[t&&!a?_.jsx("div",{className:"flex justify-center items-center py-3 border-b border-[#0000004D]",children:_.jsx("span",{className:`font-medium ${P.text}`,children:"Prayer Timetable"})}):_.jsxs("div",{className:"border-b border-[#0000004D] flex justify-between items-center py-3",children:[t?_.jsx("span",{className:"text-sm sm:text-base font-medium",children:E("PRAYER TIMETABLE")}):_.jsx("img",{src:T!=null&&T.startsWith("http")?T:T?`data:image/png;base64,${T}`:"/default-logo.png",alt:"logo",className:"h-12"}),t?_.jsx("p",{className:`text-sm sm:text-base font-medium ${A?"text-left":"text-right"}`,children:O}):_.jsxs("p",{className:`text-sm font-semibold ${A?"text-left":"text-right"}`,children:[D," ",_.jsx("br",{}),F]})]}),_.jsx("div",{className:"flex-1 overflow-auto px-2",children:_.jsxs("table",{className:"w-full text-sm text-left text-black border-collapse",children:[_.jsx("thead",{className:"bg-white text-xs font-bold border-b border-black/30",children:_.jsxs("tr",{children:[_.jsx("th",{className:`px-4 py-2 ${A?"text-right":"text-left"}`,children:E("DATE")}),_.jsx("th",{className:"px-4 py-2",children:E("FAJR")}),_.jsx("th",{className:"px-4 py-2",children:E("SUNRISE")}),_.jsx("th",{className:"px-4 py-2",children:E("DHUHR")}),_.jsx("th",{className:"px-4 py-2",children:E("ASR")}),_.jsx("th",{className:"px-4 py-2",children:E("MAGHRIB")}),_.jsx("th",{className:"px-4 py-2",children:E("ISHA")})]})}),B?_.jsx("tbody",{children:$.length===0?_.jsx("tr",{children:_.jsx("td",{colSpan:7,className:"text-center py-4",children:"No prayer times available"})}):$.map((J,ae)=>_.jsxs("tr",{className:"border-b bg-white/70",children:[_.jsx("td",{className:`px-4 py-2 font-semibold ${A?"text-right":"text-left"} whitespace-nowrap`,children:z(J.date)}),_.jsx("td",{className:"px-4 py-2",children:J.fajr}),_.jsx("td",{className:"px-4 py-2",children:J.sunrise}),_.jsx("td",{className:"px-4 py-2",children:J.dhuhr}),_.jsx("td",{className:"px-4 py-2",children:J.asr}),_.jsx("td",{className:"px-4 py-2",children:J.maghrib}),_.jsx("td",{className:"px-4 py-2",children:J.isha})]},J.date||ae))}):_.jsx("tbody",{children:_.jsx("tr",{children:_.jsx("td",{colSpan:7,children:_.jsx("div",{className:"flex justify-center items-center h-[200px] w-full",children:_.jsx(Mf,{})})})})})]})}),_.jsx("div",{className:"border-t border-[#0000004D] h-9 flex justify-center items-center",children:_.jsx("span",{className:"text-sm font-semibold",children:!t&&"irn.no"})})]}),_.jsx("div",{className:"mt-3 flex justify-end",children:_.jsx("button",{className:`${P.button} rounded-lg py-2 px-4 text-xs font-medium hover:cursor-pointer`,style:{color:Q?"":n.bgColor,backgroundColor:Q?"":n.textColor},onClick:()=>{t?m(`/${(a==null?void 0:a.value)||982842840}/download-timetable`):d(!0)},children:E(t?"DOWNLOAD TIMETABLE":"DOWNLOAD (CSV/PDF)")})}),h&&_.jsx(G$,{onCSV:ne,onPDF:I,onCancel:()=>d(!1),downloading:g})]}):_.jsx(Mf,{})},Z$={7:{text:"text-white"},8:{text:"text-[#543A14]",backgroundImage:"/img/ud/bg2.png",overlayOpacityClass:"",backgroundColorClass:"bg-[#FFF0DC]/90"},9:{text:"text-[#E5D0AC]",backgroundImage:"/img/ud/bg3.png",overlayOpacityClass:"",backgroundColorClass:"bg-[#6D2323]/97"}},Q$={text:"text-black"},ez=()=>{const{colorScheme:t}=Ii(),e=Pi(),{org_nr:n}=xr(),{udThemeId:r}=bd(n),a=Z$[r]||Q$;return _.jsxs("div",{className:`relative w-full h-screen ${a.text}`,style:{color:t.textColor},children:[_.jsx("div",{className:"absolute inset-0 bg-center pointer-events-none",style:{backgroundImage:t.bgImage?`url('${t.bgImage}')`:void 0,backgroundRepeat:t.bgRepeat??"",backgroundSize:t.bgRepeat?"":"cover",opacity:t.bgOpacity,filter:t.bgRepeat?"":"blur(8px)"}}),_.jsxs("div",{className:"relative h-full z-10 p-4 flex flex-col",style:{backgroundColor:t.bgColor},children:[_.jsxs("div",{className:"flex flex-col",children:[_.jsx(hg,{isHome:!1}),_.jsxs("div",{className:"flex justify-between gap-3 mt-3 mb-3",children:[_.jsx("button",{onClick:()=>e(-1),className:"w-6 h-6 rounded-md flex items-center justify-center mt-2",style:{backgroundColor:t.textColor,color:t.bgColor},children:_.jsx(L2,{})}),_.jsx("div",{className:"flex justify-end",children:_.jsx(O2,{nr:r,isHome:!1})})]})]}),_.jsx("div",{className:"flex-1 overflow-auto",children:_.jsx(iE,{isView:!1})})]})]})},tz=()=>{const{org_nr:t}=xr(),e=Pi(),{udThemeId:n}=bd(t),{colorScheme:r,setPeriodType:a,setPeriodFrom:s,setPeriodTo:l}=Ii();return k.useEffect(()=>{a("Monthly");const u=new Date,c=new Date(u.getFullYear(),u.getMonth(),1),h=new Date(u.getFullYear(),u.getMonth()+1,0);s(c),l(h)},[]),_.jsxs("div",{className:"relative w-full h-screen",style:{color:r.textColor},children:[_.jsx("div",{className:"absolute inset-0 pointer-events-none bg-center",style:{backgroundImage:r.bgImage?`url('${r.bgImage}')`:void 0,backgroundRepeat:r.bgRepeat??"",backgroundSize:r.bgRepeat?"":"cover",opacity:r.bgOpacity,filter:r.bgRepeat?"":"blur(8px)"}}),_.jsxs("div",{className:"relative h-full z-10 p-4 flex flex-col",style:{backgroundColor:r.bgColor},children:[_.jsxs("div",{className:"flex flex-col",children:[_.jsx(hg,{isHome:!1}),_.jsxs("div",{className:"flex justify-between gap-3 mt-3 mb-3",children:[_.jsx("button",{onClick:()=>e(-1),className:"w-6 h-6 rounded-md flex items-center justify-center mt-2",style:{backgroundColor:r.textColor,color:r.bgColor},children:_.jsx(L2,{})}),_.jsx("div",{className:"flex justify-end",children:_.jsx(O2,{nr:n,isHome:!1})})]})]}),_.jsx("div",{className:"flex-1 overflow-auto",children:_.jsx(iE,{isView:!0})})]})]})},nz={7:{container:"bg-[#255F38]",item:"p-3 rounded-md text-left transition",date:"sm:text-lg font-bold pb-2",description:"text-sm sm:text-base font-semibold"},8:{container:"bg-[#F0BB78]",item:"p-3 rounded-md text-left transition",date:"sm:text-lg font-bold pb-2",description:"text-sm sm:text-base font-semibold"},9:{container:"bg-[#FEF9E1]/20 border",item:"p-3 rounded-md text-left transition",date:"sm:text-lg font-bold pb-2",description:"text-sm sm:text-base font-semibold"}},rz=({events:t=[],tn:e=7})=>{const{i18n:n,t:r}=kr(),a=n.language,s=nz[e],{colorScheme:l,hijriMonthNames:u}=Ii(),c=l.isDefault,[h,d]=k.useState(new Map);return k.useEffect(()=>{if(!t||t.length===0)return;const g=t.map(O=>new Date(O.date)),y=new Date(Math.min(...g.map(O=>O.getTime()))),m=new Date(Math.max(...g.map(O=>O.getTime()))),x=new Date(y.getFullYear(),0,1),E=new Date(m.getFullYear(),11,31),A=x.toLocaleDateString("en-CA"),N=E.toLocaleDateString("en-CA");eg(A,N).then(O=>{d(O)}).catch(O=>{console.error("Failed to fetch Hijri dates for events:",O)})},[t]),_.jsx("div",{className:`pb-2 px-2 rounded-lg shadow-md mt- ${s.container}`,style:{color:l.prayerTimesColor.text,backgroundColor:c?"":l.prayerTimesColor.bg},children:_.jsx("div",{className:"flex justify-between items-center",children:_.jsx("div",{children:t.map((g,y)=>{const m=new Date(g.date);let x;if(a==="ar"){const E=m.toLocaleDateString("en-CA"),A=h.get(E);x=A?Mo({hijriDayObj:A,language:a,t:r,hijriMonthNames:u}):""}else{const E=m.toLocaleDateString("en-US",{month:"long"}).toUpperCase(),A=m.getDate(),N=m.getFullYear();x=`${A} ${E} ${N}`}return _.jsxs("div",{className:s.item,children:[_.jsx("h2",{className:`${s.date} font-extrabold text-sm sm:text-base`,children:x}),_.jsx("p",{className:`${s.description} text-[10px] sm:text-xs font-medium leading-tight`,children:g.description})]},y)})})})})},az={7:{text:"text-white font-DM"},8:{text:"text-[#543A14] font-montserrat",bg:"bg-[#FFF0DC]/90"},9:{text:"text-[#FEF9E1] font-ones"}},iz=()=>{const{colorScheme:t,events:e,eventsLoading:n}=Ii(),{t:r}=kr(),a=Pi(),{org_nr:s}=xr(),{udThemeId:l}=bd(s),u=az[l];return n?_.jsx("div",{className:"h-screen",children:_.jsx(Mf,{})}):_.jsxs("div",{className:`relative w-full min-h-screen font-DM ${u.text}`,style:{color:t.textColor},children:[t.bgImage&&_.jsx("div",{className:"absolute inset-0 pointer-events-none min-h-screen",style:{backgroundImage:t.bgImage?`url('${t.bgImage}')`:void 0,backgroundRepeat:t.bgRepeat??"",opacity:t.bgOpacity,filter:t.bgRepeat?"":"blur(8px)"}}),_.jsxs("div",{className:"relative flex flex-col min-h-screen z-10 p-4",style:{backgroundColor:t.bgColor},children:[_.jsx(hg,{isHome:!1}),_.jsxs("div",{className:"flex flex-col md:gap-4",children:[_.jsxs("div",{className:"flex items-center gap-3 py-8",children:[_.jsx("button",{onClick:()=>a(`/${s}`),className:"w-6 h-6 rounded-md flex items-center justify-center",style:{backgroundColor:t.textColor,color:t.bgColor},children:_.jsx(L2,{})}),_.jsx("div",{className:"text-center w-full",children:_.jsx("h2",{className:"text-lg sm:text-xl font-bold",style:{color:t.textColor},children:r("EVENTS & CALENDAR").toUpperCase()})})]}),_.jsxs("div",{className:"flex flex-col md:flex-row gap-4",children:[_.jsx("div",{className:"calendar-container flex-grow",children:_.jsx(nm,{tn:l,showDate:!0})}),_.jsx("div",{className:"md:w-1/2 flex items-center pt-",children:_.jsx("div",{className:"w-full grid gap-2 md:max-h-[calc(100vh-200px)] md:overflow-y-auto",children:e.map((c,h)=>_.jsx(rz,{events:[c],tn:l},h))})})]})]})]})]})},sz=()=>{const t=Pi(),{org_nr:e}=xr(),[n]=GC(),r=n.get("name"),a=n.get("iqamah"),s=n.get("duration"),l=r?{name:r,iqamah:a||""}:null,u=s?Number(s):null;return k.useEffect(()=>{},[l,u,e]),k.useEffect(()=>{if(l&&u&&e){const c=setTimeout(()=>{console.log("Navigating to /:org_nr/masjid after",u,"seconds"),t(`/${e}/masjid`)},u*1e3);return()=>clearTimeout(c)}else console.log("Missing currentPrayer, iqamahDuration, or org_nr, navigating to /:org_nr/masjid"),e?t(`/${e}/masjid`):(console.log("No org_nr, navigating to default /masjid"),t("/masjid"))},[l,u,e,t]),l?_.jsxs("div",{className:"min-h-screen w-full bg-black flex flex-col items-center justify-center gap-12",children:[_.jsxs("div",{className:"bg-black p-8 rounded-lg shadow-lg text-center max-w-md w-full",children:[_.jsx("h1",{className:"text-4xl font-bold text-white mb-6",children:"IQAMAH"}),_.jsx("br",{}),_.jsx("h1",{className:"text-4xl font-bold text-white mb-6",children:"قد قامت الصلاة"}),_.jsx("p",{className:"text-5xl text-white mb-8 font-bold",children:l.name})]}),_.jsxs("div",{className:"flex items-center gap-6 bg-white rounded-[70px] p-6",children:[_.jsx("img",{src:"/img/instruction.jpg",alt:"No Mobile",className:"w-24 h-24 rounded-full object-cover"}),_.jsx("p",{className:"text-3xl text-black font-bold",children:"Please keep your phones OFF or in silent mode"})]})]}):(console.log("No currentPrayer, rendering fallback UI"),_.jsx("div",{className:"min-h-dvh w-full bg-black flex items-center justify-center text-white",children:"No prayer data available."}))};function oz({error:t,resetErrorBoundary:e}){return _.jsx("div",{className:"min-h-screen bg-gradient-to-br from-red-50 to-orange-50 flex items-center justify-center p-8",children:_.jsxs("div",{className:"max-w-md w-full bg-white rounded-2xl shadow-2xl border border-red-100 p-8 text-center",children:[_.jsx("div",{className:"w-24 h-24 mx-auto mb-6 bg-red-100 rounded-2xl flex items-center justify-center",children:_.jsx("svg",{className:"w-12 h-12 text-red-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:_.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.732 16.5c-.77.833.192 2.5 1.732 2.5z"})})}),_.jsx("h2",{className:"text-2xl md:text-3xl font-bold text-gray-900 mb-4",children:"Something went wrong"}),_.jsx("p",{className:"text-gray-600 mb-6 leading-relaxed",children:t.message||"An unexpected error occurred. Please try again."}),_.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 justify-center",children:[_.jsx("button",{onClick:e,className:"px-6 py-3 bg-blue-600 text-white font-medium rounded-xl hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 transition-all duration-200 shadow-lg",children:"Try Again"}),_.jsx("button",{onClick:()=>window.location.reload(),className:"px-6 py-3 bg-gray-100 text-gray-900 font-medium rounded-xl hover:bg-gray-200 focus:outline-none focus:ring-2 focus:ring-gray-500 focus:ring-offset-2 transition-all duration-200",children:"Refresh Page"})]}),_.jsxs("details",{className:"mt-6 p-4 bg-gray-50 rounded-xl border",children:[_.jsx("summary",{className:"cursor-pointer font-medium text-sm text-gray-700 mb-2",children:"Show technical details"}),_.jsx("pre",{className:"text-xs text-red-800 bg-red-50 p-3 rounded font-mono overflow-auto max-h-40",children:t.message}),_.jsx("button",{onClick:()=>navigator.clipboard.writeText(t.message),className:"mt-2 text-xs text-blue-600 hover:underline",children:"Copy error"})]})]})})}const lz=()=>_.jsxs(pj,{fallbackRender:oz,children:[_.jsxs(mC,{children:[_.jsxs(mi,{element:_.jsx(SF,{}),children:[_.jsx(mi,{path:"/:org_nr",element:_.jsx(qx,{})}),_.jsx(mi,{path:"/user",element:_.jsx(mp,{to:"/982842840"})}),_.jsx(mi,{path:"/loc/:loc_id",element:_.jsx(qx,{})}),_.jsx(mi,{path:"/:org_nr/events",element:_.jsx(iz,{})}),_.jsx(mi,{path:"/:org_nr/view-timetable",element:_.jsx(tz,{})}),_.jsx(mi,{path:"/:org_nr/download-timetable",element:_.jsx(ez,{})})]}),_.jsx(mi,{path:"/:org_nr/masjid",element:_.jsx(ek,{})}),_.jsx(mi,{path:"/:org_nr/masjid/iqamah",element:_.jsx(sz,{})}),_.jsx(mi,{path:"/masjid",element:_.jsx(mp,{to:"/982842840/masjid"})}),_.jsx(mi,{path:"/:org_nr/lobby",element:_.jsx(Kk,{})}),_.jsx(mi,{path:"/lobby",element:_.jsx(mp,{to:"/982842840/lobby"})}),_.jsx(mi,{path:"/",element:_.jsx(mp,{to:"/loc/NO0301"})}),_.jsx(mi,{path:"*",element:_.jsx(xF,{})})]}),_.jsx(ZO,{})]});function uz(){const t=BC([{path:"/*",element:_.jsx(lz,{})}]);return _.jsx(QC,{router:t})}EA.createRoot(document.getElementById("root")).render(_.jsx(k.StrictMode,{children:_.jsx(g8,{children:_.jsx(uz,{})})}));export{Ph as _,fz as c,Bm as g};