vendor: 4,552 bytes, lines 1-9
1var sb=e=>{throw TypeError(e)};var OO=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Uf=(e,t,n)=>t.has(e)||sb("Cannot "+n);var K=(e,t,n)=>(Uf(e,t,"read from private field"),n?n.call(e):t.get(e)),Ne=(e,t,n)=>t.has(e)?sb("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),pe=(e,t,n,a)=>(Uf(e,t,"write to private field"),a?a.call(e,n):t.set(e,n),n),ze=(e,t,n)=>(Uf(e,t,"access private method"),n);var ed=(e,t,n,a)=>({set _(i){pe(e,t,i,n)},get _(){return K(e,t,a)}});var sie=OO((_ie,$c)=>{function LO(e,t){for(var n=0;n<t.length;n++){const a=t[n];if(typeof a!="string"&&!Array.isArray(a)){for(const i in a)if(i!=="default"&&!(i in e)){const r=Object.getOwnPropertyDescriptor(a,i);r&&Object.defineProperty(e,i,r.get?r:{enumerable:!0,get:()=>a[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))a(i);new MutationObserver(i=>{for(const r of i)if(r.type==="childList")for(const s of r.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&a(s)}).observe(document,{childList:!0,subtree:!0});function n(i){const r={};return i.integrity&&(r.integrity=i.integrity),i.referrerPolicy&&(r.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?r.credentials="include":i.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function a(i){if(i.ep)return;i.ep=!0;const r=n(i);fetch(i.href,r)}})();var Sh=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Pm(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var _S={exports:{}},Mm={},SS={exports:{}},De={};/** 2 * @license React 3 * react.production.min.js 4 * 5 * Copyright (c) Facebook, Inc. and its 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 bc=Symbol.for("react.element"),DO=Symbol.for("react.portal"),zO=Symbol.for("react.fragment"),FO=Symbol.for("react.strict_mode"),BO=Symbol.for("react.profiler"),KO=Symbol.for("react.provider"),$O=Symbol.for("react.context"),UO=Symbol.for("react.forward_ref"),VO=Symbol.for("react.suspense"),HO=Symbol.for("react.memo"),WO=Symbol.for("react.lazy"),ob=Symbol.iterator;function qO(e){return e===null||typeof e!="object"?null:(e=ob&&e[ob]||e["@@iterator"],typeof e=="function"?e:null)}var NS={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},CS=Object.assign,TS={};function hl(e,t,n){this.props=e,this.context=t,this.refs=TS,this.updater=n||NS}hl.prototype.isReactComponent={};hl.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};hl.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function ES(){}ES.prototype=hl.prototype;function Qw(e,t,n){this.props=e,this.context=t,this.refs=TS,this.updater=n||NS}var Xw=Qw.prototype=new ES;Xw.constructor=Qw;CS(Xw,hl.prototype);Xw.isPureReactComponent=!0;var lb=Array.isArray,AS=Object.prototype.hasOwnProperty,Zw={current:null},PS={key:!0,ref:!0,__self:!0,__source:!0};function MS(e,t,n){var a,i={},r=null,s=null;if(t!=null)for(a in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(r=""+t.key),t)AS.call(t,a)&&!PS.hasOwnProperty(a)&&(i[a]=t[a]);var l=arguments.length-2;if(l===1)i.children=n;else if(1<l){for(var u=Array(l),c=0;c<l;c++)u[c]=arguments[c+2];i.children=u}if(e&&e.defaultProps)for(a in l=e.defaultProps,l)i[a]===void 0&&(i[a]=l[a]);return{$$typeof:bc,type:e,key:r,ref:s,props:i,_owner:Zw.current}}function GO(e,t){return{$$typeof:bc,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function ex(e){return typeof e=="object"&&e!==null&&e.$$typeof===bc}function YO(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var ub=/\/+/g;function Vf(e,t){return typeof e=="object"&&e!==null&&e.key!=null?YO(""+e.key):t.toString(36)}function Jd(e,t,n,a,i){var r=typeof e;(r==="undefined"||r==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(r){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case bc:case DO:s=!0}}
vendor: 10,776 bytes, lines 9-33
9if(s)return s=e,i=i(s),e=a===""?"."+Vf(s,0):a,lb(i)?(n="",e!=null&&(n=e.replace(ub,"$&/")+"/"),Jd(i,t,n,"",function(c){return c})):i!=null&&(ex(i)&&(i=GO(i,n+(!i.key||s&&s.key===i.key?"":(""+i.key).replace(ub,"$&/")+"/")+e)),t.push(i)),1;if(s=0,a=a===""?".":a+":",lb(e))for(var l=0;l<e.length;l++){r=e[l];var u=a+Vf(r,l);s+=Jd(r,t,n,u,i)}else if(u=qO(e),typeof u=="function")for(e=u.call(e),l=0;!(r=e.next()).done;)r=r.value,u=a+Vf(r,l++),s+=Jd(r,t,n,u,i);else if(r==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return s}function td(e,t,n){if(e==null)return e;var a=[],i=0;return Jd(e,a,"","",function(r){return t.call(n,r,i++)}),a}function JO(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var pn={current:null},Qd={transition:null},QO={ReactCurrentDispatcher:pn,ReactCurrentBatchConfig:Qd,ReactCurrentOwner:Zw};function RS(){throw Error("act(...) is not supported in production builds of React.")}De.Children={map:td,forEach:function(e,t,n){td(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return td(e,function(){t++}),t},toArray:function(e){return td(e,function(t){return t})||[]},only:function(e){if(!ex(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};De.Component=hl;De.Fragment=zO;De.Profiler=BO;De.PureComponent=Qw;De.StrictMode=FO;De.Suspense=VO;De.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=QO;De.act=RS;De.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var a=CS({},e.props),i=e.key,r=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(r=t.ref,s=Zw.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(u in t)AS.call(t,u)&&!PS.hasOwnProperty(u)&&(a[u]=t[u]===void 0&&l!==void 0?l[u]:t[u])}var u=arguments.length-2;if(u===1)a.children=n;else if(1<u){l=Array(u);for(var c=0;c<u;c++)l[c]=arguments[c+2];a.children=l}return{$$typeof:bc,type:e.type,key:i,ref:r,props:a,_owner:s}};De.createContext=function(e){return e={$$typeof:$O,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:KO,_context:e},e.Consumer=e};De.createElement=MS;De.createFactory=function(e){var t=MS.bind(null,e);return t.type=e,t};De.createRef=function(){return{current:null}};De.forwardRef=function(e){return{$$typeof:UO,render:e}};De.isValidElement=ex;De.lazy=function(e){return{$$typeof:WO,_payload:{_status:-1,_result:e},_init:JO}};De.memo=function(e,t){return{$$typeof:HO,type:e,compare:t===void 0?null:t}};De.startTransition=function(e){var t=Qd.transition;Qd.transition={};try{e()}finally{Qd.transition=t}};De.unstable_act=RS;De.useCallback=function(e,t){return pn.current.useCallback(e,t)};De.useContext=function(e){return pn.current.useContext(e)};De.useDebugValue=function(){};De.useDeferredValue=function(e){return pn.current.useDeferredValue(e)};De.useEffect=function(e,t){return pn.current.useEffect(e,t)};De.useId=function(){return pn.current.useId()};De.useImperativeHandle=function(e,t,n){return pn.current.useImperativeHandle(e,t,n)};De.useInsertionEffect=function(e,t){return pn.current.useInsertionEffect(e,t)};De.useLayoutEffect=function(e,t){return pn.current.useLayoutEffect(e,t)};De.useMemo=function(e,t){return pn.current.useMemo(e,t)};De.useReducer=function(e,t,n){return pn.current.useReducer(e,t,n)};De.useRef=function(e){return pn.current.useRef(e)};De.useState=function(e){return pn.current.useState(e)};De.useSyncExternalStore=function(e,t,n){return pn.current.useSyncExternalStore(e,t,n)};De.useTransition=function(){return pn.current.useTransition()};De.version="18.3.1";SS.exports=De;var p=SS.exports;const ne=Pm(p),tx=LO({__proto__:null,default:ne},[p]);/** 10 * @license React 11 * react-jsx-runtime.production.min.js 12 * 13 * Copyright (c) Facebook, Inc. and its 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 XO=p,ZO=Symbol.for("react.element"),eL=Symbol.for("react.fragment"),tL=Object.prototype.hasOwnProperty,nL=XO.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,aL={key:!0,ref:!0,__self:!0,__source:!0};function IS(e,t,n){var a,i={},r=null,s=null;n!==void 0&&(r=""+n),t.key!==void 0&&(r=""+t.key),t.ref!==void 0&&(s=t.ref);for(a in t)tL.call(t,a)&&!aL.hasOwnProperty(a)&&(i[a]=t[a]);if(e&&e.defaultProps)for(a in t=e.defaultProps,t)i[a]===void 0&&(i[a]=t[a]);return{$$typeof:ZO,type:e,key:r,ref:s,props:i,_owner:nL.current}}Mm.Fragment=eL;Mm.jsx=IS;Mm.jsxs=IS;_S.exports=Mm;var o=_S.exports,OS={exports:{}},Qn={},LS={exports:{}},DS={};/** 18 * @license React 19 * scheduler.production.min.js 20 * 21 * Copyright (c) Facebook, Inc. and its 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 */(function(e){function t(M,I){var b=M.length;M.push(I);e:for(;0<b;){var C=b-1>>>1,D=M[C];if(0<i(D,I))M[C]=I,M[b]=D,b=C;else break e}}function n(M){return M.length===0?null:M[0]}function a(M){if(M.length===0)return null;var I=M[0],b=M.pop();if(b!==I){M[0]=b;e:for(var C=0,D=M.length,N=D>>>1;C<N;){var J=2*(C+1)-1,re=M[J],ee=J+1,G=M[ee];if(0>i(re,b))ee<D&&0>i(G,re)?(M[C]=G,M[ee]=b,C=ee):(M[C]=re,M[J]=b,C=J);else if(ee<D&&0>i(G,b))M[C]=G,M[ee]=b,C=ee;else break e}}return I}function i(M,I){var b=M.sortIndex-I.sortIndex;return b!==0?b:M.id-I.id}if(typeof performance=="object"&&typeof performance.now=="function"){var r=performance;e.unstable_now=function(){return r.now()}}else{var s=Date,l=s.now();e.unstable_now=function(){return s.now()-l}}var u=[],c=[],h=1,d=null,m=3,f=!1,y=!1,g=!1,x=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function k(M){for(var I=n(c);I!==null;){if(I.callback===null)a(c);else if(I.startTime<=M)a(c),I.sortIndex=I.expirationTime,t(u,I);else break;I=n(c)}}function j(M){if(g=!1,k(M),!y)if(n(u)!==null)y=!0,W(S);else{var I=n(c);I!==null&&B(j,I.startTime-M)}}function S(M,I){y=!1,g&&(g=!1,w(E),E=-1),f=!0;var b=m;try{for(k(I),d=n(u);d!==null&&(!(d.expirationTime>I)||M&&!R());){var C=d.callback;if(typeof C=="function"){d.callback=null,m=d.priorityLevel;var D=C(d.expirationTime<=I);I=e.unstable_now(),typeof D=="function"?d.callback=D:d===n(u)&&a(u),k(I)}else a(u);d=n(u)}if(d!==null)var N=!0;else{var J=n(c);J!==null&&B(j,J.startTime-I),N=!1}return N}finally{d=null,m=b,f=!1}}var _=!1,T=null,E=-1,O=5,A=-1;function R(){return!(e.unstable_now()-A<O)}function F(){if(T!==null){var M=e.unstable_now();A=M;var I=!0;try{I=T(!0,M)}finally{I?Y():(_=!1,T=null)}}else _=!1}var Y;if(typeof v=="function")Y=function(){v(F)};else if(typeof MessageChannel<"u"){var V=new MessageChannel,z=V.port2;V.port1.onmessage=F,Y=function(){z.postMessage(null)}}else Y=function(){x(F,0)};function W(M){T=M,_||(_=!0,Y())}function B(M,I){E=x(function(){M(e.unstable_now())},I)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(M){M.callback=null},e.unstable_continueExecution=function(){y||f||(y=!0,W(S))},e.unstable_forceFrameRate=function(M){0>M||125<M?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):O=0<M?Math.floor(1e3/M):5},e.unstable_getCurrentPriorityLevel=function(){return m},e.unstable_getFirstCallbackNode=function(){return n(u)},e.unstable_next=function(M){switch(m){case 1:case 2:case 3:var I=3;break;default:I=m}var b=m;m=I;try{return M()}finally{m=b}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(M,I){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var b=m;m=M;try{return I()}finally{m=b}},e.unstable_scheduleCallback=function(M,I,b){var C=e.unstable_now();switch(typeof b=="object"&&b!==null?(b=b.delay,b=typeof b=="number"&&0<b?C+b:C):b=C,M){case 1:var D=-1;break;case 2:D=250;break;case 5:D=1073741823;break;case 4:D=1e4;break;default:D=5e3}return D=b+D,M={id:h++,callback:I,priorityLevel:M,startTime:b,expirationTime:D,sortIndex:-1},b>C?(M.sortIndex=b,t(c,M),n(u)===null&&M===n(c)&&(g?(w(E),E=-1):g=!0,B(j,b-C))):(M.sortIndex=D,t(u,M),y||f||(y=!0,W(S))),M},e.unstable_shouldYield=R,e.unstable_wrapCallback=function(M){var I=m;return function(){var b=m;m=I;try{return M.apply(this,arguments)}finally{m=b}}}})(DS);LS.exports=DS;var iL=LS.exports;/** 26 * @license React 27 * react-dom.production.min.js 28 * 29 * Copyright (c) Facebook, Inc. and its 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 rL=p,Yn=iL;function se(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var zS=new Set,Iu={};function Rs(e,t){Go(e,t),Go(e+"Capture",t)}function Go(e,t){for(Iu[e]=t,e=0;e<t.length;e++)zS.add(t[e])}var Ni=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),gg=Object.prototype.hasOwnProperty,sL=/^[: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]*$/,cb={},db={};function oL(e){return gg.call(db,e)?!0:gg.call(cb,e)?!1:sL.test(e)?db[e]=!0:(cb[e]=!0,!1)}function lL(e,t,n,a){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return a?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function uL(e,t,n,a){if(t===null||typeof t>"u"||lL(e,t,n,a))return!0;
vendor: 5,200 bytes, lines 33-34
33if(a)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function gn(e,t,n,a,i,r,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=a,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=r,this.removeEmptyString=s}var Gt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Gt[e]=new gn(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Gt[t]=new gn(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Gt[e]=new gn(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Gt[e]=new gn(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Gt[e]=new gn(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Gt[e]=new gn(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Gt[e]=new gn(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Gt[e]=new gn(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Gt[e]=new gn(e,5,!1,e.toLowerCase(),null,!1,!1)});var nx=/[\-:]([a-z])/g;function ax(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(nx,ax);Gt[t]=new gn(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(nx,ax);Gt[t]=new gn(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(nx,ax);Gt[t]=new gn(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Gt[e]=new gn(e,1,!1,e.toLowerCase(),null,!1,!1)});Gt.xlinkHref=new gn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Gt[e]=new gn(e,1,!1,e.toLowerCase(),null,!0,!0)});function ix(e,t,n,a){var i=Gt.hasOwnProperty(t)?Gt[t]:null;(i!==null?i.type!==0:a||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(uL(t,n,i,a)&&(n=null),a||i===null?oL(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type===3?!1:"":n:(t=i.attributeName,a=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&n===!0?"":""+n,a?e.setAttributeNS(a,t,n):e.setAttribute(t,n))))}var Ri=rL.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,nd=Symbol.for("react.element"),so=Symbol.for("react.portal"),oo=Symbol.for("react.fragment"),rx=Symbol.for("react.strict_mode"),yg=Symbol.for("react.profiler"),FS=Symbol.for("react.provider"),BS=Symbol.for("react.context"),sx=Symbol.for("react.forward_ref"),wg=Symbol.for("react.suspense"),xg=Symbol.for("react.suspense_list"),ox=Symbol.for("react.memo"),Yi=Symbol.for("react.lazy"),KS=Symbol.for("react.offscreen"),hb=Symbol.iterator;function Ll(e){return e===null||typeof e!="object"?null:(e=hb&&e[hb]||e["@@iterator"],typeof e=="function"?e:null)}var xt=Object.assign,Hf;function tu(e){if(Hf===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Hf=t&&t[1]||""}return` 34`+Hf+e}var Wf=!1;function qf(e,t){if(!e||Wf)return"";Wf=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(c){var a=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){a=c}e.call(t.prototype)}else{try{throw Error()}catch(c){a=c}e()}}
vendor: 18,193 bytes, lines 34-37
34catch(c){if(c&&a&&typeof c.stack=="string"){for(var i=c.stack.split(` 35`),r=a.stack.split(` 36`),s=i.length-1,l=r.length-1;1<=s&&0<=l&&i[s]!==r[l];)l--;for(;1<=s&&0<=l;s--,l--)if(i[s]!==r[l]){if(s!==1||l!==1)do if(s--,l--,0>l||i[s]!==r[l]){var u=` 37`+i[s].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}while(1<=s&&0<=l);break}}}finally{Wf=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?tu(e):""}function cL(e){switch(e.tag){case 5:return tu(e.type);case 16:return tu("Lazy");case 13:return tu("Suspense");case 19:return tu("SuspenseList");case 0:case 2:case 15:return e=qf(e.type,!1),e;case 11:return e=qf(e.type.render,!1),e;case 1:return e=qf(e.type,!0),e;default:return""}}function kg(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case oo:return"Fragment";case so:return"Portal";case yg:return"Profiler";case rx:return"StrictMode";case wg:return"Suspense";case xg:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case BS:return(e.displayName||"Context")+".Consumer";case FS:return(e._context.displayName||"Context")+".Provider";case sx:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ox:return t=e.displayName||null,t!==null?t:kg(e.type)||"Memo";case Yi:t=e._payload,e=e._init;try{return kg(e(t))}catch{}}return null}function dL(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return kg(t);case 8:return t===rx?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Sr(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function $S(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function hL(e){var t=$S(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),a=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,r=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(s){a=""+s,r.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return a},setValue:function(s){a=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ad(e){e._valueTracker||(e._valueTracker=hL(e))}function US(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),a="";return e&&(a=$S(e)?e.checked?"true":"false":e.value),e=a,e!==n?(t.setValue(e),!0):!1}function Nh(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function vg(e,t){var n=t.checked;return xt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function mb(e,t){var n=t.defaultValue==null?"":t.defaultValue,a=t.checked!=null?t.checked:t.defaultChecked;n=Sr(t.value!=null?t.value:n),e._wrapperState={initialChecked:a,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function VS(e,t){t=t.checked,t!=null&&ix(e,"checked",t,!1)}function bg(e,t){VS(e,t);var n=Sr(t.value),a=t.type;if(n!=null)a==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(a==="submit"||a==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?jg(e,t.type,n):t.hasOwnProperty("defaultValue")&&jg(e,t.type,Sr(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function fb(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var a=t.type;if(!(a!=="submit"&&a!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function jg(e,t,n){(t!=="number"||Nh(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var nu=Array.isArray;function jo(e,t,n,a){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&a&&(e[n].defaultSelected=!0)}else{for(n=""+Sr(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,a&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function _g(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(se(91));return xt({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function pb(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(se(92));if(nu(n)){if(1<n.length)throw Error(se(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Sr(n)}}function HS(e,t){var n=Sr(t.value),a=Sr(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),a!=null&&(e.defaultValue=""+a)}function gb(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function WS(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Sg(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?WS(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var id,qS=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,a,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,a,i)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(id=id||document.createElement("div"),id.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=id.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Ou(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var hu={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},mL=["Webkit","ms","Moz","O"];Object.keys(hu).forEach(function(e){mL.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),hu[t]=hu[e]})});function GS(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||hu.hasOwnProperty(e)&&hu[e]?(""+t).trim():t+"px"}function YS(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var a=n.indexOf("--")===0,i=GS(n,t[n],a);n==="float"&&(n="cssFloat"),a?e.setProperty(n,i):e[n]=i}}var fL=xt({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Ng(e,t){if(t){if(fL[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(se(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(se(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(se(61))}if(t.style!=null&&typeof t.style!="object")throw Error(se(62))}}function Cg(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Tg=null;function lx(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Eg=null,_o=null,So=null;function yb(e){if(e=Sc(e)){if(typeof Eg!="function")throw Error(se(280));var t=e.stateNode;t&&(t=Dm(t),Eg(e.stateNode,e.type,t))}}function JS(e){_o?So?So.push(e):So=[e]:_o=e}function QS(){if(_o){var e=_o,t=So;if(So=_o=null,yb(e),t)for(e=0;e<t.length;e++)yb(t[e])}}function XS(e,t){return e(t)}function ZS(){}var Gf=!1;function eN(e,t,n){if(Gf)return e(t,n);Gf=!0;try{return XS(e,t,n)}finally{Gf=!1,(_o!==null||So!==null)&&(ZS(),QS())}}function Lu(e,t){var n=e.stateNode;if(n===null)return null;var a=Dm(n);if(a===null)return null;n=a[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(a=!a.disabled)||(e=e.type,a=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!a;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(se(231,t,typeof n));return n}var Ag=!1;if(Ni)try{var Dl={};Object.defineProperty(Dl,"passive",{get:function(){Ag=!0}}),window.addEventListener("test",Dl,Dl),window.removeEventListener("test",Dl,Dl)}catch{Ag=!1}function pL(e,t,n,a,i,r,s,l,u){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(h){this.onError(h)}}var mu=!1,Ch=null,Th=!1,Pg=null,gL={onError:function(e){mu=!0,Ch=e}};function yL(e,t,n,a,i,r,s,l,u){mu=!1,Ch=null,pL.apply(gL,arguments)}function wL(e,t,n,a,i,r,s,l,u){if(yL.apply(this,arguments),mu){if(mu){var c=Ch;mu=!1,Ch=null}else throw Error(se(198));Th||(Th=!0,Pg=c)}}function Is(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function tN(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function wb(e){if(Is(e)!==e)throw Error(se(188))}function xL(e){var t=e.alternate;if(!t){if(t=Is(e),t===null)throw Error(se(188));return t!==e?null:e}for(var n=e,a=t;;){var i=n.return;if(i===null)break;var r=i.alternate;if(r===null){if(a=i.return,a!==null){n=a;continue}break}if(i.child===r.child){for(r=i.child;r;){if(r===n)return wb(i),e;if(r===a)return wb(i),t;r=r.sibling}throw Error(se(188))}if(n.return!==a.return)n=i,a=r;else{for(var s=!1,l=i.child;l;){if(l===n){s=!0,n=i,a=r;break}if(l===a){s=!0,a=i,n=r;break}l=l.sibling}if(!s){for(l=r.child;l;){if(l===n){s=!0,n=r,a=i;break}if(l===a){s=!0,a=r,n=i;break}l=l.sibling}if(!s)throw Error(se(189))}}if(n.alternate!==a)throw Error(se(190))}if(n.tag!==3)throw Error(se(188));return n.stateNode.current===n?e:t}function nN(e){return e=xL(e),e!==null?aN(e):null}function aN(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=aN(e);if(t!==null)return t;e=e.sibling}return null}var iN=Yn.unstable_scheduleCallback,xb=Yn.unstable_cancelCallback,kL=Yn.unstable_shouldYield,vL=Yn.unstable_requestPaint,jt=Yn.unstable_now,bL=Yn.unstable_getCurrentPriorityLevel,ux=Yn.unstable_ImmediatePriority,rN=Yn.unstable_UserBlockingPriority,Eh=Yn.unstable_NormalPriority,jL=Yn.unstable_LowPriority,sN=Yn.unstable_IdlePriority,Rm=null,ai=null;function _L(e){if(ai&&typeof ai.onCommitFiberRoot=="function")try{ai.onCommitFiberRoot(Rm,e,void 0,(e.current.flags&128)===128)}catch{}}var Aa=Math.clz32?Math.clz32:CL,SL=Math.log,NL=Math.LN2;function CL(e){return e>>>=0,e===0?32:31-(SL(e)/NL|0)|0}var rd=64,sd=4194304;function au(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Ah(e,t){var n=e.pendingLanes;if(n===0)return 0;var a=0,i=e.suspendedLanes,r=e.pingedLanes,s=n&268435455;if(s!==0){var l=s&~i;l!==0?a=au(l):(r&=s,r!==0&&(a=au(r)))}else s=n&~i,s!==0?a=au(s):r!==0&&(a=au(r));if(a===0)return 0;if(t!==0&&t!==a&&!(t&i)&&(i=a&-a,r=t&-t,i>=r||i===16&&(r&4194240)!==0))return t;if(a&4&&(a|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=a;0<t;)n=31-Aa(t),i=1<<n,a|=e[n],t&=~i;return a}function TL(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function EL(e,t){for(var n=e.suspendedLanes,a=e.pingedLanes,i=e.expirationTimes,r=e.pendingLanes;0<r;){var s=31-Aa(r),l=1<<s,u=i[s];u===-1?(!(l&n)||l&a)&&(i[s]=TL(l,t)):u<=t&&(e.expiredLanes|=l),r&=~l}}function Mg(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function oN(){var e=rd;return rd<<=1,!(rd&4194240)&&(rd=64),e}function Yf(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function jc(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Aa(t),e[t]=n}function AL(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var a=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-Aa(n),r=1<<i;t[i]=0,a[i]=-1,e[i]=-1,n&=~r}}function cx(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var a=31-Aa(n),i=1<<a;i&t|e[a]&t&&(e[a]|=t),n&=~i}}var Je=0;function lN(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var uN,dx,cN,dN,hN,Rg=!1,od=[],pr=null,gr=null,yr=null,Du=new Map,zu=new Map,Qi=[],PL="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 submit".split(" ");function kb(e,t){switch(e){case"focusin":case"focusout":pr=null;break;case"dragenter":case"dragleave":gr=null;break;case"mouseover":case"mouseout":yr=null;break;case"pointerover":case"pointerout":Du.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":zu.delete(t.pointerId)}}function zl(e,t,n,a,i,r){return e===null||e.nativeEvent!==r?(e={blockedOn:t,domEventName:n,eventSystemFlags:a,nativeEvent:r,targetContainers:[i]},t!==null&&(t=Sc(t),t!==null&&dx(t)),e):(e.eventSystemFlags|=a,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function ML(e,t,n,a,i){switch(t){case"focusin":return pr=zl(pr,e,t,n,a,i),!0;case"dragenter":return gr=zl(gr,e,t,n,a,i),!0;case"mouseover":return yr=zl(yr,e,t,n,a,i),!0;case"pointerover":var r=i.pointerId;return Du.set(r,zl(Du.get(r)||null,e,t,n,a,i)),!0;case"gotpointercapture":return r=i.pointerId,zu.set(r,zl(zu.get(r)||null,e,t,n,a,i)),!0}return!1}function mN(e){var t=Xr(e.target);if(t!==null){var n=Is(t);if(n!==null){if(t=n.tag,t===13){if(t=tN(n),t!==null){e.blockedOn=t,hN(e.priority,function(){cN(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Xd(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Ig(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var a=new n.constructor(n.type,n);Tg=a,n.target.dispatchEvent(a),Tg=null}else return t=Sc(n),t!==null&&dx(t),e.blockedOn=n,!1;t.shift()}return!0}function vb(e,t,n){Xd(e)&&n.delete(t)}function RL(){Rg=!1,pr!==null&&Xd(pr)&&(pr=null),gr!==null&&Xd(gr)&&(gr=null),yr!==null&&Xd(yr)&&(yr=null),Du.forEach(vb),zu.forEach(vb)}function Fl(e,t){e.blockedOn===t&&(e.blockedOn=null,Rg||(Rg=!0,Yn.unstable_scheduleCallback(Yn.unstable_NormalPriority,RL)))}function Fu(e){function t(i){return Fl(i,e)}if(0<od.length){Fl(od[0],e);for(var n=1;n<od.length;n++){var a=od[n];a.blockedOn===e&&(a.blockedOn=null)}}for(pr!==null&&Fl(pr,e),gr!==null&&Fl(gr,e),yr!==null&&Fl(yr,e),Du.forEach(t),zu.forEach(t),n=0;n<Qi.length;n++)a=Qi[n],a.blockedOn===e&&(a.blockedOn=null);for(;0<Qi.length&&(n=Qi[0],n.blockedOn===null);)mN(n),n.blockedOn===null&&Qi.shift()}var No=Ri.ReactCurrentBatchConfig,Ph=!0;function IL(e,t,n,a){var i=Je,r=No.transition;No.transition=null;try{Je=1,hx(e,t,n,a)}finally{Je=i,No.transition=r}}function OL(e,t,n,a){var i=Je,r=No.transition;No.transition=null;try{Je=4,hx(e,t,n,a)}finally{Je=i,No.transition=r}}function hx(e,t,n,a){if(Ph){var i=Ig(e,t,n,a);if(i===null)rp(e,t,a,Mh,n),kb(e,a);else if(ML(i,e,t,n,a))a.stopPropagation();else if(kb(e,a),t&4&&-1<PL.indexOf(e)){for(;i!==null;){var r=Sc(i);if(r!==null&&uN(r),r=Ig(e,t,n,a),r===null&&rp(e,t,a,Mh,n),r===i)break;i=r}i!==null&&a.stopPropagation()}else rp(e,t,a,null,n)}}var Mh=null;function Ig(e,t,n,a){if(Mh=null,e=lx(a),e=Xr(e),e!==null)if(t=Is(e),t===null)e=null;else if(n=t.tag,n===13){if(e=tN(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Mh=e,null}
vendor: 10,163 bytes, line 37
37function fN(e){switch(e){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(bL()){case ux:return 1;case rN:return 4;case Eh:case jL:return 16;case sN:return 536870912;default:return 16}default:return 16}}var ur=null,mx=null,Zd=null;function pN(){if(Zd)return Zd;var e,t=mx,n=t.length,a,i="value"in ur?ur.value:ur.textContent,r=i.length;for(e=0;e<n&&t[e]===i[e];e++);var s=n-e;for(a=1;a<=s&&t[n-a]===i[r-a];a++);return Zd=i.slice(e,1<a?1-a:void 0)}function eh(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function ld(){return!0}function bb(){return!1}function Xn(e){function t(n,a,i,r,s){this._reactName=n,this._targetInst=i,this.type=a,this.nativeEvent=r,this.target=s,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(r):r[l]);return this.isDefaultPrevented=(r.defaultPrevented!=null?r.defaultPrevented:r.returnValue===!1)?ld:bb,this.isPropagationStopped=bb,this}return xt(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=ld)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=ld)},persist:function(){},isPersistent:ld}),t}var ml={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},fx=Xn(ml),_c=xt({},ml,{view:0,detail:0}),LL=Xn(_c),Jf,Qf,Bl,Im=xt({},_c,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:px,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Bl&&(Bl&&e.type==="mousemove"?(Jf=e.screenX-Bl.screenX,Qf=e.screenY-Bl.screenY):Qf=Jf=0,Bl=e),Jf)},movementY:function(e){return"movementY"in e?e.movementY:Qf}}),jb=Xn(Im),DL=xt({},Im,{dataTransfer:0}),zL=Xn(DL),FL=xt({},_c,{relatedTarget:0}),Xf=Xn(FL),BL=xt({},ml,{animationName:0,elapsedTime:0,pseudoElement:0}),KL=Xn(BL),$L=xt({},ml,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),UL=Xn($L),VL=xt({},ml,{data:0}),_b=Xn(VL),HL={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},WL={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"},qL={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function GL(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=qL[e])?!!t[e]:!1}function px(){return GL}var YL=xt({},_c,{key:function(e){if(e.key){var t=HL[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=eh(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?WL[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:px,charCode:function(e){return e.type==="keypress"?eh(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?eh(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),JL=Xn(YL),QL=xt({},Im,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Sb=Xn(QL),XL=xt({},_c,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:px}),ZL=Xn(XL),e5=xt({},ml,{propertyName:0,elapsedTime:0,pseudoElement:0}),t5=Xn(e5),n5=xt({},Im,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),a5=Xn(n5),i5=[9,13,27,32],gx=Ni&&"CompositionEvent"in window,fu=null;Ni&&"documentMode"in document&&(fu=document.documentMode);var r5=Ni&&"TextEvent"in window&&!fu,gN=Ni&&(!gx||fu&&8<fu&&11>=fu),Nb=" ",Cb=!1;function yN(e,t){switch(e){case"keyup":return i5.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function wN(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var lo=!1;function s5(e,t){switch(e){case"compositionend":return wN(t);case"keypress":return t.which!==32?null:(Cb=!0,Nb);case"textInput":return e=t.data,e===Nb&&Cb?null:e;default:return null}}function o5(e,t){if(lo)return e==="compositionend"||!gx&&yN(e,t)?(e=pN(),Zd=mx=ur=null,lo=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return gN&&t.locale!=="ko"?null:t.data;default:return null}}var l5={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 Tb(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!l5[e.type]:t==="textarea"}function xN(e,t,n,a){JS(a),t=Rh(t,"onChange"),0<t.length&&(n=new fx("onChange","change",null,n,a),e.push({event:n,listeners:t}))}var pu=null,Bu=null;function u5(e){AN(e,0)}function Om(e){var t=ho(e);if(US(t))return e}function c5(e,t){if(e==="change")return t}var kN=!1;if(Ni){var Zf;if(Ni){var ep="oninput"in document;if(!ep){var Eb=document.createElement("div");Eb.setAttribute("oninput","return;"),ep=typeof Eb.oninput=="function"}Zf=ep}else Zf=!1;kN=Zf&&(!document.documentMode||9<document.documentMode)}function Ab(){pu&&(pu.detachEvent("onpropertychange",vN),Bu=pu=null)}function vN(e){if(e.propertyName==="value"&&Om(Bu)){var t=[];xN(t,Bu,e,lx(e)),eN(u5,t)}}function d5(e,t,n){e==="focusin"?(Ab(),pu=t,Bu=n,pu.attachEvent("onpropertychange",vN)):e==="focusout"&&Ab()}function h5(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Om(Bu)}function m5(e,t){if(e==="click")return Om(t)}function f5(e,t){if(e==="input"||e==="change")return Om(t)}function p5(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Oa=typeof Object.is=="function"?Object.is:p5;function Ku(e,t){if(Oa(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),a=Object.keys(t);if(n.length!==a.length)return!1;for(a=0;a<n.length;a++){var i=n[a];if(!gg.call(t,i)||!Oa(e[i],t[i]))return!1}return!0}function Pb(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Mb(e,t){var n=Pb(e);e=0;for(var a;n;){if(n.nodeType===3){if(a=e+n.textContent.length,e<=t&&a>=t)return{node:n,offset:t-e};e=a}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Pb(n)}}function bN(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?bN(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function jN(){for(var e=window,t=Nh();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Nh(e.document)}return t}function yx(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function g5(e){var t=jN(),n=e.focusedElem,a=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&bN(n.ownerDocument.documentElement,n)){if(a!==null&&yx(n)){if(t=a.start,e=a.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,r=Math.min(a.start,i);a=a.end===void 0?r:Math.min(a.end,i),!e.extend&&r>a&&(i=a,a=r,r=i),i=Mb(n,r);var s=Mb(n,a);i&&s&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),r>a?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var y5=Ni&&"documentMode"in document&&11>=document.documentMode,uo=null,Og=null,gu=null,Lg=!1;function Rb(e,t,n){var a=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;
vendor: 4,147 bytes, line 37
37Lg||uo==null||uo!==Nh(a)||(a=uo,"selectionStart"in a&&yx(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),gu&&Ku(gu,a)||(gu=a,a=Rh(Og,"onSelect"),0<a.length&&(t=new fx("onSelect","select",null,t,n),e.push({event:t,listeners:a}),t.target=uo)))}function ud(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var co={animationend:ud("Animation","AnimationEnd"),animationiteration:ud("Animation","AnimationIteration"),animationstart:ud("Animation","AnimationStart"),transitionend:ud("Transition","TransitionEnd")},tp={},_N={};Ni&&(_N=document.createElement("div").style,"AnimationEvent"in window||(delete co.animationend.animation,delete co.animationiteration.animation,delete co.animationstart.animation),"TransitionEvent"in window||delete co.transitionend.transition);function Lm(e){if(tp[e])return tp[e];if(!co[e])return e;var t=co[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in _N)return tp[e]=t[n];return e}var SN=Lm("animationend"),NN=Lm("animationiteration"),CN=Lm("animationstart"),TN=Lm("transitionend"),EN=new Map,Ib="abort auxClick 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(" ");function Pr(e,t){EN.set(e,t),Rs(t,[e])}for(var np=0;np<Ib.length;np++){var ap=Ib[np],w5=ap.toLowerCase(),x5=ap[0].toUpperCase()+ap.slice(1);Pr(w5,"on"+x5)}Pr(SN,"onAnimationEnd");Pr(NN,"onAnimationIteration");Pr(CN,"onAnimationStart");Pr("dblclick","onDoubleClick");Pr("focusin","onFocus");Pr("focusout","onBlur");Pr(TN,"onTransitionEnd");Go("onMouseEnter",["mouseout","mouseover"]);Go("onMouseLeave",["mouseout","mouseover"]);Go("onPointerEnter",["pointerout","pointerover"]);Go("onPointerLeave",["pointerout","pointerover"]);Rs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Rs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Rs("onBeforeInput",["compositionend","keypress","textInput","paste"]);Rs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Rs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Rs("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var iu="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(" "),k5=new Set("cancel close invalid load scroll toggle".split(" ").concat(iu));function Ob(e,t,n){var a=e.type||"unknown-event";e.currentTarget=n,wL(a,t,void 0,e),e.currentTarget=null}function AN(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var a=e[n],i=a.event;a=a.listeners;e:{var r=void 0;if(t)for(var s=a.length-1;0<=s;s--){var l=a[s],u=l.instance,c=l.currentTarget;if(l=l.listener,u!==r&&i.isPropagationStopped())break e;Ob(i,l,c),r=u}else for(s=0;s<a.length;s++){if(l=a[s],u=l.instance,c=l.currentTarget,l=l.listener,u!==r&&i.isPropagationStopped())break e;Ob(i,l,c),r=u}}}if(Th)throw e=Pg,Th=!1,Pg=null,e}function lt(e,t){var n=t[Kg];n===void 0&&(n=t[Kg]=new Set);var a=e+"__bubble";n.has(a)||(PN(t,e,2,!1),n.add(a))}function ip(e,t,n){var a=0;t&&(a|=4),PN(n,e,a,t)}var cd="_reactListening"+Math.random().toString(36).slice(2);function $u(e){if(!e[cd]){e[cd]=!0,zS.forEach(function(n){n!=="selectionchange"&&(k5.has(n)||ip(n,!1,e),ip(n,
vendor: 3,119 bytes, line 37
37!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[cd]||(t[cd]=!0,ip("selectionchange",!1,t))}}function PN(e,t,n,a){switch(fN(t)){case 1:var i=IL;break;case 4:i=OL;break;default:i=hx}n=i.bind(null,t,n,e),i=void 0,!Ag||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),a?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function rp(e,t,n,a,i){var r=a;if(!(t&1)&&!(t&2)&&a!==null)e:for(;;){if(a===null)return;var s=a.tag;if(s===3||s===4){var l=a.stateNode.containerInfo;if(l===i||l.nodeType===8&&l.parentNode===i)break;if(s===4)for(s=a.return;s!==null;){var u=s.tag;if((u===3||u===4)&&(u=s.stateNode.containerInfo,u===i||u.nodeType===8&&u.parentNode===i))return;s=s.return}for(;l!==null;){if(s=Xr(l),s===null)return;if(u=s.tag,u===5||u===6){a=r=s;continue e}l=l.parentNode}}a=a.return}eN(function(){var c=r,h=lx(n),d=[];e:{var m=EN.get(e);if(m!==void 0){var f=fx,y=e;switch(e){case"keypress":if(eh(n)===0)break e;case"keydown":case"keyup":f=JL;break;case"focusin":y="focus",f=Xf;break;case"focusout":y="blur",f=Xf;break;case"beforeblur":case"afterblur":f=Xf;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":f=jb;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":f=zL;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":f=ZL;break;case SN:case NN:case CN:f=KL;break;case TN:f=t5;break;case"scroll":f=LL;break;case"wheel":f=a5;break;case"copy":case"cut":case"paste":f=UL;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":f=Sb}var g=(t&4)!==0,x=!g&&e==="scroll",w=g?m!==null?m+"Capture":null:m;g=[];for(var v=c,k;v!==null;){k=v;var j=k.stateNode;if(k.tag===5&&j!==null&&(k=j,w!==null&&(j=Lu(v,w),j!=null&&g.push(Uu(v,j,k)))),x)break;v=v.return}0<g.length&&(m=new f(m,y,null,n,h),d.push({event:m,listeners:g}))}}if(!(t&7)){e:{if(m=e==="mouseover"||e==="pointerover",f=e==="mouseout"||e==="pointerout",m&&n!==Tg&&(y=n.relatedTarget||n.fromElement)&&(Xr(y)||y[Ci]))break e;if((f||m)&&(m=h.window===h?h:(m=h.ownerDocument)?m.defaultView||m.parentWindow:window,f?(y=n.relatedTarget||n.toElement,f=c,y=y?Xr(y):null,y!==null&&(x=Is(y),y!==x||y.tag!==5&&y.tag!==6)&&(y=null)):(f=null,y=c),f!==y)){if(g=jb,j="onMouseLeave",w="onMouseEnter",v="mouse",(e==="pointerout"||e==="pointerover")&&(g=Sb,j="onPointerLeave",w="onPointerEnter",v="pointer"),x=f==null?m:ho(f),k=y==null?m:ho(y),m=new g(j,v+"leave",f,n,h),m.target=x,m.relatedTarget=k,j=null,Xr(h)===c&&(g=new g(w,v+"enter",y,n,h),g.target=k,g.relatedTarget=x,j=g),x=j,f&&y)t:{for(g=f,w=y,v=0,k=g;k;k=Ks(k))v++;for(k=0,j=w;j;j=Ks(j))k++;for(;0<v-k;)g=Ks(g),v--;for(;0<k-v;)w=Ks(w),k--;for(;v--;){if(g===w||w!==null&&g===w.alternate)break t;g=Ks(g),w=Ks(w)}g=null}else g=null;f!==null&&Lb(d,m,f,g,!1),y!==null&&x!==null&&Lb(d,x,y,g,!0)}}
vendor: 7,429 bytes, lines 37-38
37e:{if(m=c?ho(c):window,f=m.nodeName&&m.nodeName.toLowerCase(),f==="select"||f==="input"&&m.type==="file")var S=c5;else if(Tb(m))if(kN)S=f5;else{S=h5;var _=d5}else(f=m.nodeName)&&f.toLowerCase()==="input"&&(m.type==="checkbox"||m.type==="radio")&&(S=m5);if(S&&(S=S(e,c))){xN(d,S,n,h);break e}_&&_(e,m,c),e==="focusout"&&(_=m._wrapperState)&&_.controlled&&m.type==="number"&&jg(m,"number",m.value)}switch(_=c?ho(c):window,e){case"focusin":(Tb(_)||_.contentEditable==="true")&&(uo=_,Og=c,gu=null);break;case"focusout":gu=Og=uo=null;break;case"mousedown":Lg=!0;break;case"contextmenu":case"mouseup":case"dragend":Lg=!1,Rb(d,n,h);break;case"selectionchange":if(y5)break;case"keydown":case"keyup":Rb(d,n,h)}var T;if(gx)e:{switch(e){case"compositionstart":var E="onCompositionStart";break e;case"compositionend":E="onCompositionEnd";break e;case"compositionupdate":E="onCompositionUpdate";break e}E=void 0}else lo?yN(e,n)&&(E="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(E="onCompositionStart");E&&(gN&&n.locale!=="ko"&&(lo||E!=="onCompositionStart"?E==="onCompositionEnd"&&lo&&(T=pN()):(ur=h,mx="value"in ur?ur.value:ur.textContent,lo=!0)),_=Rh(c,E),0<_.length&&(E=new _b(E,e,null,n,h),d.push({event:E,listeners:_}),T?E.data=T:(T=wN(n),T!==null&&(E.data=T)))),(T=r5?s5(e,n):o5(e,n))&&(c=Rh(c,"onBeforeInput"),0<c.length&&(h=new _b("onBeforeInput","beforeinput",null,n,h),d.push({event:h,listeners:c}),h.data=T))}AN(d,t)})}function Uu(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Rh(e,t){for(var n=t+"Capture",a=[];e!==null;){var i=e,r=i.stateNode;i.tag===5&&r!==null&&(i=r,r=Lu(e,n),r!=null&&a.unshift(Uu(e,r,i)),r=Lu(e,t),r!=null&&a.push(Uu(e,r,i))),e=e.return}return a}function Ks(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Lb(e,t,n,a,i){for(var r=t._reactName,s=[];n!==null&&n!==a;){var l=n,u=l.alternate,c=l.stateNode;if(u!==null&&u===a)break;l.tag===5&&c!==null&&(l=c,i?(u=Lu(n,r),u!=null&&s.unshift(Uu(n,u,l))):i||(u=Lu(n,r),u!=null&&s.push(Uu(n,u,l)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var v5=/\r\n?/g,b5=/\u0000|\uFFFD/g;function Db(e){return(typeof e=="string"?e:""+e).replace(v5,` 38`).replace(b5,"")}function dd(e,t,n){if(t=Db(t),Db(e)!==t&&n)throw Error(se(425))}function Ih(){}var Dg=null,zg=null;function Fg(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Bg=typeof setTimeout=="function"?setTimeout:void 0,j5=typeof clearTimeout=="function"?clearTimeout:void 0,zb=typeof Promise=="function"?Promise:void 0,_5=typeof queueMicrotask=="function"?queueMicrotask:typeof zb<"u"?function(e){return zb.resolve(null).then(e).catch(S5)}:Bg;function S5(e){setTimeout(function(){throw e})}function sp(e,t){var n=t,a=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(a===0){e.removeChild(i),Fu(t);return}a--}else n!=="$"&&n!=="$?"&&n!=="$!"||a++;n=i}while(n);Fu(t)}function wr(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function Fb(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var fl=Math.random().toString(36).slice(2),Za="__reactFiber$"+fl,Vu="__reactProps$"+fl,Ci="__reactContainer$"+fl,Kg="__reactEvents$"+fl,N5="__reactListeners$"+fl,C5="__reactHandles$"+fl;function Xr(e){var t=e[Za];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Ci]||n[Za]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Fb(e);e!==null;){if(n=e[Za])return n;e=Fb(e)}return t}e=n,n=e.parentNode}return null}function Sc(e){return e=e[Za]||e[Ci],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function ho(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(se(33))}function Dm(e){return e[Vu]||null}var $g=[],mo=-1;function Mr(e){return{current:e}}function dt(e){0>mo||(e.current=$g[mo],$g[mo]=null,mo--)}function it(e,t){mo++,$g[mo]=e.current,e.current=t}var Nr={},an=Mr(Nr),Cn=Mr(!1),xs=Nr;function Yo(e,t){var n=e.type.contextTypes;if(!n)return Nr;var a=e.stateNode;if(a&&a.__reactInternalMemoizedUnmaskedChildContext===t)return a.__reactInternalMemoizedMaskedChildContext;var i={},r;for(r in n)i[r]=t[r];return a&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Tn(e){return e=e.childContextTypes,e!=null}function Oh(){dt(Cn),dt(an)}function Bb(e,t,n){if(an.current!==Nr)throw Error(se(168));it(an,t),it(Cn,n)}function MN(e,t,n){var a=e.stateNode;if(t=t.childContextTypes,typeof a.getChildContext!="function")return n;a=a.getChildContext();for(var i in a)if(!(i in t))throw Error(se(108,dL(e)||"Unknown",i));return xt({},n,a)}function Lh(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Nr,xs=an.current,it(an,e),it(Cn,Cn.current),!0}function Kb(e,t,n){var a=e.stateNode;if(!a)throw Error(se(169));n?(e=MN(e,t,xs),a.__reactInternalMemoizedMergedChildContext=e,dt(Cn),dt(an),it(an,e)):dt(Cn),it(Cn,n)}var ki=null,zm=!1,op=!1;function RN(e){ki===null?ki=[e]:ki.push(e)}function T5(e){zm=!0,RN(e)}function Rr(){if(!op&&ki!==null){op=!0;var e=0,t=Je;try{var n=ki;for(Je=1;e<n.length;e++){var a=n[e];do a=a(!0);while(a!==null)}ki=null,zm=!1}catch(i){throw ki!==null&&(ki=ki.slice(e+1)),iN(ux,Rr),i}finally{Je=t,op=!1}}return null}var fo=[],po=0,Dh=null,zh=0,na=[],aa=0,ks=null,bi=1,ji="";function Wr(e,t){fo[po++]=zh,fo[po++]=Dh,Dh=e,zh=t}function IN(e,t,n){na[aa++]=bi,na[aa++]=ji,na[aa++]=ks,ks=e;var a=bi;e=ji;var i=32-Aa(a)-1;a&=~(1<<i),n+=1;var r=32-Aa(t)+i;if(30<r){var s=i-i%5;r=(a&(1<<s)-1).toString(32),a>>=s,i-=s,bi=1<<32-Aa(t)+i|n<<i|a,ji=r+e}else bi=1<<r|n<<i|a,ji=e}function wx(e){e.return!==null&&(Wr(e,1),IN(e,1,0))}function xx(e){for(;e===Dh;)Dh=fo[--po],fo[po]=null,zh=fo[--po],fo[po]=null;for(;e===ks;)ks=na[--aa],na[aa]=null,ji=na[--aa],na[aa]=null,bi=na[--aa],na[aa]=null}var Un=null,Bn=null,pt=!1,Ea=null;function ON(e,t){var n=ra(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function $b(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Un=e,Bn=wr(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Un=e,Bn=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=ks!==null?{id:bi,overflow:ji}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=ra(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Un=e,Bn=null,!0):!1;default:return!1}}function Ug(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Vg(e){if(pt){var t=Bn;if(t){var n=t;if(!$b(e,t)){if(Ug(e))throw Error(se(418));t=wr(n.nextSibling);var a=Un;t&&$b(e,t)?ON(a,n):(e.flags=e.flags&-4097|2,pt=!1,Un=e)}}else{if(Ug(e))throw Error(se(418));e.flags=e.flags&-4097|2,pt=!1,Un=e}}}function Ub(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Un=e}function hd(e){if(e!==Un)return!1;if(!pt)return Ub(e),pt=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Fg(e.type,e.memoizedProps)),t&&(t=Bn)){if
vendor: 3,857 bytes, line 38
38(Ug(e))throw LN(),Error(se(418));for(;t;)ON(e,t),t=wr(t.nextSibling)}if(Ub(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(se(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Bn=wr(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Bn=null}}else Bn=Un?wr(e.stateNode.nextSibling):null;return!0}function LN(){for(var e=Bn;e;)e=wr(e.nextSibling)}function Jo(){Bn=Un=null,pt=!1}function kx(e){Ea===null?Ea=[e]:Ea.push(e)}var E5=Ri.ReactCurrentBatchConfig;function Kl(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(se(309));var a=n.stateNode}if(!a)throw Error(se(147,e));var i=a,r=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===r?t.ref:(t=function(s){var l=i.refs;s===null?delete l[r]:l[r]=s},t._stringRef=r,t)}if(typeof e!="string")throw Error(se(284));if(!n._owner)throw Error(se(290,e))}return e}function md(e,t){throw e=Object.prototype.toString.call(t),Error(se(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Vb(e){var t=e._init;return t(e._payload)}function DN(e){function t(w,v){if(e){var k=w.deletions;k===null?(w.deletions=[v],w.flags|=16):k.push(v)}}function n(w,v){if(!e)return null;for(;v!==null;)t(w,v),v=v.sibling;return null}function a(w,v){for(w=new Map;v!==null;)v.key!==null?w.set(v.key,v):w.set(v.index,v),v=v.sibling;return w}function i(w,v){return w=br(w,v),w.index=0,w.sibling=null,w}function r(w,v,k){return w.index=k,e?(k=w.alternate,k!==null?(k=k.index,k<v?(w.flags|=2,v):k):(w.flags|=2,v)):(w.flags|=1048576,v)}function s(w){return e&&w.alternate===null&&(w.flags|=2),w}function l(w,v,k,j){return v===null||v.tag!==6?(v=fp(k,w.mode,j),v.return=w,v):(v=i(v,k),v.return=w,v)}function u(w,v,k,j){var S=k.type;return S===oo?h(w,v,k.props.children,j,k.key):v!==null&&(v.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===Yi&&Vb(S)===v.type)?(j=i(v,k.props),j.ref=Kl(w,v,k),j.return=w,j):(j=oh(k.type,k.key,k.props,null,w.mode,j),j.ref=Kl(w,v,k),j.return=w,j)}function c(w,v,k,j){return v===null||v.tag!==4||v.stateNode.containerInfo!==k.containerInfo||v.stateNode.implementation!==k.implementation?(v=pp(k,w.mode,j),v.return=w,v):(v=i(v,k.children||[]),v.return=w,v)}function h(w,v,k,j,S){return v===null||v.tag!==7?(v=gs(k,w.mode,j,S),v.return=w,v):(v=i(v,k),v.return=w,v)}function d(w,v,k){if(typeof v=="string"&&v!==""||typeof v=="number")return v=fp(""+v,w.mode,k),v.return=w,v;if(typeof v=="object"&&v!==null){switch(v.$$typeof){case nd:return k=oh(v.type,v.key,v.props,null,w.mode,k),k.ref=Kl(w,null,v),k.return=w,k;case so:return v=pp(v,w.mode,k),v.return=w,v;case Yi:var j=v._init;return d(w,j(v._payload),k)}if(nu(v)||Ll(v))return v=gs(v,w.mode,k,null),v.return=w,v;md(w,v)}return null}function m(w,v,k,j){var S=v!==null?v.key:null;if(typeof k=="string"&&k!==""||typeof k=="number")return S!==null?null:l(w,v,""+k,j);if(typeof k=="object"&&k!==null){switch(k.$$typeof){case nd:return k.key===S?u(w,v,k,j):null;case so:return k.key===S?c(w,v,k,j):null;case Yi:return S=k._init,m(w,v,S(k._payload),j)}if(nu(k)||Ll(k))return S!==null?null:h(w,v,k,j,null);md(w,k)}return null}function f(w,v,k,j,S){if(typeof j=="string"&&j!==""||typeof j=="number")return w=w.get(k)||null,l(v,w,""+j,S);if(typeof j=="object"&&j!==null){switch(j.$$typeof){case nd:return w=w.get(j.key===null?k:j.key)||null,u(v,w,j,S);case so:return w=w.get(j.key===null?k:j.key)||null,c(v,w,j,S);case Yi:var _=j._init;return f(w,v,k,_(j._payload),S)}if(nu(j)||Ll(j))return w=w.get(k)||null,h(v,w,j,S,null);md(v,j)}return null}function y(w,v,k,j){for(var S=null,_=null,T=v,E=v=0,O=null;T!==null&&E<k.length;E++){T.index>E?(O=T,T=null):O=T.sibling;var A=m(w,T,k[E],j);if(A===null){T===null&&(T=O);break}
vendor: 1,139 bytes, line 38
38e&&T&&A.alternate===null&&t(w,T),v=r(A,v,E),_===null?S=A:_.sibling=A,_=A,T=O}if(E===k.length)return n(w,T),pt&&Wr(w,E),S;if(T===null){for(;E<k.length;E++)T=d(w,k[E],j),T!==null&&(v=r(T,v,E),_===null?S=T:_.sibling=T,_=T);return pt&&Wr(w,E),S}for(T=a(w,T);E<k.length;E++)O=f(T,w,E,k[E],j),O!==null&&(e&&O.alternate!==null&&T.delete(O.key===null?E:O.key),v=r(O,v,E),_===null?S=O:_.sibling=O,_=O);return e&&T.forEach(function(R){return t(w,R)}),pt&&Wr(w,E),S}function g(w,v,k,j){var S=Ll(k);if(typeof S!="function")throw Error(se(150));if(k=S.call(k),k==null)throw Error(se(151));for(var _=S=null,T=v,E=v=0,O=null,A=k.next();T!==null&&!A.done;E++,A=k.next()){T.index>E?(O=T,T=null):O=T.sibling;var R=m(w,T,A.value,j);if(R===null){T===null&&(T=O);break}e&&T&&R.alternate===null&&t(w,T),v=r(R,v,E),_===null?S=R:_.sibling=R,_=R,T=O}if(A.done)return n(w,T),pt&&Wr(w,E),S;if(T===null){for(;!A.done;E++,A=k.next())A=d(w,A.value,j),A!==null&&(v=r(A,v,E),_===null?S=A:_.sibling=A,_=A);return pt&&Wr(w,E),S}for(T=a(w,T);!A.done;E++,A=k.next())A=f(T,w,E,A.value,j),A!==null&&(e&&A.alternate!==null&&T.delete(A.key===null?E:A.key),v=r(A,v,E),_===null?S=A
vendor: 8,870 bytes, line 38
38:_.sibling=A,_=A);return e&&T.forEach(function(F){return t(w,F)}),pt&&Wr(w,E),S}function x(w,v,k,j){if(typeof k=="object"&&k!==null&&k.type===oo&&k.key===null&&(k=k.props.children),typeof k=="object"&&k!==null){switch(k.$$typeof){case nd:e:{for(var S=k.key,_=v;_!==null;){if(_.key===S){if(S=k.type,S===oo){if(_.tag===7){n(w,_.sibling),v=i(_,k.props.children),v.return=w,w=v;break e}}else if(_.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===Yi&&Vb(S)===_.type){n(w,_.sibling),v=i(_,k.props),v.ref=Kl(w,_,k),v.return=w,w=v;break e}n(w,_);break}else t(w,_);_=_.sibling}k.type===oo?(v=gs(k.props.children,w.mode,j,k.key),v.return=w,w=v):(j=oh(k.type,k.key,k.props,null,w.mode,j),j.ref=Kl(w,v,k),j.return=w,w=j)}return s(w);case so:e:{for(_=k.key;v!==null;){if(v.key===_)if(v.tag===4&&v.stateNode.containerInfo===k.containerInfo&&v.stateNode.implementation===k.implementation){n(w,v.sibling),v=i(v,k.children||[]),v.return=w,w=v;break e}else{n(w,v);break}else t(w,v);v=v.sibling}v=pp(k,w.mode,j),v.return=w,w=v}return s(w);case Yi:return _=k._init,x(w,v,_(k._payload),j)}if(nu(k))return y(w,v,k,j);if(Ll(k))return g(w,v,k,j);md(w,k)}return typeof k=="string"&&k!==""||typeof k=="number"?(k=""+k,v!==null&&v.tag===6?(n(w,v.sibling),v=i(v,k),v.return=w,w=v):(n(w,v),v=fp(k,w.mode,j),v.return=w,w=v),s(w)):n(w,v)}return x}var Qo=DN(!0),zN=DN(!1),Fh=Mr(null),Bh=null,go=null,vx=null;function bx(){vx=go=Bh=null}function jx(e){var t=Fh.current;dt(Fh),e._currentValue=t}function Hg(e,t,n){for(;e!==null;){var a=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,a!==null&&(a.childLanes|=t)):a!==null&&(a.childLanes&t)!==t&&(a.childLanes|=t),e===n)break;e=e.return}}function Co(e,t){Bh=e,vx=go=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Sn=!0),e.firstContext=null)}function da(e){var t=e._currentValue;if(vx!==e)if(e={context:e,memoizedValue:t,next:null},go===null){if(Bh===null)throw Error(se(308));go=e,Bh.dependencies={lanes:0,firstContext:e}}else go=go.next=e;return t}var Zr=null;function _x(e){Zr===null?Zr=[e]:Zr.push(e)}function FN(e,t,n,a){var i=t.interleaved;return i===null?(n.next=n,_x(t)):(n.next=i.next,i.next=n),t.interleaved=n,Ti(e,a)}function Ti(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Ji=!1;function Sx(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function BN(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function _i(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function xr(e,t,n){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,$e&2){var i=a.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),a.pending=t,Ti(e,n)}return i=a.interleaved,i===null?(t.next=t,_x(a)):(t.next=i.next,i.next=t),a.interleaved=t,Ti(e,n)}function th(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var a=t.lanes;a&=e.pendingLanes,n|=a,t.lanes=n,cx(e,n)}}function Hb(e,t){var n=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,n===a)){var i=null,r=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};r===null?i=r=s:r=r.next=s,n=n.next}while(n!==null);r===null?i=r=t:r=r.next=t}else i=r=t;n={baseState:a.baseState,firstBaseUpdate:i,lastBaseUpdate:r,shared:a.shared,effects:a.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Kh(e,t,n,a){var i=e.updateQueue;Ji=!1;var r=i.firstBaseUpdate,s=i.lastBaseUpdate,l=i.shared.pending;if(l!==null){i.shared.pending=null;var u=l,c=u.next;u.next=null,s===null?r=c:s.next=c,s=u;var h=e.alternate;h!==null&&(h=h.updateQueue,l=h.lastBaseUpdate,l!==s&&(l===null?h.firstBaseUpdate=c:l.next=c,h.lastBaseUpdate=u))}if(r!==null){var d=i.baseState;s=0,h=c=u=null,l=r;do{var m=l.lane,f=l.eventTime;if((a&m)===m){h!==null&&(h=h.next={eventTime:f,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var y=e,g=l;switch(m=t,f=n,g.tag){case 1:if(y=g.payload,typeof y=="function"){d=y.call(f,d,m);break e}d=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=g.payload,m=typeof y=="function"?y.call(f,d,m):y,m==null)break e;d=xt({},d,m);break e;case 2:Ji=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,m=i.effects,m===null?i.effects=[l]:m.push(l))}else f={eventTime:f,lane:m,tag:l.tag,payload:l.payload,callback:l.callback,next:null},h===null?(c=h=f,u=d):h=h.next=f,s|=m;if(l=l.next,l===null){if(l=i.shared.pending,l===null)break;m=l,l=m.next,m.next=null,i.lastBaseUpdate=m,i.shared.pending=null}}while(!0);if(h===null&&(u=d),i.baseState=u,i.firstBaseUpdate=c,i.lastBaseUpdate=h,t=i.shared.interleaved,t!==null){i=t;do s|=i.lane,i=i.next;while(i!==t)}else r===null&&(i.shared.lanes=0);bs|=s,e.lanes=s,e.memoizedState=d}}function Wb(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var a=e[t],i=a.callback;if(i!==null){if(a.callback=null,a=n,typeof i!="function")throw Error(se(191,i));i.call(a)}}}var Nc={},ii=Mr(Nc),Hu=Mr(Nc),Wu=Mr(Nc);function es(e){if(e===Nc)throw Error(se(174));return e}function Nx(e,t){switch(it(Wu,t),it(Hu,e),it(ii,Nc),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Sg(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Sg(t,e)}dt(ii),it(ii,t)}function Xo(){dt(ii),dt(Hu),dt(Wu)}function KN(e){es(Wu.current);var t=es(ii.current),n=Sg(t,e.type);t!==n&&(it(Hu,e),it(ii,n))}function Cx(e){Hu.current===e&&(dt(ii),dt(Hu))}var yt=Mr(0);function $h(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var lp=[];function Tx(){for(var e=0;e<lp.length;e++)lp[e]._workInProgressVersionPrimary=null;lp.length=0}var nh=Ri.ReactCurrentDispatcher,up=Ri.ReactCurrentBatchConfig,vs=0,wt=null,Ot=null,Dt=null,Uh=!1,yu=!1,qu=0,A5=0;function Qt(){throw Error(se(321))}function Ex(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Oa(e[n],t[n]))return!1;return!0}function Ax(e,t,n,a,i,r){if(vs=r,wt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,nh.current=e===null||e.memoizedState===null?I5:O5,e=n(a,i),yu){r=0;do{if(yu=!1,qu=0,25<=r)throw Error(se(301));r+=1,Dt=Ot=null,t.updateQueue=null,nh.current=L5,e=n(a,i)}while(yu)}if(nh.current=Vh,t=Ot!==null&&Ot.next!==null,vs=0,Dt=Ot=wt=null,Uh=!1,t)throw Error(se(300));return e}function Px(){var e=qu!==0;return qu=0,e}function Va(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Dt===null?wt.memoizedState=Dt=e:Dt=Dt.next=e,Dt}function ha(){if(Ot===null){var e=wt.alternate;e=e!==null?e.memoizedState:null}else e=Ot.next;var t=Dt===null?wt.memoizedState:Dt.next;if(t!==null)Dt=t,Ot=e;else{if(e===null)throw Error(se(310));Ot=e,e={memoizedState:Ot.memoizedState,baseState:Ot.baseState,baseQueue:Ot.baseQueue,queue:Ot.queue,next:null},Dt===null?wt.memoizedState=Dt=e:Dt=Dt.next=e}return Dt}function Gu(e,t){return typeof t=="function"?t(e):t}function cp(e){var t=ha(),n=t.queue;if(n===null)throw Error(se(311));n.lastRenderedReducer=e;var a=Ot,i=a.baseQueue,r=n.pending;if(r!==null){if(i!==null){var s=i.next;i.next=r.next,r.next=s}a.baseQueue=i=r,n.pending=null}if(i!==null){r=i.next,a=a.baseState;var l=s=null,u=null,c=r;do{var h=c.lane;if((vs&h)===h)u!==null&&(u=u.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),a=c.hasEagerState?c.eagerState:e(a,c.action);else{var d={lane:h,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};u===null?(l=u=d,s=a):u=u.next=d,wt.lanes|=h,bs|=h}c=c.next}while(c!==null&&c!==r);u===null?s=a:u.next=l,Oa(a,t.memoizedState)||(Sn=!0),t.memoizedState=a,t.baseState=s,t.baseQueue=u,n.lastRenderedState=a}if(e=n.interleaved,e!==null){i=e;do r=i.lane,wt.lanes|=r,bs|=r,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function dp(e){var t=ha(),n=t.queue;if(n===null)throw Error(se(311));n.lastRenderedReducer=e;var a=n.dispatch,i=n.pending,r=t.memoizedState;if(i!==null){n.pending=null;var s=i=i.next;do r=e(r,s.action),s=s.next;while(s!==i);Oa(r,t.memoizedState)||(Sn=!0),t.memoizedState=r,t.baseQueue===null&&(t.baseState=r),n.lastRenderedState=r}return[r,a]}function $N(){}
vendor: 4,509 bytes, line 38
38function UN(e,t){var n=wt,a=ha(),i=t(),r=!Oa(a.memoizedState,i);if(r&&(a.memoizedState=i,Sn=!0),a=a.queue,Mx(WN.bind(null,n,a,e),[e]),a.getSnapshot!==t||r||Dt!==null&&Dt.memoizedState.tag&1){if(n.flags|=2048,Yu(9,HN.bind(null,n,a,i,t),void 0,null),zt===null)throw Error(se(349));vs&30||VN(n,t,i)}return i}function VN(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=wt.updateQueue,t===null?(t={lastEffect:null,stores:null},wt.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function HN(e,t,n,a){t.value=n,t.getSnapshot=a,qN(t)&&GN(e)}function WN(e,t,n){return n(function(){qN(t)&&GN(e)})}function qN(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Oa(e,n)}catch{return!0}}function GN(e){var t=Ti(e,1);t!==null&&Pa(t,e,1,-1)}function qb(e){var t=Va();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Gu,lastRenderedState:e},t.queue=e,e=e.dispatch=R5.bind(null,wt,e),[t.memoizedState,e]}function Yu(e,t,n,a){return e={tag:e,create:t,destroy:n,deps:a,next:null},t=wt.updateQueue,t===null?(t={lastEffect:null,stores:null},wt.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(a=n.next,n.next=e,e.next=a,t.lastEffect=e)),e}function YN(){return ha().memoizedState}function ah(e,t,n,a){var i=Va();wt.flags|=e,i.memoizedState=Yu(1|t,n,void 0,a===void 0?null:a)}function Fm(e,t,n,a){var i=ha();a=a===void 0?null:a;var r=void 0;if(Ot!==null){var s=Ot.memoizedState;if(r=s.destroy,a!==null&&Ex(a,s.deps)){i.memoizedState=Yu(t,n,r,a);return}}wt.flags|=e,i.memoizedState=Yu(1|t,n,r,a)}function Gb(e,t){return ah(8390656,8,e,t)}function Mx(e,t){return Fm(2048,8,e,t)}function JN(e,t){return Fm(4,2,e,t)}function QN(e,t){return Fm(4,4,e,t)}function XN(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function ZN(e,t,n){return n=n!=null?n.concat([e]):null,Fm(4,4,XN.bind(null,t,e),n)}function Rx(){}function eC(e,t){var n=ha();t=t===void 0?null:t;var a=n.memoizedState;return a!==null&&t!==null&&Ex(t,a[1])?a[0]:(n.memoizedState=[e,t],e)}function tC(e,t){var n=ha();t=t===void 0?null:t;var a=n.memoizedState;return a!==null&&t!==null&&Ex(t,a[1])?a[0]:(e=e(),n.memoizedState=[e,t],e)}function nC(e,t,n){return vs&21?(Oa(n,t)||(n=oN(),wt.lanes|=n,bs|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Sn=!0),e.memoizedState=n)}function P5(e,t){var n=Je;Je=n!==0&&4>n?n:4,e(!0);var a=up.transition;up.transition={};try{e(!1),t()}finally{Je=n,up.transition=a}}function aC(){return ha().memoizedState}function M5(e,t,n){var a=vr(e);if(n={lane:a,action:n,hasEagerState:!1,eagerState:null,next:null},iC(e))rC(t,n);else if(n=FN(e,t,n,a),n!==null){var i=mn();Pa(n,e,a,i),sC(n,t,a)}}function R5(e,t,n){var a=vr(e),i={lane:a,action:n,hasEagerState:!1,eagerState:null,next:null};if(iC(e))rC(t,i);else{var r=e.alternate;if(e.lanes===0&&(r===null||r.lanes===0)&&(r=t.lastRenderedReducer,r!==null))try{var s=t.lastRenderedState,l=r(s,n);if(i.hasEagerState=!0,i.eagerState=l,Oa(l,s)){var u=t.interleaved;u===null?(i.next=i,_x(t)):(i.next=u.next,u.next=i),t.interleaved=i;return}}catch{}finally{}n=FN(e,t,i,a),n!==null&&(i=mn(),Pa(n,e,a,i),sC(n,t,a))}}function iC(e){var t=e.alternate;return e===wt||t!==null&&t===wt}function rC(e,t){yu=Uh=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function sC(e,t,n){if(n&4194240){var a=t.lanes;a&=e.pendingLanes,n|=a,t.lanes=n,cx(e,n)}}var Vh={readContext:da,useCallback:Qt,useContext:Qt,useEffect:Qt,useImperativeHandle:Qt,useInsertionEffect:Qt,useLayoutEffect:Qt,useMemo:Qt,useReducer:Qt,useRef:Qt,useState:Qt,useDebugValue:Qt,useDeferredValue:Qt,useTransition:Qt,useMutableSource:Qt,useSyncExternalStore:Qt,useId:Qt,unstable_isNewReconciler:!1},I5={readContext:da,useCallback:function(e,t){return Va().memoizedState=[e,t===void 0?null:t],e},useContext:da,useEffect:Gb,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,ah(4194308,4,XN.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ah(4194308,4,e,t)},useInsertionEffect:function(e,t){return ah(4,2,e,t)},useMemo:function(e,t){var n=Va();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var a=Va();return t=n!==void 0?n(t):t,a.memoizedState=a.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},a.queue=e,e=e.dispatch=M5.bind(null,wt,e),[a.memoizedState,e]}
vendor: 7,433 bytes, lines 38-40
38,useRef:function(e){var t=Va();return e={current:e},t.memoizedState=e},useState:qb,useDebugValue:Rx,useDeferredValue:function(e){return Va().memoizedState=e},useTransition:function(){var e=qb(!1),t=e[0];return e=P5.bind(null,e[1]),Va().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var a=wt,i=Va();if(pt){if(n===void 0)throw Error(se(407));n=n()}else{if(n=t(),zt===null)throw Error(se(349));vs&30||VN(a,t,n)}i.memoizedState=n;var r={value:n,getSnapshot:t};return i.queue=r,Gb(WN.bind(null,a,r,e),[e]),a.flags|=2048,Yu(9,HN.bind(null,a,r,n,t),void 0,null),n},useId:function(){var e=Va(),t=zt.identifierPrefix;if(pt){var n=ji,a=bi;n=(a&~(1<<32-Aa(a)-1)).toString(32)+n,t=":"+t+"R"+n,n=qu++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=A5++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},O5={readContext:da,useCallback:eC,useContext:da,useEffect:Mx,useImperativeHandle:ZN,useInsertionEffect:JN,useLayoutEffect:QN,useMemo:tC,useReducer:cp,useRef:YN,useState:function(){return cp(Gu)},useDebugValue:Rx,useDeferredValue:function(e){var t=ha();return nC(t,Ot.memoizedState,e)},useTransition:function(){var e=cp(Gu)[0],t=ha().memoizedState;return[e,t]},useMutableSource:$N,useSyncExternalStore:UN,useId:aC,unstable_isNewReconciler:!1},L5={readContext:da,useCallback:eC,useContext:da,useEffect:Mx,useImperativeHandle:ZN,useInsertionEffect:JN,useLayoutEffect:QN,useMemo:tC,useReducer:dp,useRef:YN,useState:function(){return dp(Gu)},useDebugValue:Rx,useDeferredValue:function(e){var t=ha();return Ot===null?t.memoizedState=e:nC(t,Ot.memoizedState,e)},useTransition:function(){var e=dp(Gu)[0],t=ha().memoizedState;return[e,t]},useMutableSource:$N,useSyncExternalStore:UN,useId:aC,unstable_isNewReconciler:!1};function _a(e,t){if(e&&e.defaultProps){t=xt({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Wg(e,t,n,a){t=e.memoizedState,n=n(a,t),n=n==null?t:xt({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Bm={isMounted:function(e){return(e=e._reactInternals)?Is(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var a=mn(),i=vr(e),r=_i(a,i);r.payload=t,n!=null&&(r.callback=n),t=xr(e,r,i),t!==null&&(Pa(t,e,i,a),th(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var a=mn(),i=vr(e),r=_i(a,i);r.tag=1,r.payload=t,n!=null&&(r.callback=n),t=xr(e,r,i),t!==null&&(Pa(t,e,i,a),th(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=mn(),a=vr(e),i=_i(n,a);i.tag=2,t!=null&&(i.callback=t),t=xr(e,i,a),t!==null&&(Pa(t,e,a,n),th(t,e,a))}};function Yb(e,t,n,a,i,r,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(a,r,s):t.prototype&&t.prototype.isPureReactComponent?!Ku(n,a)||!Ku(i,r):!0}function oC(e,t,n){var a=!1,i=Nr,r=t.contextType;return typeof r=="object"&&r!==null?r=da(r):(i=Tn(t)?xs:an.current,a=t.contextTypes,r=(a=a!=null)?Yo(e,i):Nr),t=new t(n,r),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Bm,e.stateNode=t,t._reactInternals=e,a&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=r),t}function Jb(e,t,n,a){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,a),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,a),t.state!==e&&Bm.enqueueReplaceState(t,t.state,null)}function qg(e,t,n,a){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},Sx(e);var r=t.contextType;typeof r=="object"&&r!==null?i.context=da(r):(r=Tn(t)?xs:an.current,i.context=Yo(e,r)),i.state=e.memoizedState,r=t.getDerivedStateFromProps,typeof r=="function"&&(Wg(e,t,r,n),i.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(t=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),t!==i.state&&Bm.enqueueReplaceState(i,i.state,null),Kh(e,n,i,a),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function Zo(e,t){try{var n="",a=t;do n+=cL(a),a=a.return;while(a);var i=n}catch(r){i=` 39Error generating stack: `+r.message+` 40`+r.stack}return{value:e,source:t,stack:i,digest:null}}function hp(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Gg(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var D5=typeof WeakMap=="function"?WeakMap:Map;function lC(e,t,n){n=_i(-1,n),n.tag=3,n.payload={element:null};var a=t.value;return n.callback=function(){Wh||(Wh=!0,iy=a),Gg(e,t)},n}function uC(e,t,n){n=_i(-1,n),n.tag=3;var a=e.type.getDerivedStateFromError;if(typeof a=="function"){var i=t.value;n.payload=function(){return a(i)},n.callback=function(){Gg(e,t)}}var r=e.stateNode;return r!==null&&typeof r.componentDidCatch=="function"&&(n.callback=function(){Gg(e,t),typeof a!="function"&&(kr===null?kr=new Set([this]):kr.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function Qb(e,t,n){var a=e.pingCache;if(a===null){a=e.pingCache=new D5;var i=new Set;a.set(t,i)}else i=a.get(t),i===void 0&&(i=new Set,a.set(t,i));i.has(n)||(i.add(n),e=Q5.bind(null,e,t,n),t.then(e,e))}function Xb(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Zb(e,t,n,a,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=_i(-1,1),t.tag=2,xr(n,t,1))),n.lanes|=1),e)}var z5=Ri.ReactCurrentOwner,Sn=!1;function un(e,t,n,a){t.child=e===null?zN(t,null,n,a):Qo(t,e.child,n,a)}function e0(e,t,n,a,i){n=n.render;var r=t.ref;return Co(t,i),a=Ax(e,t,n,a,r,i),n=Px(),e!==null&&!Sn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Ei(e,t,i)):(pt&&n&&wx(t),t.flags|=1,un(e,t,a,i),t.child)}function t0(e,t,n,a,i){if(e===null){var r=n.type;return typeof r=="function"&&!Kx(r)&&r.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=r,cC(e,t,r,a,i)):(e=oh(n.type,null,a,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(r=e.child,!(e.lanes&i)){var s=r.memoizedProps;if(n=n.compare,n=n!==null?n:Ku,n(s,a)&&e.ref===t.ref)return Ei(e,t,i)}return t.flags|=1,e=br(r,a),e.ref=t.ref,e.return=t,t.child=e}function cC(e,t,n,a,i){if(e!==null){var r=e.memoizedProps;if(Ku(r,a)&&e.ref===t.ref)if(Sn=!1,t.pendingProps=a=r,(e.lanes&i)!==0)e.flags&131072&&(Sn=!0);else return t.lanes=e.lanes,Ei(e,t,i)}return Yg(e,t,n,a,i)}function dC(e,t,n){var a=t.pendingProps,i=a.children,r=e!==null?e.memoizedState:null;if(a.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},it(wo,Dn),Dn|=n;else{if(!(n&1073741824))return e=r!==null?r.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,it(wo,Dn),Dn|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},a=r!==null?r.baseLanes:n,it(wo,Dn),Dn|=a}else r!==null?(a=r.baseLanes|n,t.memoizedState=null):a=n,it(wo,Dn),Dn|=a;return un(e,t,i,n),t.child}function hC(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}
vendor: 8,750 bytes, line 40
40function Yg(e,t,n,a,i){var r=Tn(n)?xs:an.current;return r=Yo(t,r),Co(t,i),n=Ax(e,t,n,a,r,i),a=Px(),e!==null&&!Sn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Ei(e,t,i)):(pt&&a&&wx(t),t.flags|=1,un(e,t,n,i),t.child)}function n0(e,t,n,a,i){if(Tn(n)){var r=!0;Lh(t)}else r=!1;if(Co(t,i),t.stateNode===null)ih(e,t),oC(t,n,a),qg(t,n,a,i),a=!0;else if(e===null){var s=t.stateNode,l=t.memoizedProps;s.props=l;var u=s.context,c=n.contextType;typeof c=="object"&&c!==null?c=da(c):(c=Tn(n)?xs:an.current,c=Yo(t,c));var h=n.getDerivedStateFromProps,d=typeof h=="function"||typeof s.getSnapshotBeforeUpdate=="function";d||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l!==a||u!==c)&&Jb(t,s,a,c),Ji=!1;var m=t.memoizedState;s.state=m,Kh(t,a,s,i),u=t.memoizedState,l!==a||m!==u||Cn.current||Ji?(typeof h=="function"&&(Wg(t,n,h,a),u=t.memoizedState),(l=Ji||Yb(t,n,l,a,m,u,c))?(d||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"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=a,t.memoizedState=u),s.props=a,s.state=u,s.context=c,a=l):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),a=!1)}else{s=t.stateNode,BN(e,t),l=t.memoizedProps,c=t.type===t.elementType?l:_a(t.type,l),s.props=c,d=t.pendingProps,m=s.context,u=n.contextType,typeof u=="object"&&u!==null?u=da(u):(u=Tn(n)?xs:an.current,u=Yo(t,u));var f=n.getDerivedStateFromProps;(h=typeof f=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l!==d||m!==u)&&Jb(t,s,a,u),Ji=!1,m=t.memoizedState,s.state=m,Kh(t,a,s,i);var y=t.memoizedState;l!==d||m!==y||Cn.current||Ji?(typeof f=="function"&&(Wg(t,n,f,a),y=t.memoizedState),(c=Ji||Yb(t,n,c,a,m,y,u)||!1)?(h||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(a,y,u),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(a,y,u)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||l===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),t.memoizedProps=a,t.memoizedState=y),s.props=a,s.state=y,s.context=u,a=c):(typeof s.componentDidUpdate!="function"||l===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),a=!1)}return Jg(e,t,n,a,r,i)}function Jg(e,t,n,a,i,r){hC(e,t);var s=(t.flags&128)!==0;if(!a&&!s)return i&&Kb(t,n,!1),Ei(e,t,r);a=t.stateNode,z5.current=t;var l=s&&typeof n.getDerivedStateFromError!="function"?null:a.render();return t.flags|=1,e!==null&&s?(t.child=Qo(t,e.child,null,r),t.child=Qo(t,null,l,r)):un(e,t,l,r),t.memoizedState=a.state,i&&Kb(t,n,!0),t.child}function mC(e){var t=e.stateNode;t.pendingContext?Bb(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Bb(e,t.context,!1),Nx(e,t.containerInfo)}function a0(e,t,n,a,i){return Jo(),kx(i),t.flags|=256,un(e,t,n,a),t.child}var Qg={dehydrated:null,treeContext:null,retryLane:0};function Xg(e){return{baseLanes:e,cachePool:null,transitions:null}}function fC(e,t,n){var a=t.pendingProps,i=yt.current,r=!1,s=(t.flags&128)!==0,l;if((l=s)||(l=e!==null&&e.memoizedState===null?!1:(i&2)!==0),l?(r=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),it(yt,i&1),e===null)return Vg(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(s=a.children,e=a.fallback,r?(a=t.mode,r=t.child,s={mode:"hidden",children:s},!(a&1)&&r!==null?(r.childLanes=0,r.pendingProps=s):r=Um(s,a,0,null),e=gs(e,a,n,null),r.return=t,e.return=t,r.sibling=e,t.child=r,t.child.memoizedState=Xg(n),t.memoizedState=Qg,e):Ix(t,s));if(i=e.memoizedState,i!==null&&(l=i.dehydrated,l!==null))return F5(e,t,s,a,l,i,n);if(r){r=a.fallback,s=t.mode,i=e.child,l=i.sibling;var u={mode:"hidden",children:a.children};return!(s&1)&&t.child!==i?(a=t.child,a.childLanes=0,a.pendingProps=u,t.deletions=null):(a=br(i,u),a.subtreeFlags=i.subtreeFlags&14680064),l!==null?r=br(l,r):(r=gs(r,s,n,null),r.flags|=2),r.return=t,a.return=t,a.sibling=r,t.child=a,a=r,r=t.child,s=e.child.memoizedState,s=s===null?Xg(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},r.memoizedState=s,r.childLanes=e.childLanes&~n,t.memoizedState=Qg,a}return r=e.child,e=r.sibling,a=br(r,{mode:"visible",children:a.children}),!(t.mode&1)&&(a.lanes=n),a.return=t,a.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=a,t.memoizedState=null,a}function Ix(e,t){return t=Um({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function fd(e,t,n,a){return a!==null&&kx(a),Qo(t,e.child,null,n),e=Ix(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function F5(e,t,n,a,i,r,s){if(n)return t.flags&256?(t.flags&=-257,a=hp(Error(se(422))),fd(e,t,s,a)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(r=a.fallback,i=t.mode,a=Um({mode:"visible",children:a.children},i,0,null),r=gs(r,i,s,null),r.flags|=2,a.return=t,r.return=t,a.sibling=r,t.child=a,t.mode&1&&Qo(t,e.child,null,s),t.child.memoizedState=Xg(s),t.memoizedState=Qg,r);if(!(t.mode&1))return fd(e,t,s,null);if(i.data==="$!"){if(a=i.nextSibling&&i.nextSibling.dataset,a)var l=a.dgst;return a=l,r=Error(se(419)),a=hp(r,a,void 0),fd(e,t,s,a)}if(l=(s&e.childLanes)!==0,Sn||l){if(a=zt,a!==null){switch(s&-s){case 4:i=2;break;case 16:i=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(a.suspendedLanes|s)?0:i,i!==0&&i!==r.retryLane&&(r.retryLane=i,Ti(e,i),Pa(a,e,i,-1))}return Bx(),a=hp(Error(se(421))),fd(e,t,s,a)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=X5.bind(null,e),i._reactRetry=t,null):(e=r.treeContext,Bn=wr(i.nextSibling),Un=t,pt=!0,Ea=null,e!==null&&(na[aa++]=bi,na[aa++]=ji,na[aa++]=ks,bi=e.id,ji=e.overflow,ks=t),t=Ix(t,a.children),t.flags|=4096,t)}function i0(e,t,n){e.lanes|=t;var a=e.alternate;a!==null&&(a.lanes|=t),Hg(e.return,t,n)}function mp(e,t,n,a,i){var r=e.memoizedState;r===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:a,tail:n,tailMode:i}:(r.isBackwards=t,r.rendering=null,r.renderingStartTime=0,r.last=a,r.tail=n,r.tailMode=i)}function pC(e,t,n){var a=t.pendingProps,i=a.revealOrder,r=a.tail;if(un(e,t,a.children,n),a=yt.current,a&2)a=a&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&i0(e,n,t);else if(e.tag===19)i0(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}a&=1}if(it(yt,a),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&$h(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),mp(t,!1,i,n,r);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&$h(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}mp(t,!0,n,null,r);break;case"together":mp(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function ih(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Ei(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),bs|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(se(153));if(t.child!==null){for(e=t.child,n=br(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=br(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function B5(e,t,n){switch(t.tag){case 3:mC(t),Jo();break;case 5:KN(t);break;case 1:Tn(t.type)&&Lh(t);break;case 4:Nx(t,t.stateNode.containerInfo);break;case 10:var a=t.type._context,i=t.memoizedProps.value;it(Fh,a._currentValue),a._currentValue=i;break;case 13:if(a=t.memoizedState,a!==null)return a.dehydrated!==null?(it(yt,yt.current&1),t.flags|=128,null):n&t.child.childLanes?fC(e,t,n
vendor: 2,603 bytes, line 40
40):(it(yt,yt.current&1),e=Ei(e,t,n),e!==null?e.sibling:null);it(yt,yt.current&1);break;case 19:if(a=(n&t.childLanes)!==0,e.flags&128){if(a)return pC(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),it(yt,yt.current),a)break;return null;case 22:case 23:return t.lanes=0,dC(e,t,n)}return Ei(e,t,n)}var gC,Zg,yC,wC;gC=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Zg=function(){};yC=function(e,t,n,a){var i=e.memoizedProps;if(i!==a){e=t.stateNode,es(ii.current);var r=null;switch(n){case"input":i=vg(e,i),a=vg(e,a),r=[];break;case"select":i=xt({},i,{value:void 0}),a=xt({},a,{value:void 0}),r=[];break;case"textarea":i=_g(e,i),a=_g(e,a),r=[];break;default:typeof i.onClick!="function"&&typeof a.onClick=="function"&&(e.onclick=Ih)}Ng(n,a);var s;n=null;for(c in i)if(!a.hasOwnProperty(c)&&i.hasOwnProperty(c)&&i[c]!=null)if(c==="style"){var l=i[c];for(s in l)l.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(Iu.hasOwnProperty(c)?r||(r=[]):(r=r||[]).push(c,null));for(c in a){var u=a[c];if(l=i!=null?i[c]:void 0,a.hasOwnProperty(c)&&u!==l&&(u!=null||l!=null))if(c==="style")if(l){for(s in l)!l.hasOwnProperty(s)||u&&u.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in u)u.hasOwnProperty(s)&&l[s]!==u[s]&&(n||(n={}),n[s]=u[s])}else n||(r||(r=[]),r.push(c,n)),n=u;else c==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,l=l?l.__html:void 0,u!=null&&l!==u&&(r=r||[]).push(c,u)):c==="children"?typeof u!="string"&&typeof u!="number"||(r=r||[]).push(c,""+u):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(Iu.hasOwnProperty(c)?(u!=null&&c==="onScroll"&<("scroll",e),r||l===u||(r=[])):(r=r||[]).push(c,u))}n&&(r=r||[]).push("style",n);var c=r;(t.updateQueue=c)&&(t.flags|=4)}};wC=function(e,t,n,a){n!==a&&(t.flags|=4)};function $l(e,t){if(!pt)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var a=null;n!==null;)n.alternate!==null&&(a=n),n=n.sibling;a===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:a.sibling=null}}function Xt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,a=0;if(t)for(var i=e.child;i!==null;
vendor: 31,406 bytes, line 40
40)n|=i.lanes|i.childLanes,a|=i.subtreeFlags&14680064,a|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,a|=i.subtreeFlags,a|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=a,e.childLanes=n,t}function K5(e,t,n){var a=t.pendingProps;switch(xx(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Xt(t),null;case 1:return Tn(t.type)&&Oh(),Xt(t),null;case 3:return a=t.stateNode,Xo(),dt(Cn),dt(an),Tx(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(hd(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ea!==null&&(oy(Ea),Ea=null))),Zg(e,t),Xt(t),null;case 5:Cx(t);var i=es(Wu.current);if(n=t.type,e!==null&&t.stateNode!=null)yC(e,t,n,a,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!a){if(t.stateNode===null)throw Error(se(166));return Xt(t),null}if(e=es(ii.current),hd(t)){a=t.stateNode,n=t.type;var r=t.memoizedProps;switch(a[Za]=t,a[Vu]=r,e=(t.mode&1)!==0,n){case"dialog":lt("cancel",a),lt("close",a);break;case"iframe":case"object":case"embed":lt("load",a);break;case"video":case"audio":for(i=0;i<iu.length;i++)lt(iu[i],a);break;case"source":lt("error",a);break;case"img":case"image":case"link":lt("error",a),lt("load",a);break;case"details":lt("toggle",a);break;case"input":mb(a,r),lt("invalid",a);break;case"select":a._wrapperState={wasMultiple:!!r.multiple},lt("invalid",a);break;case"textarea":pb(a,r),lt("invalid",a)}Ng(n,r),i=null;for(var s in r)if(r.hasOwnProperty(s)){var l=r[s];s==="children"?typeof l=="string"?a.textContent!==l&&(r.suppressHydrationWarning!==!0&&dd(a.textContent,l,e),i=["children",l]):typeof l=="number"&&a.textContent!==""+l&&(r.suppressHydrationWarning!==!0&&dd(a.textContent,l,e),i=["children",""+l]):Iu.hasOwnProperty(s)&&l!=null&&s==="onScroll"&<("scroll",a)}switch(n){case"input":ad(a),fb(a,r,!0);break;case"textarea":ad(a),gb(a);break;case"select":case"option":break;default:typeof r.onClick=="function"&&(a.onclick=Ih)}a=i,t.updateQueue=a,a!==null&&(t.flags|=4)}else{s=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=WS(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=s.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof a.is=="string"?e=s.createElement(n,{is:a.is}):(e=s.createElement(n),n==="select"&&(s=e,a.multiple?s.multiple=!0:a.size&&(s.size=a.size))):e=s.createElementNS(e,n),e[Za]=t,e[Vu]=a,gC(e,t,!1,!1),t.stateNode=e;e:{switch(s=Cg(n,a),n){case"dialog":lt("cancel",e),lt("close",e),i=a;break;case"iframe":case"object":case"embed":lt("load",e),i=a;break;case"video":case"audio":for(i=0;i<iu.length;i++)lt(iu[i],e);i=a;break;case"source":lt("error",e),i=a;break;case"img":case"image":case"link":lt("error",e),lt("load",e),i=a;break;case"details":lt("toggle",e),i=a;break;case"input":mb(e,a),i=vg(e,a),lt("invalid",e);break;case"option":i=a;break;case"select":e._wrapperState={wasMultiple:!!a.multiple},i=xt({},a,{value:void 0}),lt("invalid",e);break;case"textarea":pb(e,a),i=_g(e,a),lt("invalid",e);break;default:i=a}Ng(n,i),l=i;for(r in l)if(l.hasOwnProperty(r)){var u=l[r];r==="style"?YS(e,u):r==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,u!=null&&qS(e,u)):r==="children"?typeof u=="string"?(n!=="textarea"||u!=="")&&Ou(e,u):typeof u=="number"&&Ou(e,""+u):r!=="suppressContentEditableWarning"&&r!=="suppressHydrationWarning"&&r!=="autoFocus"&&(Iu.hasOwnProperty(r)?u!=null&&r==="onScroll"&<("scroll",e):u!=null&&ix(e,r,u,s))}switch(n){case"input":ad(e),fb(e,a,!1);break;case"textarea":ad(e),gb(e);break;case"option":a.value!=null&&e.setAttribute("value",""+Sr(a.value));break;case"select":e.multiple=!!a.multiple,r=a.value,r!=null?jo(e,!!a.multiple,r,!1):a.defaultValue!=null&&jo(e,!!a.multiple,a.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=Ih)}switch(n){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break e;case"img":a=!0;break e;default:a=!1}}a&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Xt(t),null;case 6:if(e&&t.stateNode!=null)wC(e,t,e.memoizedProps,a);else{if(typeof a!="string"&&t.stateNode===null)throw Error(se(166));if(n=es(Wu.current),es(ii.current),hd(t)){if(a=t.stateNode,n=t.memoizedProps,a[Za]=t,(r=a.nodeValue!==n)&&(e=Un,e!==null))switch(e.tag){case 3:dd(a.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&dd(a.nodeValue,n,(e.mode&1)!==0)}r&&(t.flags|=4)}else a=(n.nodeType===9?n:n.ownerDocument).createTextNode(a),a[Za]=t,t.stateNode=a}return Xt(t),null;case 13:if(dt(yt),a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(pt&&Bn!==null&&t.mode&1&&!(t.flags&128))LN(),Jo(),t.flags|=98560,r=!1;else if(r=hd(t),a!==null&&a.dehydrated!==null){if(e===null){if(!r)throw Error(se(318));if(r=t.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(se(317));r[Za]=t}else Jo(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Xt(t),r=!1}else Ea!==null&&(oy(Ea),Ea=null),r=!0;if(!r)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(a=a!==null,a!==(e!==null&&e.memoizedState!==null)&&a&&(t.child.flags|=8192,t.mode&1&&(e===null||yt.current&1?Lt===0&&(Lt=3):Bx())),t.updateQueue!==null&&(t.flags|=4),Xt(t),null);case 4:return Xo(),Zg(e,t),e===null&&$u(t.stateNode.containerInfo),Xt(t),null;case 10:return jx(t.type._context),Xt(t),null;case 17:return Tn(t.type)&&Oh(),Xt(t),null;case 19:if(dt(yt),r=t.memoizedState,r===null)return Xt(t),null;if(a=(t.flags&128)!==0,s=r.rendering,s===null)if(a)$l(r,!1);else{if(Lt!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=$h(e),s!==null){for(t.flags|=128,$l(r,!1),a=s.updateQueue,a!==null&&(t.updateQueue=a,t.flags|=4),t.subtreeFlags=0,a=n,n=t.child;n!==null;)r=n,e=a,r.flags&=14680066,s=r.alternate,s===null?(r.childLanes=0,r.lanes=e,r.child=null,r.subtreeFlags=0,r.memoizedProps=null,r.memoizedState=null,r.updateQueue=null,r.dependencies=null,r.stateNode=null):(r.childLanes=s.childLanes,r.lanes=s.lanes,r.child=s.child,r.subtreeFlags=0,r.deletions=null,r.memoizedProps=s.memoizedProps,r.memoizedState=s.memoizedState,r.updateQueue=s.updateQueue,r.type=s.type,e=s.dependencies,r.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return it(yt,yt.current&1|2),t.child}e=e.sibling}r.tail!==null&&jt()>el&&(t.flags|=128,a=!0,$l(r,!1),t.lanes=4194304)}else{if(!a)if(e=$h(s),e!==null){if(t.flags|=128,a=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),$l(r,!0),r.tail===null&&r.tailMode==="hidden"&&!s.alternate&&!pt)return Xt(t),null}else 2*jt()-r.renderingStartTime>el&&n!==1073741824&&(t.flags|=128,a=!0,$l(r,!1),t.lanes=4194304);r.isBackwards?(s.sibling=t.child,t.child=s):(n=r.last,n!==null?n.sibling=s:t.child=s,r.last=s)}return r.tail!==null?(t=r.tail,r.rendering=t,r.tail=t.sibling,r.renderingStartTime=jt(),t.sibling=null,n=yt.current,it(yt,a?n&1|2:n&1),t):(Xt(t),null);case 22:case 23:return Fx(),a=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==a&&(t.flags|=8192),a&&t.mode&1?Dn&1073741824&&(Xt(t),t.subtreeFlags&6&&(t.flags|=8192)):Xt(t),null;case 24:return null;case 25:return null}throw Error(se(156,t.tag))}function $5(e,t){switch(xx(t),t.tag){case 1:return Tn(t.type)&&Oh(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Xo(),dt(Cn),dt(an),Tx(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Cx(t),null;case 13:if(dt(yt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(se(340));Jo()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return dt(yt),null;case 4:return Xo(),null;case 10:return jx(t.type._context),null;case 22:case 23:return Fx(),null;case 24:return null;default:return null}}var pd=!1,tn=!1,U5=typeof WeakSet=="function"?WeakSet:Set,fe=null;function yo(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(a){bt(e,t,a)}else n.current=null}function ey(e,t,n){try{n()}catch(a){bt(e,t,a)}}var r0=!1;function V5(e,t){if(Dg=Ph,e=jN(),yx(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var a=n.getSelection&&n.getSelection();if(a&&a.rangeCount!==0){n=a.anchorNode;var i=a.anchorOffset,r=a.focusNode;a=a.focusOffset;try{n.nodeType,r.nodeType}catch{n=null;break e}var s=0,l=-1,u=-1,c=0,h=0,d=e,m=null;t:for(;;){for(var f;d!==n||i!==0&&d.nodeType!==3||(l=s+i),d!==r||a!==0&&d.nodeType!==3||(u=s+a),d.nodeType===3&&(s+=d.nodeValue.length),(f=d.firstChild)!==null;)m=d,d=f;for(;;){if(d===e)break t;if(m===n&&++c===i&&(l=s),m===r&&++h===a&&(u=s),(f=d.nextSibling)!==null)break;d=m,m=d.parentNode}d=f}n=l===-1||u===-1?null:{start:l,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(zg={focusedElem:e,selectionRange:n},Ph=!1,fe=t;fe!==null;)if(t=fe,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,fe=e;else for(;fe!==null;){t=fe;try{var y=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var g=y.memoizedProps,x=y.memoizedState,w=t.stateNode,v=w.getSnapshotBeforeUpdate(t.elementType===t.type?g:_a(t.type,g),x);w.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var k=t.stateNode.containerInfo;k.nodeType===1?k.textContent="":k.nodeType===9&&k.documentElement&&k.removeChild(k.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(se(163))}}catch(j){bt(t,t.return,j)}if(e=t.sibling,e!==null){e.return=t.return,fe=e;break}fe=t.return}return y=r0,r0=!1,y}function wu(e,t,n){var a=t.updateQueue;if(a=a!==null?a.lastEffect:null,a!==null){var i=a=a.next;do{if((i.tag&e)===e){var r=i.destroy;i.destroy=void 0,r!==void 0&&ey(t,n,r)}i=i.next}while(i!==a)}}function Km(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var a=n.create;n.destroy=a()}n=n.next}while(n!==t)}}function ty(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function xC(e){var t=e.alternate;t!==null&&(e.alternate=null,xC(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Za],delete t[Vu],delete t[Kg],delete t[N5],delete t[C5])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function kC(e){return e.tag===5||e.tag===3||e.tag===4}function s0(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||kC(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function ny(e,t,n){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Ih));else if(a!==4&&(e=e.child,e!==null))for(ny(e,t,n),e=e.sibling;e!==null;)ny(e,t,n),e=e.sibling}function ay(e,t,n){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(a!==4&&(e=e.child,e!==null))for(ay(e,t,n),e=e.sibling;e!==null;)ay(e,t,n),e=e.sibling}var $t=null,Ta=!1;function Fi(e,t,n){for(n=n.child;n!==null;)vC(e,t,n),n=n.sibling}function vC(e,t,n){if(ai&&typeof ai.onCommitFiberUnmount=="function")try{ai.onCommitFiberUnmount(Rm,n)}catch{}switch(n.tag){case 5:tn||yo(n,t);case 6:var a=$t,i=Ta;$t=null,Fi(e,t,n),$t=a,Ta=i,$t!==null&&(Ta?(e=$t,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):$t.removeChild(n.stateNode));break;case 18:$t!==null&&(Ta?(e=$t,n=n.stateNode,e.nodeType===8?sp(e.parentNode,n):e.nodeType===1&&sp(e,n),Fu(e)):sp($t,n.stateNode));break;case 4:a=$t,i=Ta,$t=n.stateNode.containerInfo,Ta=!0,Fi(e,t,n),$t=a,Ta=i;break;case 0:case 11:case 14:case 15:if(!tn&&(a=n.updateQueue,a!==null&&(a=a.lastEffect,a!==null))){i=a=a.next;do{var r=i,s=r.destroy;r=r.tag,s!==void 0&&(r&2||r&4)&&ey(n,t,s),i=i.next}while(i!==a)}Fi(e,t,n);break;case 1:if(!tn&&(yo(n,t),a=n.stateNode,typeof a.componentWillUnmount=="function"))try{a.props=n.memoizedProps,a.state=n.memoizedState,a.componentWillUnmount()}catch(l){bt(n,t,l)}Fi(e,t,n);break;case 21:Fi(e,t,n);break;case 22:n.mode&1?(tn=(a=tn)||n.memoizedState!==null,Fi(e,t,n),tn=a):Fi(e,t,n);break;default:Fi(e,t,n)}}function o0(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new U5),t.forEach(function(a){var i=Z5.bind(null,e,a);n.has(a)||(n.add(a),a.then(i,i))})}}function wa(e,t){var n=t.deletions;if(n!==null)for(var a=0;a<n.length;a++){var i=n[a];try{var r=e,s=t,l=s;e:for(;l!==null;){switch(l.tag){case 5:$t=l.stateNode,Ta=!1;break e;case 3:$t=l.stateNode.containerInfo,Ta=!0;break e;case 4:$t=l.stateNode.containerInfo,Ta=!0;break e}l=l.return}if($t===null)throw Error(se(160));vC(r,s,i),$t=null,Ta=!1;var u=i.alternate;u!==null&&(u.return=null),i.return=null}catch(c){bt(i,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)bC(t,e),t=t.sibling}function bC(e,t){var n=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(wa(t,e),Ka(e),a&4){try{wu(3,e,e.return),Km(3,e)}catch(g){bt(e,e.return,g)}try{wu(5,e,e.return)}catch(g){bt(e,e.return,g)}}break;case 1:wa(t,e),Ka(e),a&512&&n!==null&&yo(n,n.return);break;case 5:if(wa(t,e),Ka(e),a&512&&n!==null&&yo(n,n.return),e.flags&32){var i=e.stateNode;try{Ou(i,"")}catch(g){bt(e,e.return,g)}}if(a&4&&(i=e.stateNode,i!=null)){var r=e.memoizedProps,s=n!==null?n.memoizedProps:r,l=e.type,u=e.updateQueue;if(e.updateQueue=null,u!==null)try{l==="input"&&r.type==="radio"&&r.name!=null&&VS(i,r),Cg(l,s);var c=Cg(l,r);for(s=0;s<u.length;s+=2){var h=u[s],d=u[s+1];h==="style"?YS(i,d):h==="dangerouslySetInnerHTML"?qS(i,d):h==="children"?Ou(i,d):ix(i,h,d,c)}switch(l){case"input":bg(i,r);break;case"textarea":HS(i,r);break;case"select":var m=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!r.multiple;var f=r.value;f!=null?jo(i,!!r.multiple,f,!1):m!==!!r.multiple&&(r.defaultValue!=null?jo(i,!!r.multiple,r.defaultValue,!0):jo(i,!!r.multiple,r.multiple?[]:"",!1))}i[Vu]=r}catch(g){bt(e,e.return,g)}}break;case 6:if(wa(t,e),Ka(e),a&4){if(e.stateNode===null)throw Error(se(162));i=e.stateNode,r=e.memoizedProps;try{i.nodeValue=r}catch(g){bt(e,e.return,g)}}break;case 3:if(wa(t,e),Ka(e),a&4&&n!==null&&n.memoizedState.isDehydrated)try{Fu(t.containerInfo)}catch(g){bt(e,e.return,g)}break;case 4:wa(t,e),Ka(e);break;case 13:wa(t,e),Ka(e),i=e.child,i.flags&8192&&(r=i.memoizedState!==null,i.stateNode.isHidden=r,!r||i.alternate!==null&&i.alternate.memoizedState!==null||(Dx=jt())),a&4&&o0(e);break;case 22:if(h=n!==null&&n.memoizedState!==null,e.mode&1?(tn=(c=tn)||h,wa(t,e),tn=c):wa(t,e),Ka(e),a&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!h&&e.mode&1)for(fe=e,h=e.child;h!==null;){for(d=fe=h;fe!==null;){switch(m=fe,f=m.child,m.tag){case 0:case 11:case 14:case 15:wu(4,m,m.return);break;case 1:yo(m,m.return);var y=m.stateNode;if(typeof y.componentWillUnmount=="function"){a=m,n=m.return;try{t=a,y.props=t.memoizedProps,y.state=t.memoizedState,y.componentWillUnmount()}catch(g){bt(a,n,g)}}break;case 5:yo(m,m.return);break;case 22:if(m.memoizedState!==null){u0(d);continue}}f!==null?(f.return=m,fe=f):u0(d)}h=h.sibling}e:for(h=null,d=e;;){if(d.tag===5){if(h===null){h=d;try{i=d.stateNode,c?(r=i.style,typeof r.setProperty=="function"?r.setProperty("display","none","important"):r.display="none"):(l=d.stateNode,u=d.memoizedProps.style,s=u!=null&&u.hasOwnProperty("display")?u.display:null,l.style.display=GS("display",s))}catch(g){bt(e,e.return,g)}}}else if(d.tag===6){if(h===null)try{d.stateNode.nodeValue=c?"":d.memoizedProps}catch(g){bt(e,e.return,g)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===e)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;d.sibling===null;){if(d.return===null||d.return===e)break e;h===d&&(h=null),d=d.return}h===d&&(h=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:wa(t,e),Ka(e),a&4&&o0(e);break;case 21:break;default:wa(t,e),Ka(e)}}function Ka(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(kC(n)){var a=n;break e}n=n.return}throw Error(se(160))}switch(a.tag){case 5:var i=a.stateNode;a.flags&32&&(Ou(i,""),a.flags&=-33);var r=s0(e);ay(e,r,i);break;case 3:case 4:var s=a.stateNode.containerInfo,l=s0(e);ny(e,l,s);break;default:throw Error(se(161))}}catch(u){bt(e,e.return,u)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function H5(e,t,n){fe=e,jC(e)}function jC(e,t,n){for(var a=(e.mode&1)!==0;fe!==null;){var i=fe,r=i.child;if(i.tag===22&&a){var s=i.memoizedState!==null||pd;if(!s){var l=i.alternate,u=l!==null&&l.memoizedState!==null||tn;l=pd;var c=tn;if(pd=s,(tn=u)&&!c)for(fe=i;fe!==null;)s=fe,u=s.child,s.tag===22&&s.memoizedState!==null?c0(i):u!==null?(u.return=s,fe=u):c0(i);for(;r!==null;)fe=r,jC(r),r=r.sibling;fe=i,pd=l,tn=c}l0(e)}else i.subtreeFlags&8772&&r!==null?(r.return=i,fe=r):l0(e)}}function l0(e){for(;fe!==null;){var t=fe;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:tn||Km(5,t);break;case 1:var a=t.stateNode;if(t.flags&4&&!tn)if(n===null)a.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:_a(t.type,n.memoizedProps);a.componentDidUpdate(i,n.memoizedState,a.__reactInternalSnapshotBeforeUpdate)}var r=t.updateQueue;r!==null&&Wb(t,r,a);break;case 3:var s=t.updateQueue;if(s!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}Wb(t,s,n)}break;case 5:var l=t.stateNode;if(n===null&&t.flags&4){n=l;var u=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":u.autoFocus&&n.focus();break;case"img":u.src&&(n.src=u.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var c=t.alternate;if(c!==null){var h=c.memoizedState;if(h!==null){var d=h.dehydrated;d!==null&&Fu(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(se(163))}tn||t.flags&512&&ty(t)}catch(m){bt(t,t.return,m)}}if(t===e){fe=null;break}if(n=t.sibling,n!==null){n.return=t.return,fe=n;break}fe=t.return}}function u0(e){for(;fe!==null;){var t=fe;if(t===e){fe=null;break}var n=t.sibling;if(n!==null){n.return=t.return,fe=n;break}fe=t.return}}function c0(e){for(;fe!==null;){var t=fe;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Km(4,t)}catch(u){bt(t,n,u)}break;case 1:var a=t.stateNode;if(typeof a.componentDidMount=="function"){var i=t.return;try{a.componentDidMount()}catch(u){bt(t,i,u)}}var r=t.return;try{ty(t)}catch(u){bt(t,r,u)}break;case 5:var s=t.return;try{ty(t)}catch(u){bt(t,s,u)}}}catch(u){bt(t,t.return,u)}if(t===e){fe=null;break}var l=t.sibling;if(l!==null){l.return=t.return,fe=l;break}fe=t.return}}var W5=Math.ceil,Hh=Ri.ReactCurrentDispatcher,Ox=Ri.ReactCurrentOwner,oa=Ri.ReactCurrentBatchConfig,$e=0,zt=null,Mt=null,qt=0,Dn=0,wo=Mr(0),Lt=0,Ju=null,bs=0,$m=0,Lx=0,xu=null,_n=null,Dx=0,el=1/0,yi=null,Wh=!1,iy=null,kr=null,gd=!1,cr=null,qh=0,ku=0,ry=null,rh=-1,sh=0;function mn(){return $e&6?jt():rh!==-1?rh:rh=jt()}function vr(e){return e.mode&1?$e&2&&qt!==0?qt&-qt:E5.transition!==null?(sh===0&&(sh=oN()),sh):(e=Je,e!==0||(e=window.event,e=e===void 0?16:fN(e.type)),e):1}function Pa(e,t,n,a){if(50<ku)throw ku=0,ry=null,Error(se(185));jc(e,n,a),(!($e&2)||e!==zt)&&(e===zt&&(!($e&2)&&($m|=n),Lt===4&&Xi(e,qt)),En(e,a),n===1&&$e===0&&!(t.mode&1)&&(el=jt()+500,zm&&Rr()))}function En(e,t){var n=e.callbackNode;EL(e,t);var a=Ah(e,e===zt?qt:0);if(a===0)n!==null&&xb(n),e.callbackNode=null,e.callbackPriority=0;else if(t=a&-a,e.callbackPriority!==t){if(n!=null&&xb(n),t===1)e.tag===0?T5(d0.bind(null,e)):RN(d0.bind(null,e)),_5(function(){!($e&6)&&Rr()}),n=null;else{switch(lN(a)){case 1:n=ux;break;case 4:n=rN;break;case 16:n=Eh;break;case 536870912:n=sN;break;default:n=Eh}n=PC(n,_C.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function _C(e,t){if(rh=-1,sh=0,$e&6)throw Error(se(327));var n=e.callbackNode;if(To()&&e.callbackNode!==n)return null;var a=Ah(e,e===zt?qt:0);if(a===0)return null;if(a&30||a&e.expiredLanes||t)t=Gh(e,a);else{t=a;var i=$e;$e|=2;var r=NC();(zt!==e||qt!==t)&&(yi=null,el=jt()+500,ps(e,t));do try{Y5();break}catch(l){SC(e,l)}while(!0);bx(),Hh.current=r,$e=i,Mt!==null?t=0:(zt=null,qt=0,t=Lt)}if(t!==0){if(t===2&&(i=Mg(e),i!==0&&(a=i,t=sy(e,i))),t===1)throw n=Ju,ps(e,0),Xi(e,a),En(e,jt()),n;if(t===6)Xi(e,a);else{if(i=e.current.alternate,!(a&30)&&!q5(i)&&(t=Gh(e,a),t===2&&(r=Mg(e),r!==0&&(a=r,t=sy(e,r))),t===1))throw n=Ju,ps(e,0),Xi(e,a),En(e,jt()),n;switch(e.finishedWork=i,e.finishedLanes=a,t){case 0:case 1:throw Error(se(345));case 2:qr(e,_n,yi);break;case 3:if(Xi(e,a),(a&130023424)===a&&(t=Dx+500-jt(),10<t)){if(Ah(e,0)!==0)break;if(i=e.suspendedLanes,(i&a)!==a){mn(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=Bg(qr.bind(null,e,_n,yi),t);break}qr(e,_n,yi);break;case 4:if(Xi(e,a),(a&4194240)===a)break;for(t=e.eventTimes,i=-1;0<a;){var s=31-Aa(a);r=1<<s,s=t[s],s>i&&(i=s),a&=~r}if(a=i,a=jt()-a,a=(120>a?120:480>a?480:1080>a?1080:1920>a?1920:3e3>a?3e3:4320>a?4320:1960*W5(a/1960))-a,10<a){e.timeoutHandle=Bg(qr.bind(null,e,_n,yi),a);break}qr(e,_n,yi);break;case 5:qr(e,_n,yi);break;default:throw Error(se(329))}}}return En(e,jt()),e.callbackNode===n?_C.bind(null,e):null}function sy(e,t){var n=xu;return e.current.memoizedState.isDehydrated&&(ps(e,t).flags|=256),e=Gh(e,t),e!==2&&(t=_n,_n=n,t!==null&&oy(t)),e}function oy(e){_n===null?_n=e:_n.push.apply(_n,e)}function q5(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var a=0;a<n.length;a++){var i=n[a],r=i.getSnapshot;i=i.value;try{if(!Oa(r(),i))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Xi(e,t){for(t&=~Lx,t&=~$m,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Aa(t),a=1<<n;e[n]=-1,t&=~a}}function d0(e){if($e&6)throw Error(se(327));To();var t=Ah(e,0);if(!(t&1))return En(e,jt()),null;var n=Gh(e,t);if(e.tag!==0&&n===2){var a=Mg(e);a!==0&&(t=a,n=sy(e,a))}if(n===1)throw n=Ju,ps(e,0),Xi(e,t),En(e,jt()),n;if(n===6)throw Error(se(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,qr(e,_n,yi),En(e,jt()),null}function zx(e,t){var n=$e;$e|=1;try{return e(t)}finally{$e=n,$e===0&&(el=jt()+500,zm&&Rr())}}function js(e){cr!==null&&cr.tag===0&&!($e&6)&&To();var t=$e;$e|=1;var n=oa.transition,a=Je;try{if(oa.transition=null,Je=1,e)return e()}finally{Je=a,oa.transition=n,$e=t,!($e&6)&&Rr()}}function Fx(){Dn=wo.current,dt(wo)}function ps(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,j5(n)),Mt!==null)for(n=Mt.return;n!==null;){var a=n;switch(xx(a),a.tag){case 1:a=a.type.childContextTypes,a!=null&&Oh();break;case 3:Xo(),dt(Cn),dt(an),Tx();break;case 5:Cx(a);break;case 4:Xo();break;case 13:dt(yt);break;case 19:dt(yt);break;case 10:jx(a.type._context);break;case 22:case 23:Fx()}n=n.return}if(zt=e,Mt=e=br(e.current,null),qt=Dn=t,Lt=0,Ju=null,Lx=$m=bs=0,_n=xu=null,Zr!==null){for(t=0;t<Zr.length;t++)if(n=Zr[t],a=n.interleaved,a!==null){n.interleaved=null;var i=a.next,r=n.pending;if(r!==null){var s=r.next;r.next=i,a.next=s}n.pending=a}Zr=null}return e}function SC(e,t){do{var n=Mt;try{if(bx(),nh.current=Vh,Uh){for(var a=wt.memoizedState;a!==null;){var i=a.queue;i!==null&&(i.pending=null),a=a.next}Uh=!1}if(vs=0,Dt=Ot=wt=null,yu=!1,qu=0,Ox.current=null,n===null||n.return===null){Lt=1,Ju=t,Mt=null;break}e:{var r=e,s=n.return,l=n,u=t;if(t=qt,l.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){var c=u,h=l,d=h.tag;if(!(h.mode&1)&&(d===0||d===11||d===15)){var m=h.alternate;m?(h.updateQueue=m.updateQueue,h.memoizedState=m.memoizedState,h.lanes=m.lanes):(h.updateQueue=null,h.memoizedState=null)}var f=Xb(s);if(f!==null){f.flags&=-257,Zb(f,s,l,r,t),f.mode&1&&Qb(r,c,t),t=f,u=c;var y=t.updateQueue;if(y===null){var g=new Set;g.add(u),t.updateQueue=g}else y.add(u);break e}else{if(!(t&1)){Qb(r,c,t),Bx();break e}u=Error(se(426))}}else if(pt&&l.mode&1){var x=Xb(s);if(x!==null){!(x.flags&65536)&&(x.flags|=256),Zb(x,s,l,r,t),kx(Zo(u,l));break e}}r=u=Zo(u,l),Lt!==4&&(Lt=2),xu===null?xu=[r]:xu.push(r),r=s;do{switch(r.tag){case 3:r.flags|=65536,t&=-t,r.lanes|=t;var w=lC(r,u,t);Hb(r,w);break e;case 1:l=u;var v=r.type,k=r.stateNode;if(!(r.flags&128)&&(typeof v.getDerivedStateFromError=="function"||k!==null&&typeof k.componentDidCatch=="function"&&(kr===null||!kr.has(k)))){r.flags|=65536,t&=-t,r.lanes|=t;var j=uC(r,l,t);Hb(r,j);break e}}r=r.return}while(r!==null)}TC(n)}catch(S){t=S,Mt===n&&n!==null&&(Mt=n=n.return);continue}break}while(!0)}function NC(){var e=Hh.current;return Hh.current=Vh,e===null?Vh:e}function Bx(){(Lt===0||Lt===3||Lt===2)&&(Lt=4),zt===null||!(bs&268435455)&&!($m&268435455)||Xi(zt,qt)}function Gh(e,t){var n=$e;$e|=2;var a=NC();(zt!==e||qt!==t)&&(yi=null,ps(e,t));do try{G5();break}catch(i){SC(e,i)}while(!0);if(bx(),$e=n,Hh.current=a,Mt!==null)throw Error(se(261));return zt=null,qt=0,Lt}function G5(){for(;Mt!==null;)CC(Mt)}function Y5(){for(;Mt!==null&&!kL();)CC(Mt)}function CC(e){var t=AC(e.alternate,e,Dn);e.memoizedProps=e.pendingProps,t===null?TC(e):Mt=t,Ox.current=null}function TC(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=$5(n,t),n!==null){n.flags&=32767,Mt=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Lt=6,Mt=null;return}}else if(n=K5(n,t,Dn),n!==null){Mt=n;return}if(t=t.sibling,t!==null){Mt=t;return}Mt=t=e}while(t!==null);Lt===0&&(Lt=5)}function qr(e,t,n){var a=Je,i=oa.transition;try{oa.transition=null,Je=1,J5(e,t,n,a)}finally{oa.transition=i,Je=a}return null}function J5(e,t,n,a){do To();while(cr!==null);if($e&6)throw Error(se(327));n=e.finishedWork;var i=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(se(177));e.callbackNode=null,e.callbackPriority=0;var r=n.lanes|n.childLanes;if(AL(e,r),e===zt&&(Mt=zt=null,qt=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||gd||(gd=!0,PC(Eh,function(){return To(),null})),r=(n.flags&15990)!==0,n.subtreeFlags&15990||r){r=oa.transition,oa.transition=null;var s=Je;Je=1;var l=$e;$e|=4,Ox.current=null,V5(e,n),bC(n,e),g5(zg),Ph=!!Dg,zg=Dg=null,e.current=n,H5(n),vL(),$e=l,Je=s,oa.transition=r}else e.current=n;if(gd&&(gd=!1,cr=e,qh=i),r=e.pendingLanes,r===0&&(kr=null),_L(n.stateNode),En(e,jt()),t!==null)for(a=e.onRecoverableError,n=0;n<t.length;n++)i=t[n],a(i.value,{componentStack:i.stack,digest:i.digest});if(Wh)throw Wh=!1,e=iy,iy=null,e;return qh&1&&e.tag!==0&&To(),r=e.pendingLanes,r&1?e===ry?ku++:(ku=0,ry=e):ku=0,Rr(),null}function To(){if(cr!==null){var e=lN(qh),t=oa.transition,n=Je;try{if(oa.transition=null,Je=16>e?16:e,cr===null)var a=!1;else{if(e=cr,cr=null,qh=0,$e&6)throw Error(se(331));var i=$e;for($e|=4,fe=e.current;fe!==null;){var r=fe,s=r.child;if(fe.flags&16){var l=r.deletions;if(l!==null){for(var u=0;u<l.length;u++){var c=l[u];for(fe=c;fe!==null;){var h=fe;switch(h.tag){case 0:case 11:case 15:wu(8,h,r)}var d=h.child;if(d!==null)d.return=h,fe=d;else for(;fe!==null;){h=fe;var m=h.sibling,f=h.return;if(xC(h),h===c){fe=null;break}if(m!==null){m.return=f,fe=m;break}fe=f}}}var y=r.alternate;if(y!==null){var g=y.child;if(g!==null){y.child=null;do{var x=g.sibling;g.sibling=null,g=x}while(g!==null)}}fe=r}}if(r.subtreeFlags&2064&&s!==null)s.return=r,fe=s;else e:for(;fe!==null;){if(r=fe,r.flags&2048)switch(r.tag){case 0:case 11:case 15:wu(9,r,r.return)}var w=r.sibling;if(w!==null){w.return=r.return,fe=w;break e}fe=r.return}}var v=e.current;for(fe=v;fe!==null;){s=fe;var k=s.child;if(s.subtreeFlags&2064&&k!==null)k.return=s,fe=k;else e:for(s=v;fe!==null;){if(l=fe,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:Km(9,l)}}catch(S){bt(l,l.return,S)}if(l===s){fe=null;break e}var j=l.sibling;if(j!==null){j.return=l.return,fe=j;break e}fe=l.return}}if($e=i,Rr(),ai&&typeof ai.onPostCommitFiberRoot=="function")try{ai.onPostCommitFiberRoot(Rm,e)}catch{}a=!0}return a}finally{Je=n,oa.transition=t}}return!1}function h0(e,t,n){t=Zo(n,t),t=lC(e,t,1),e=xr(e,t,1),t=mn(),e!==null&&(jc(e,1,t),En(e,t))}function bt(e,t,n){if(e.tag===3)h0(e,e,n);else for(;t!==null;){if(t.tag===3){h0(t,e,n);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(kr===null||!kr.has(a))){e=Zo(n,e),e=uC(t,e,1),t=xr(t,e,1),e=mn(),t!==null&&(jc(t,1,e),En(t,e));break}}t=t.return}}function Q5(e,t,n){var a=e.pingCache;a!==null&&a.delete(t),t=mn(),e.pingedLanes|=e.suspendedLanes&n,zt===e&&(qt&n)===n&&(Lt===4||Lt===3&&(qt&130023424)===qt&&500>jt()-Dx?ps(e,0):Lx|=n),En(e,t)}function EC(e,t){t===0&&(e.mode&1?(t=sd,sd<<=1,!(sd&130023424)&&(sd=4194304)):t=1);var n=mn();e=Ti(e,t),e!==null&&(jc(e,t,n),En(e,n))}function X5(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),EC(e,n)}function Z5(e,t){var n=0;switch(e.tag){case 13:var a=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:a=e.stateNode;break;default:throw Error(se(314))}a!==null&&a.delete(t),EC(e,n)}var AC;AC=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Cn.current)Sn=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Sn=!1,B5(e,t,n);Sn=!!(e.flags&131072)}else Sn=!1,pt&&t.flags&1048576&&IN(t,zh,t.index);switch(t.lanes=0,t.tag){case 2:var a=t.type;ih(e,t),e=t.pendingProps;var i=Yo(t,an.current);Co(t,n),i=Ax(null,t,a,e,i,n);var r=Px();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Tn(a)?(r=!0,Lh(t)):r=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Sx(t),i.updater=Bm,t.stateNode=i,i._reactInternals=t,qg(t,a,e,n),t=Jg(null,t,a,!0,r,n)):(t.tag=0,pt&&r&&wx(t),un(null,t,i,n),t=t.child),t;case 16:a=t.elementType;e:{switch(ih(e,t),e=t.pendingProps,i=a._init,a=i(a._payload),t.type=a,i=t.tag=t3(a),e=_a(a,e),i){case 0:t=Yg(null,t,a,e,n);break e;case 1:t=n0(null,t,a,e,n);break e;case 11:t=e0(null,t,a,e,n);break e;case 14:t=t0(null,t,a,_a(a.type,e),n);break e}throw Error(se(306,a,""))}return t;case 0:return a=t.type,i=t.pendingProps,i=t.elementType===a?i:_a(a,i),Yg(e,t,a,i,n);case 1:return a=t.type,i=t.pendingProps,i=t.elementType===a?i:_a(a,i),n0(e,t,a,i,n);case 3:e:{if(mC(t),e===null)throw Error(se(387));a=t.pendingProps,r=t.memoizedState,i=r.element,BN(e,t),Kh(t,a,null,n);var s=t.memoizedState;if(a=s.element,r.isDehydrated)if(r={element:a,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=r,t.memoizedState=r,t.flags&256){i=Zo(Error(se(423)),t),t=a0(e,t,a,n,i);break e}else if(a!==i){i=Zo(Error(se(424)),t),t=a0(e,t,a,n,i);break e}else for(Bn=wr(t.stateNode.containerInfo.firstChild),Un=t,pt=!0,Ea=null,n=zN(t,null,a,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Jo(),a===i){t=Ei(e,t,n);break e}un(e,t,a,n)}t=t.child}return t;case 5:return KN(t),e===null&&Vg(t),a=t.type,i=t.pendingProps,r=e!==null?e.memoizedProps:null,s=i.children,Fg(a,i)?s=null:r!==null&&Fg(a,r)&&(t.flags|=32),hC(e,t),un(e,t,s,n),t.child;case 6:return e===null&&Vg(t),null;
vendor: 7,603 bytes, line 40
40case 13:return fC(e,t,n);case 4:return Nx(t,t.stateNode.containerInfo),a=t.pendingProps,e===null?t.child=Qo(t,null,a,n):un(e,t,a,n),t.child;case 11:return a=t.type,i=t.pendingProps,i=t.elementType===a?i:_a(a,i),e0(e,t,a,i,n);case 7:return un(e,t,t.pendingProps,n),t.child;case 8:return un(e,t,t.pendingProps.children,n),t.child;case 12:return un(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(a=t.type._context,i=t.pendingProps,r=t.memoizedProps,s=i.value,it(Fh,a._currentValue),a._currentValue=s,r!==null)if(Oa(r.value,s)){if(r.children===i.children&&!Cn.current){t=Ei(e,t,n);break e}}else for(r=t.child,r!==null&&(r.return=t);r!==null;){var l=r.dependencies;if(l!==null){s=r.child;for(var u=l.firstContext;u!==null;){if(u.context===a){if(r.tag===1){u=_i(-1,n&-n),u.tag=2;var c=r.updateQueue;if(c!==null){c=c.shared;var h=c.pending;h===null?u.next=u:(u.next=h.next,h.next=u),c.pending=u}}r.lanes|=n,u=r.alternate,u!==null&&(u.lanes|=n),Hg(r.return,n,t),l.lanes|=n;break}u=u.next}}else if(r.tag===10)s=r.type===t.type?null:r.child;else if(r.tag===18){if(s=r.return,s===null)throw Error(se(341));s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),Hg(s,n,t),s=r.sibling}else s=r.child;if(s!==null)s.return=r;else for(s=r;s!==null;){if(s===t){s=null;break}if(r=s.sibling,r!==null){r.return=s.return,s=r;break}s=s.return}r=s}un(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,a=t.pendingProps.children,Co(t,n),i=da(i),a=a(i),t.flags|=1,un(e,t,a,n),t.child;case 14:return a=t.type,i=_a(a,t.pendingProps),i=_a(a.type,i),t0(e,t,a,i,n);case 15:return cC(e,t,t.type,t.pendingProps,n);case 17:return a=t.type,i=t.pendingProps,i=t.elementType===a?i:_a(a,i),ih(e,t),t.tag=1,Tn(a)?(e=!0,Lh(t)):e=!1,Co(t,n),oC(t,a,i),qg(t,a,i,n),Jg(null,t,a,!0,e,n);case 19:return pC(e,t,n);case 22:return dC(e,t,n)}throw Error(se(156,t.tag))};function PC(e,t){return iN(e,t)}function e3(e,t,n,a){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=a,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ra(e,t,n,a){return new e3(e,t,n,a)}function Kx(e){return e=e.prototype,!(!e||!e.isReactComponent)}function t3(e){if(typeof e=="function")return Kx(e)?1:0;if(e!=null){if(e=e.$$typeof,e===sx)return 11;if(e===ox)return 14}return 2}function br(e,t){var n=e.alternate;return n===null?(n=ra(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function oh(e,t,n,a,i,r){var s=2;if(a=e,typeof e=="function")Kx(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case oo:return gs(n.children,i,r,t);case rx:s=8,i|=8;break;case yg:return e=ra(12,n,t,i|2),e.elementType=yg,e.lanes=r,e;case wg:return e=ra(13,n,t,i),e.elementType=wg,e.lanes=r,e;case xg:return e=ra(19,n,t,i),e.elementType=xg,e.lanes=r,e;case KS:return Um(n,i,r,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case FS:s=10;break e;case BS:s=9;break e;case sx:s=11;break e;case ox:s=14;break e;case Yi:s=16,a=null;break e}throw Error(se(130,e==null?e:typeof e,""))}return t=ra(s,n,t,i),t.elementType=e,t.type=a,t.lanes=r,t}function gs(e,t,n,a){return e=ra(7,e,a,t),e.lanes=n,e}function Um(e,t,n,a){return e=ra(22,e,a,t),e.elementType=KS,e.lanes=n,e.stateNode={isHidden:!1},e}function fp(e,t,n){return e=ra(6,e,null,t),e.lanes=n,e}function pp(e,t,n){return t=ra(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function n3(e,t,n,a,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Yf(0),this.expirationTimes=Yf(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Yf(0),this.identifierPrefix=a,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function $x(e,t,n,a,i,r,s,l,u){return e=new n3(e,t,n,l,u),t===1?(t=1,r===!0&&(t|=8)):t=0,r=ra(3,null,null,t),e.current=r,r.stateNode=e,r.memoizedState={element:a,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Sx(r),e}function a3(e,t,n){var a=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:so,key:a==null?null:""+a,children:e,containerInfo:t,implementation:n}}function MC(e){if(!e)return Nr;e=e._reactInternals;e:{if(Is(e)!==e||e.tag!==1)throw Error(se(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Tn(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(se(171))}if(e.tag===1){var n=e.type;if(Tn(n))return MN(e,n,t)}return t}function RC(e,t,n,a,i,r,s,l,u){return e=$x(n,a,!0,e,i,r,s,l,u),e.context=MC(null),n=e.current,a=mn(),i=vr(n),r=_i(a,i),r.callback=t??null,xr(n,r,i),e.current.lanes=i,jc(e,i,a),En(e,a),e}function Vm(e,t,n,a){var i=t.current,r=mn(),s=vr(i);return n=MC(n),t.context===null?t.context=n:t.pendingContext=n,t=_i(r,s),t.payload={element:e},a=a===void 0?null:a,a!==null&&(t.callback=a),e=xr(i,t,s),e!==null&&(Pa(e,i,s,r),th(e,i,s)),s}function Yh(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function m0(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Ux(e,t){m0(e,t),(e=e.alternate)&&m0(e,t)}function i3(){return null}var IC=typeof reportError=="function"?reportError:function(e){console.error(e)};function Vx(e){this._internalRoot=e}Hm.prototype.render=Vx.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(se(409));Vm(e,t,null,null)};Hm.prototype.unmount=Vx.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;js(function(){Vm(null,e,null,null)}),t[Ci]=null}};function Hm(e){this._internalRoot=e}Hm.prototype.unstable_scheduleHydration=function(e){if(e){var t=dN();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Qi.length&&t!==0&&t<Qi[n].priority;n++);Qi.splice(n,0,e),n===0&&mN(e)}};function Hx(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Wm(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function f0(){}function r3(e,t,n,a,i){if(i){if(typeof a=="function"){var r=a;a=function(){var c=Yh(s);r.call(c)}}var s=RC(t,a,e,0,null,!1,!1,"",f0);return e._reactRootContainer=s,e[Ci]=s.current,$u(e.nodeType===8?e.parentNode:e),js(),s}for(;i=e.lastChild;)e.removeChild(i);if(typeof a=="function"){var l=a;a=function(){var c=Yh(u);l.call(c)}}var u=$x(e,0,!1,null,null,!1,!1,"",f0);return e._reactRootContainer=u,e[Ci]=u.current,$u(e.nodeType===8?e.parentNode:e),js(function(){Vm(t,u,n,a)}),u}function qm(e,t,n,a,i){var r=n._reactRootContainer;if(r){var s=r;if(typeof i=="function"){var l=i;
vendor: 4,811 bytes, line 40
40i=function(){var u=Yh(s);l.call(u)}}Vm(t,s,e,i)}else s=r3(n,t,e,i,a);return Yh(s)}uN=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=au(t.pendingLanes);n!==0&&(cx(t,n|1),En(t,jt()),!($e&6)&&(el=jt()+500,Rr()))}break;case 13:js(function(){var a=Ti(e,1);if(a!==null){var i=mn();Pa(a,e,1,i)}}),Ux(e,1)}};dx=function(e){if(e.tag===13){var t=Ti(e,134217728);if(t!==null){var n=mn();Pa(t,e,134217728,n)}Ux(e,134217728)}};cN=function(e){if(e.tag===13){var t=vr(e),n=Ti(e,t);if(n!==null){var a=mn();Pa(n,e,t,a)}Ux(e,t)}};dN=function(){return Je};hN=function(e,t){var n=Je;try{return Je=e,t()}finally{Je=n}};Eg=function(e,t,n){switch(t){case"input":if(bg(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var a=n[t];if(a!==e&&a.form===e.form){var i=Dm(a);if(!i)throw Error(se(90));US(a),bg(a,i)}}}break;case"textarea":HS(e,n);break;case"select":t=n.value,t!=null&&jo(e,!!n.multiple,t,!1)}};XS=zx;ZS=js;var s3={usingClientEntryPoint:!1,Events:[Sc,ho,Dm,JS,QS,zx]},Ul={findFiberByHostInstance:Xr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},o3={bundleType:Ul.bundleType,version:Ul.version,rendererPackageName:Ul.rendererPackageName,rendererConfig:Ul.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Ri.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=nN(e),e===null?null:e.stateNode},findFiberByHostInstance:Ul.findFiberByHostInstance||i3,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var yd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!yd.isDisabled&&yd.supportsFiber)try{Rm=yd.inject(o3),ai=yd}catch{}}Qn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=s3;Qn.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Hx(t))throw Error(se(200));return a3(e,t,null,n)};Qn.createRoot=function(e,t){if(!Hx(e))throw Error(se(299));var n=!1,a="",i=IC;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(a=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=$x(e,1,!1,null,null,n,!1,a,i),e[Ci]=t.current,$u(e.nodeType===8?e.parentNode:e),new Vx(t)};Qn.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(se(188)):(e=Object.keys(e).join(","),Error(se(268,e)));return e=nN(t),e=e===null?null:e.stateNode,e};Qn.flushSync=function(e){return js(e)};Qn.hydrate=function(e,t,n){if(!Wm(t))throw Error(se(200));return qm(null,e,t,!0,n)};Qn.hydrateRoot=function(e,t,n){if(!Hx(e))throw Error(se(405));var a=n!=null&&n.hydratedSources||null,i=!1,r="",s=IC;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(r=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=RC(t,null,e,1,n??null,i,!1,r,s),e[Ci]=t.current,$u(e),a)for(e=0;e<a.length;e++)n=a[e],i=n._getVersion,i=i(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,i]:t.mutableSourceEagerHydrationData.push(n,i);return new Hm(t)};Qn.render=function(e,t,n){if(!Wm(t))throw Error(se(200));return qm(null,e,t,!1,n)};Qn.unmountComponentAtNode=function(e){if(!Wm(e))throw Error(se(40));return e._reactRootContainer?(js(function(){qm(null,null,e,!1,function(){e._reactRootContainer=null,e[Ci]=null})}),!0):!1};Qn.unstable_batchedUpdates=zx;Qn.unstable_renderSubtreeIntoContainer=function(e,t,n,a){if(!Wm(n))throw Error(se(200));if(e==null||e._reactInternals===void 0)throw Error(se(38));return qm(e,t,n,!1,a)};Qn.version="18.3.1-next-f1338f8080-20240426";function OC(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(OC)}catch(e){console.error(e)}}OC(),OS.exports=Qn;var Os=OS.exports;const LC=Pm(Os);var DC,p0=Os;DC=p0.createRoot,p0.hydrateRoot;const l3=1,u3=1e6;let gp=0;function c3(){return gp=(gp+1)%Number.MAX_SAFE_INTEGER,gp.toString()}const yp=new Map,g0=e=>{if(yp.has(e))return;const t=setTimeout(()=>{yp.delete(e),vu({type:"REMOVE_TOAST",toastId:e})},u3);yp.set(e,t)},d3=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,l3)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(n=>n.id===t.toast.id?{...n,...t.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=t;
40return n?g0(n):e.toasts.forEach(a=>{g0(a.id)}),{...e,toasts:e.toasts.map(a=>a.id===n||n===void 0?{...a,open:!1}:a)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==t.toastId)}}},lh=[];let uh={toasts:[]};function vu(e){uh=d3(uh,e),lh.forEach(t=>{t(uh)})}function h3({...e}){const t=c3(),n=i=>vu({type:"UPDATE_TOAST",toast:{...i,id:t}}),a=()=>vu({type:"DISMISS_TOAST",toastId:t});return vu({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:i=>{i||a()}}}),{id:t,dismiss:a,update:n}}function Zn(){const[e,t]=p.useState(uh);return p.useEffect(()=>(lh.push(t),()=>{const n=lh.indexOf(t);n>-1&&lh.splice(n,1)}),[e]),{...e,toast:h3,dismiss:n=>vu({type:"DISMISS_TOAST",toastId:n})}}function ue(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function y0(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Gm(...e){return t=>{let n=!1;const a=e.map(i=>{const r=y0(i,t);return!n&&typeof r=="function"&&(n=!0),r});if(n)return()=>{for(let i=0;i<a.length;i++){const r=a[i];typeof r=="function"?r():y0(e[i],null)}}}}function Pe(...e){return p.useCallback(Gm(...e),e)}function m3(e,t){const n=p.createContext(t),a=r=>{const{children:s,...l}=r,u=p.useMemo(()=>l,Object.values(l));return o.jsx(n.Provider,{value:u,children:s})};a.displayName=e+"Provider";function i(r){const s=p.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${r}\` must be used within \`${e}\``)}return[a,i]}function Yt(e,t=[]){let n=[];function a(r,s){const l=p.createContext(s),u=n.length;n=[...n,s];const c=d=>{var w;const{scope:m,children:f,...y}=d,g=((w=m==null?void 0:m[e])==null?void 0:w[u])||l,x=p.useMemo(()=>y,Object.values(y));return o.jsx(g.Provider,{value:x,children:f})};c.displayName=r+"Provider";function h(d,m){var g;const f=((g=m==null?void 0:m[e])==null?void 0:g[u])||l,y=p.useContext(f);if(y)return y;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${r}\``)}return[c,h]}const i=()=>{const r=n.map(s=>p.createContext(s));return function(l){const u=(l==null?void 0:l[e])||r;return p.useMemo(()=>({[`__scope${e}`]:{...l,[e]:u}}),[l,u])}};return i.scopeName=e,[a,f3(i,...t)]}function f3(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const a=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(r){const s=a.reduce((l,{useScope:u,scopeName:c})=>{const d=u(r)[`__scope${c}`];return{...l,...d}},{});return p.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function _s(e){const t=g3(e),n=p.forwardRef((a,i)=>{const{children:r,...s}=a,l=p.Children.toArray(r),u=l.find(y3);if(u){const c=u.props.children,h=l.map(d=>d===u?p.Children.count(c)>1?p.Children.only(null):p.isValidElement(c)?c.props.children:null:d);return o.jsx(t,{...s,ref:i,children:p.isValidElement(c)?p.cloneElement(c,void 0,h):null})}return o.jsx(t,{...s,ref:i,children:r})});return n.displayName=`${e}.Slot`,n}var p3=_s("Slot");function g3(e){const t=p.forwardRef((n,a)=>{const{children:i,...r}=n;if(p.isValidElement(i)){const s=x3(i),l=w3(r,i.props);return i.type!==p.Fragment&&(l.ref=a?Gm(a,s):s),p.cloneElement(i,l)}return p.Children.count(i)>1?p.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var zC=Symbol("radix.slottable");function FC(e){const t=({children:n})=>o.jsx(o.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=zC,t}function y3(e){return p.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===zC}function w3(e,t){const n={...t};for(const a in t){const i=e[a],r=t[a];/^on[A-Z]/.test(a)?i&&r?n[a]=(...l)=>{const u=r(...l);return i(...l),u}:i&&(n[a]=i):a==="style"?n[a]={...i,...r}:a==="className"&&(n[a]=[i,r].filter(Boolean).join(" "))}return{...e,...n}}function x3(e){var a,i;let t=(a=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function pl(e){const t=e+"CollectionProvider",[n,a]=Yt(t),[i,r]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=g=>{const{scope:x,children:w}=g,v=ne.useRef(null),k=ne.useRef(new Map).current;return o.jsx(i,{scope:x,itemMap:k,collectionRef:v,children:w})};s.displayName=t;const l=e+"CollectionSlot",u=_s(l),c=ne.forwardRef((g,x)=>{const{scope:w,children:v}=g,k=r(l,w),j=Pe(x,k.collectionRef);return o.jsx(u,{ref:j,children:v})});c.displayName=l;const h=e+"CollectionItemSlot",d="data-radix-collection-item",m=_s(h),f=ne.forwardRef((g,x)=>{const{scope:w,children:v,...k}=g,j=ne.useRef(null),S=Pe(x,j),_=r(h,w);return ne.useEffect(()=>(_.itemMap.set(j,{ref:j,...k}),()=>
vendor: 9,170 bytes, line 40
40void _.itemMap.delete(j))),o.jsx(m,{[d]:"",ref:S,children:v})});f.displayName=h;function y(g){const x=r(e+"CollectionConsumer",g);return ne.useCallback(()=>{const v=x.collectionRef.current;if(!v)return[];const k=Array.from(v.querySelectorAll(`[${d}]`));return Array.from(x.itemMap.values()).sort((_,T)=>k.indexOf(_.ref.current)-k.indexOf(T.ref.current))},[x.collectionRef,x.itemMap])}return[{Provider:s,Slot:c,ItemSlot:f},y,a]}var k3=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],we=k3.reduce((e,t)=>{const n=_s(`Primitive.${t}`),a=p.forwardRef((i,r)=>{const{asChild:s,...l}=i,u=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(u,{...l,ref:r})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{});function Wx(e,t){e&&Os.flushSync(()=>e.dispatchEvent(t))}function fn(e){const t=p.useRef(e);return p.useEffect(()=>{t.current=e}),p.useMemo(()=>(...n)=>{var a;return(a=t.current)==null?void 0:a.call(t,...n)},[])}function v3(e,t=globalThis==null?void 0:globalThis.document){const n=fn(e);p.useEffect(()=>{const a=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",a,{capture:!0}),()=>t.removeEventListener("keydown",a,{capture:!0})},[n,t])}var b3="DismissableLayer",ly="dismissableLayer.update",j3="dismissableLayer.pointerDownOutside",_3="dismissableLayer.focusOutside",w0,BC=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),gl=p.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:a,onPointerDownOutside:i,onFocusOutside:r,onInteractOutside:s,onDismiss:l,...u}=e,c=p.useContext(BC),[h,d]=p.useState(null),m=(h==null?void 0:h.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,f]=p.useState({}),y=Pe(t,T=>d(T)),g=Array.from(c.layers),[x]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),w=g.indexOf(x),v=h?g.indexOf(h):-1,k=c.layersWithOutsidePointerEventsDisabled.size>0,j=v>=w,S=N3(T=>{const E=T.target,O=[...c.branches].some(A=>A.contains(E));!j||O||(i==null||i(T),s==null||s(T),T.defaultPrevented||l==null||l())},m),_=C3(T=>{const E=T.target;[...c.branches].some(A=>A.contains(E))||(r==null||r(T),s==null||s(T),T.defaultPrevented||l==null||l())},m);return v3(T=>{v===c.layers.size-1&&(a==null||a(T),!T.defaultPrevented&&l&&(T.preventDefault(),l()))},m),p.useEffect(()=>{if(h)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(w0=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(h)),c.layers.add(h),x0(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=w0)}},[h,m,n,c]),p.useEffect(()=>()=>{h&&(c.layers.delete(h),c.layersWithOutsidePointerEventsDisabled.delete(h),x0())},[h,c]),p.useEffect(()=>{const T=()=>f({});return document.addEventListener(ly,T),()=>document.removeEventListener(ly,T)},[]),o.jsx(we.div,{...u,ref:y,style:{pointerEvents:k?j?"auto":"none":void 0,...e.style},onFocusCapture:ue(e.onFocusCapture,_.onFocusCapture),onBlurCapture:ue(e.onBlurCapture,_.onBlurCapture),onPointerDownCapture:ue(e.onPointerDownCapture,S.onPointerDownCapture)})});gl.displayName=b3;var S3="DismissableLayerBranch",KC=p.forwardRef((e,t)=>{const n=p.useContext(BC),a=p.useRef(null),i=Pe(t,a);return p.useEffect(()=>{const r=a.current;if(r)return n.branches.add(r),()=>{n.branches.delete(r)}},[n.branches]),o.jsx(we.div,{...e,ref:i})});KC.displayName=S3;function N3(e,t=globalThis==null?void 0:globalThis.document){const n=fn(e),a=p.useRef(!1),i=p.useRef(()=>{});return p.useEffect(()=>{const r=l=>{if(l.target&&!a.current){let u=function(){$C(j3,n,c,{discrete:!0})};const c={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=u,t.addEventListener("click",i.current,{once:!0})):u()}else t.removeEventListener("click",i.current);a.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",r)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",r),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>a.current=!0}}function C3(e,t=globalThis==null?void 0:globalThis.document){const n=fn(e),a=p.useRef(!1);return p.useEffect(()=>{const i=r=>{r.target&&!a.current&&$C(_3,n,{originalEvent:r},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>a.current=!0,onBlurCapture:()=>a.current=!1}}function x0(){const e=new CustomEvent(ly);document.dispatchEvent(e)}function $C(e,t,n,{discrete:a}){const i=n.originalEvent.target,r=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),a?Wx(i,r):i.dispatchEvent(r)}var T3=gl,E3=KC,St=globalThis!=null&&globalThis.document?p.useLayoutEffect:()=>{},A3="Portal",Cc=p.forwardRef((e,t)=>{var l;const{container:n,...a}=e,[i,r]=p.useState(!1);St(()=>r(!0),[]);const s=n||i&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return s?LC.createPortal(o.jsx(we.div,{...a,ref:t}),s):null});Cc.displayName=A3;function P3(e,t){return p.useReducer((n,a)=>t[n][a]??n,e)}var fa=e=>{const{present:t,children:n}=e,a=M3(t),i=typeof n=="function"?n({present:a.isPresent}):p.Children.only(n),r=Pe(a.ref,R3(i));return typeof n=="function"||a.isPresent?p.cloneElement(i,{ref:r}):null};fa.displayName="Presence";function M3(e){const[t,n]=p.useState(),a=p.useRef(null),i=p.useRef(e),r=p.useRef("none"),s=e?"mounted":"unmounted",[l,u]=P3(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return p.useEffect(()=>{const c=wd(a.current);r.current=l==="mounted"?c:"none"},[l]),St(()=>{const c=a.current,h=i.current;if(h!==e){const m=r.current,f=wd(c);e?u("MOUNT"):f==="none"||(c==null?void 0:c.display)==="none"?u("UNMOUNT"):u(h&&m!==f?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,u]),St(()=>{if(t){let c;const h=t.ownerDocument.defaultView??window,d=f=>{const g=wd(a.current).includes(f.animationName);if(f.target===t&&g&&(u("ANIMATION_END"),!i.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",c=h.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},m=f=>{f.target===t&&(r.current=wd(a.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{h.clearTimeout(c),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:p.useCallback(c=>{a.current=c?getComputedStyle(c):null,n(c)},[])}}function wd(e){return(e==null?void 0:e.animationName)||"none"}function R3(e){var a,i;let t=(a=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var I3=tx[" useInsertionEffect ".trim().toString()]||St;function ma({prop:e,defaultProp:t,onChange:n=()=>{},caller:a}){const[i,r,s]=O3({defaultProp:t,onChange:n}),l=e!==void 0,u=l?e:i;{const h=p.useRef(e!==void 0);p.useEffect(()=>{const d=h.current;d!==l&&console.warn(`${a} is changing from ${d?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),h.current=l},[l,a])}const c=p.useCallback(h=>{var d;if(l){const m=L3(h)?h(e):h;m!==e&&((d=s.current)==null||d.call(s,m))}else r(h)},[l,e,r,s]);return[u,c]}function O3({defaultProp:e,onChange:t}){const[n,a]=p.useState(e),i=p.useRef(n),r=p.useRef(t);return I3(()=>{r.current=t},[t]),p.useEffect(()=>{var s;i.current!==n&&((s=r.current)==null||s.call(r,n),i.current=n)},[n,i]),[n,a,r]}function L3(e){return typeof e=="function"}var UC=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),D3="VisuallyHidden",Ym=p.forwardRef((e,t)=>o.jsx(we.span,{...e,ref:t,style:{...UC,...e.style}}));Ym.displayName=D3;var z3=Ym,qx="ToastProvider",[Gx,F3,B3]=pl("Toast"),[VC,lie]=Yt("Toast",[B3]),[K3,Jm]=VC(qx),HC=e=>{const{__scopeToast:t,label:n="Notification",duration:a=5e3,swipeDirection:i="right",swipeThreshold:r=50,children:s}=e,[l,u]=p.useState(null),[c,h]=p.useState(0),d=p.useRef(!1),m=p.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${qx}\`. Expected non-empty \`string\`.`),o.jsx(Gx.Provider,{scope:t,children:o.jsx(K3,{scope:t,label:n,duration:a,swipeDirection:i,swipeThreshold:r,toastCount:c,viewport:l,onViewportChange:u,onToastAdd:p.useCallback(()=>h(f=>f+1),[]),onToastRemove:p.useCallback(()=>h(f=>f-1),[]),isFocusedToastEscapeKeyDownRef:d,isClosePausedRef:m,children:s})})};HC.displayName=qx;var WC="ToastViewport",$3=["F8"],uy="toast.viewportPause",cy="toast.viewportResume",qC=p.forwardRef((e,t)=>
40{const{__scopeToast:n,hotkey:a=$3,label:i="Notifications ({hotkey})",...r}=e,s=Jm(WC,n),l=F3(n),u=p.useRef(null),c=p.useRef(null),h=p.useRef(null),d=p.useRef(null),m=Pe(t,d,s.onViewportChange),f=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),y=s.toastCount>0;p.useEffect(()=>{const x=w=>{var k;a.length!==0&&a.every(j=>w[j]||w.code===j)&&((k=d.current)==null||k.focus())};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[a]),p.useEffect(()=>{const x=u.current,w=d.current;if(y&&x&&w){const v=()=>{if(!s.isClosePausedRef.current){const _=new CustomEvent(uy);w.dispatchEvent(_),s.isClosePausedRef.current=!0}},k=()=>{if(s.isClosePausedRef.current){const _=new CustomEvent(cy);w.dispatchEvent(_),s.isClosePausedRef.current=!1}},j=_=>{!x.contains(_.relatedTarget)&&k()},S=()=>{x.contains(document.activeElement)||k()};return x.addEventListener("focusin",v),x.addEventListener("focusout",j),x.addEventListener("pointermove",v),x.addEventListener("pointerleave",S),window.addEventListener("blur",v),window.addEventListener("focus",k),()=>{x.removeEventListener("focusin",v),x.removeEventListener("focusout",j),x.removeEventListener("pointermove",v),x.removeEventListener("pointerleave",S),window.removeEventListener("blur",v),window.removeEventListener("focus",k)}}},[y,s.isClosePausedRef]);const g=p.useCallback(({tabbingDirection:x})=>{const v=l().map(k=>{const j=k.ref.current,S=[j,...tD(j)];return x==="forwards"?S:S.reverse()});return(x==="forwards"?v.reverse():v).flat()},[l]);return p.useEffect(()=>{const x=d.current;if(x){const w=v=>{var S,_,T;const k=v.altKey||v.ctrlKey||v.metaKey;if(v.key==="Tab"&&!k){const E=document.activeElement,O=v.shiftKey;if(v.target===x&&O){(S=c.current)==null||S.focus();return}const F=g({tabbingDirection:O?"backwards":"forwards"}),Y=F.findIndex(V=>V===E);wp(F.slice(Y+1))?v.preventDefault():O?(_=c.current)==null||_.focus():(T=h.current)==null||T.focus()}};return x.addEventListener("keydown",w),()=>x.removeEventListener("keydown",w)}},[l,g]),o.jsxs(E3,{ref:u,role:"region","aria-label":i.replace("{hotkey}",f),tabIndex:-1,style:{pointerEvents:y?void 0:"none"},children:[y&&o.jsx(dy,{ref:c,onFocusFromOutsideViewport:()=>{const x=g({tabbingDirection:"forwards"});wp(x)}}),o.jsx(Gx.Slot,{scope:n,children:o.jsx(we.ol,{tabIndex:-1,...r,ref:m})}),y&&o.jsx(dy,{ref:h,onFocusFromOutsideViewport:()=>{const x=g({tabbingDirection:"backwards"});wp(x)}})]})});qC.displayName=WC;var GC="ToastFocusProxy",dy=p.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:a,...i}=e,r=Jm(GC,n);return o.jsx(Ym,{"aria-hidden":!0,tabIndex:0,...i,ref:t,style:{position:"fixed"},onFocus:s=>{var c;const l=s.relatedTarget;!((c=r.viewport)!=null&&c.contains(l))&&a()}})});dy.displayName=GC;var Tc="Toast",U3="toast.swipeStart",V3="toast.swipeMove",H3="toast.swipeCancel",W3="toast.swipeEnd",YC=p.forwardRef((e,t)=>{const{forceMount:n,open:a,defaultOpen:i,onOpenChange:r,...s}=e,[l,u]=ma({prop:a,defaultProp:i??!0,onChange:r,caller:Tc});return o.jsx(fa,{present:n||l,children:o.jsx(Y3,{open:l,...s,ref:t,onClose:()=>u(!1),onPause:fn(e.onPause),onResume:fn(e.onResume),onSwipeStart:ue(e.onSwipeStart,c=>{c.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:ue(e.onSwipeMove,c=>{const{x:h,y:d}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","move"),c.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${h}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${d}px`)}),onSwipeCancel:ue(e.onSwipeCancel,c=>{c.currentTarget.setAttribute("data-swipe","cancel"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:ue(e.onSwipeEnd,c=>{const{x:h,y:d}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","end"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${h}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${d}px`),u(!1)})})})});YC.displayName=Tc;var[q3,G3]=VC(Tc,{onClose(){}}),Y3=p.forwardRef((e,t)=>
40{const{__scopeToast:n,type:a="foreground",duration:i,open:r,onClose:s,onEscapeKeyDown:l,onPause:u,onResume:c,onSwipeStart:h,onSwipeMove:d,onSwipeCancel:m,onSwipeEnd:f,...y}=e,g=Jm(Tc,n),[x,w]=p.useState(null),v=Pe(t,V=>w(V)),k=p.useRef(null),j=p.useRef(null),S=i||g.duration,_=p.useRef(0),T=p.useRef(S),E=p.useRef(0),{onToastAdd:O,onToastRemove:A}=g,R=fn(()=>{var z;(x==null?void 0:x.contains(document.activeElement))&&((z=g.viewport)==null||z.focus()),s()}),F=p.useCallback(V=>{!V||V===1/0||(window.clearTimeout(E.current),_.current=new Date().getTime(),E.current=window.setTimeout(R,V))},[R]);p.useEffect(()=>{const V=g.viewport;if(V){const z=()=>{F(T.current),c==null||c()},W=()=>{const B=new Date().getTime()-_.current;T.current=T.current-B,window.clearTimeout(E.current),u==null||u()};return V.addEventListener(uy,W),V.addEventListener(cy,z),()=>{V.removeEventListener(uy,W),V.removeEventListener(cy,z)}}},[g.viewport,S,u,c,F]),p.useEffect(()=>{r&&!g.isClosePausedRef.current&&F(S)},[r,S,g.isClosePausedRef,F]),p.useEffect(()=>(O(),()=>A()),[O,A]);const Y=p.useMemo(()=>x?n2(x):null,[x]);return g.viewport?o.jsxs(o.Fragment,{children:[Y&&o.jsx(J3,{__scopeToast:n,role:"status","aria-live":a==="foreground"?"assertive":"polite","aria-atomic":!0,children:Y}),o.jsx(q3,{scope:n,onClose:R,children:Os.createPortal(o.jsx(Gx.ItemSlot,{scope:n,children:o.jsx(T3,{asChild:!0,onEscapeKeyDown:ue(l,()=>{g.isFocusedToastEscapeKeyDownRef.current||R(),g.isFocusedToastEscapeKeyDownRef.current=!1}),children:o.jsx(we.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":r?"open":"closed","data-swipe-direction":g.swipeDirection,...y,ref:v,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:ue(e.onKeyDown,V=>{V.key==="Escape"&&(l==null||l(V.nativeEvent),V.nativeEvent.defaultPrevented||(g.isFocusedToastEscapeKeyDownRef.current=!0,R()))}),onPointerDown:ue(e.onPointerDown,V=>{V.button===0&&(k.current={x:V.clientX,y:V.clientY})}),onPointerMove:ue(e.onPointerMove,V=>{if(!k.current)return;const z=V.clientX-k.current.x,W=V.clientY-k.current.y,B=!!j.current,M=["left","right"].includes(g.swipeDirection),I=["left","up"].includes(g.swipeDirection)?Math.min:Math.max,b=M?I(0,z):0,C=M?0:I(0,W),D=V.pointerType==="touch"?10:2,N={x:b,y:C},J={originalEvent:V,delta:N};B?(j.current=N,xd(V3,d,J,{discrete:!1})):k0(N,g.swipeDirection,D)?(j.current=N,xd(U3,h,J,{discrete:!1}),V.target.setPointerCapture(V.pointerId)):(Math.abs(z)>D||Math.abs(W)>D)&&(k.current=null)}),onPointerUp:ue(e.onPointerUp,V=>{const z=j.current,W=V.target;if(W.hasPointerCapture(V.pointerId)&&W.releasePointerCapture(V.pointerId),j.current=null,k.current=null,z){const B=V.currentTarget,M={originalEvent:V,delta:z};k0(z,g.swipeDirection,g.swipeThreshold)?xd(W3,f,M,{discrete:!0}):xd(H3,m,M,{discrete:!0}),B.addEventListener("click",I=>I.preventDefault(),{once:!0})}})})})}),g.viewport)})]}):null}),J3=e=>{const{__scopeToast:t,children:n,...a}=e,i=Jm(Tc,t),[r,s]=p.useState(!1),[l,u]=p.useState(!1);return Z3(()=>s(!0)),p.useEffect(()=>{const c=window.setTimeout(()=>u(!0),1e3);return()=>window.clearTimeout(c)},[]),l?null:o.jsx(Cc,{asChild:!0,children:o.jsx(Ym,{...a,children:r&&o.jsxs(o.Fragment,{children:[i.label," ",n]})})})},Q3="ToastTitle",JC=p.forwardRef((e,t)=>{const{__scopeToast:n,...a}=e;return o.jsx(we.div,{...a,ref:t})});JC.displayName=Q3;var X3="ToastDescription",QC=p.forwardRef((e,t)=>{const{__scopeToast:n,...a}=e;return o.jsx(we.div,{...a,ref:t})});QC.displayName=X3;var XC="ToastAction",ZC=p.forwardRef((e,t)=>{const{altText:n,...a}=e;return n.trim()?o.jsx(t2,{altText:n,asChild:!0,children:o.jsx(Yx,{...a,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${XC}\`. Expected non-empty \`string\`.`),null)});ZC.displayName=XC;var e2="ToastClose",Yx=p.forwardRef((e,t)=>{const{__scopeToast:n,...a}=e,i=G3(e2,n);return o.jsx(t2,{asChild:!0,children:o.jsx(we.button,{type:"button",...a,ref:t,onClick:ue(e.onClick,i.onClose)})})});Yx.displayName=e2;var t2=p.forwardRef((e,t)=>{const{__scopeToast:n,altText:a,...i}=e;return o.jsx(we.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":a||void 0,...i,ref:t})});function n2(e){const t=[];
vendor: 16,384 bytes, lines 40-230
40return Array.from(e.childNodes).forEach(a=>{if(a.nodeType===a.TEXT_NODE&&a.textContent&&t.push(a.textContent),eD(a)){const i=a.ariaHidden||a.hidden||a.style.display==="none",r=a.dataset.radixToastAnnounceExclude==="";if(!i)if(r){const s=a.dataset.radixToastAnnounceAlt;s&&t.push(s)}else t.push(...n2(a))}}),t}function xd(e,t,n,{discrete:a}){const i=n.originalEvent.currentTarget,r=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),a?Wx(i,r):i.dispatchEvent(r)}var k0=(e,t,n=0)=>{const a=Math.abs(e.x),i=Math.abs(e.y),r=a>i;return t==="left"||t==="right"?r&&a>n:!r&&i>n};function Z3(e=()=>{}){const t=fn(e);St(()=>{let n=0,a=0;return n=window.requestAnimationFrame(()=>a=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(a)}},[t])}function eD(e){return e.nodeType===e.ELEMENT_NODE}function tD(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:a=>{const i=a.tagName==="INPUT"&&a.type==="hidden";return a.disabled||a.hidden||i?NodeFilter.FILTER_SKIP:a.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function wp(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var nD=HC,a2=qC,i2=YC,r2=JC,s2=QC,o2=ZC,l2=Yx;function u2(e){var t,n,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=u2(e[t]))&&(a&&(a+=" "),a+=n)}else for(n in e)e[n]&&(a&&(a+=" "),a+=n);return a}function c2(){for(var e,t,n=0,a="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=u2(e))&&(a&&(a+=" "),a+=t);return a}const v0=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,b0=c2,Qm=(e,t)=>n=>{var a;if((t==null?void 0:t.variants)==null)return b0(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:r}=t,s=Object.keys(i).map(c=>{const h=n==null?void 0:n[c],d=r==null?void 0:r[c];if(h===null)return null;const m=v0(h)||v0(d);return i[c][m]}),l=n&&Object.entries(n).reduce((c,h)=>{let[d,m]=h;return m===void 0||(c[d]=m),c},{}),u=t==null||(a=t.compoundVariants)===null||a===void 0?void 0:a.reduce((c,h)=>{let{class:d,className:m,...f}=h;return Object.entries(f).every(y=>{let[g,x]=y;return Array.isArray(x)?x.includes({...r,...l}[g]):{...r,...l}[g]===x})?[...c,d,m]:c},[]);return b0(e,s,u,n==null?void 0:n.class,n==null?void 0:n.className)};/** 41 * @license lucide-react v0.462.0 - ISC 42 * 43 * This source code is licensed under the ISC license. 44 * See the LICENSE file in the root directory of this source tree. 45 */const aD=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),d2=(...e)=>e.filter((t,n,a)=>!!t&&t.trim()!==""&&a.indexOf(t)===n).join(" ").trim();/** 46 * @license lucide-react v0.462.0 - ISC 47 * 48 * This source code is licensed under the ISC license. 49 * See the LICENSE file in the root directory of this source tree. 50 */var iD={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** 51 * @license lucide-react v0.462.0 - ISC 52 * 53 * This source code is licensed under the ISC license. 54 * See the LICENSE file in the root directory of this source tree. 55 */const rD=p.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:a,className:i="",children:r,iconNode:s,...l},u)=>p.createElement("svg",{ref:u,...iD,width:t,height:t,stroke:e,strokeWidth:a?Number(n)*24/Number(t):n,className:d2("lucide",i),...l},[...s.map(([c,h])=>p.createElement(c,h)),...Array.isArray(r)?r:[r]]));/** 56 * @license lucide-react v0.462.0 - ISC 57 * 58 * This source code is licensed under the ISC license. 59 * See the LICENSE file in the root directory of this source tree. 60 */const le=(e,t)=>{const n=p.forwardRef(({className:a,...i},r)=>p.createElement(rD,{ref:r,iconNode:t,className:d2(`lucide-${aD(e)}`,a),...i}));return n.displayName=`${e}`,n};/** 61 * @license lucide-react v0.462.0 - ISC 62 * 63 * This source code is licensed under the ISC license. 64 * See the LICENSE file in the root directory of this source tree. 65 */const tl=le("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/** 66 * @license lucide-react v0.462.0 - ISC 67 * 68 * This source code is licensed under the ISC license. 69 * See the LICENSE file in the root directory of this source tree. 70 */const Kn=le("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/** 71 * @license lucide-react v0.462.0 - ISC 72 * 73 * This source code is licensed under the ISC license. 74 * See the LICENSE file in the root directory of this source tree. 75 */const h2=le("Award",[["path",{d:"m15.477 12.89 1.515 8.526a.5.5 0 0 1-.81.47l-3.58-2.687a1 1 0 0 0-1.197 0l-3.586 2.686a.5.5 0 0 1-.81-.469l1.514-8.526",key:"1yiouv"}],["circle",{cx:"12",cy:"8",r:"6",key:"1vp47v"}]]);/** 76 * @license lucide-react v0.462.0 - ISC 77 * 78 * This source code is licensed under the ISC license. 79 * See the LICENSE file in the root directory of this source tree. 80 */const sD=le("Baby",[["path",{d:"M9 12h.01",key:"157uk2"}],["path",{d:"M15 12h.01",key:"1k8ypt"}],["path",{d:"M10 16c.5.3 1.2.5 2 .5s1.5-.2 2-.5",key:"1u7htd"}],["path",{d:"M19 6.3a9 9 0 0 1 1.8 3.9 2 2 0 0 1 0 3.6 9 9 0 0 1-17.6 0 2 2 0 0 1 0-3.6A9 9 0 0 1 12 3c2 0 3.5 1.1 3.5 2.5s-.9 2.5-2 2.5c-.8 0-1.5-.4-1.5-1",key:"5yv0yz"}]]);/** 81 * @license lucide-react v0.462.0 - ISC 82 * 83 * This source code is licensed under the ISC license. 84 * See the LICENSE file in the root directory of this source tree. 85 */const oD=le("Ban",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]]);/** 86 * @license lucide-react v0.462.0 - ISC 87 * 88 * This source code is licensed under the ISC license. 89 * See the LICENSE file in the root directory of this source tree. 90 */const j0=le("Bell",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}]]);/** 91 * @license lucide-react v0.462.0 - ISC 92 * 93 * This source code is licensed under the ISC license. 94 * See the LICENSE file in the root directory of this source tree. 95 */const La=le("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);/** 96 * @license lucide-react v0.462.0 - ISC 97 * 98 * This source code is licensed under the ISC license. 99 * See the LICENSE file in the root directory of this source tree. 100 */const hy=le("Briefcase",[["path",{d:"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"jecpp"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]]);/** 101 * @license lucide-react v0.462.0 - ISC 102 * 103 * This source code is licensed under the ISC license. 104 * See the LICENSE file in the root directory of this source tree. 105 */const Ss=le("Calculator",[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",key:"1nb95v"}],["line",{x1:"8",x2:"16",y1:"6",y2:"6",key:"x4nwl0"}],["line",{x1:"16",x2:"16",y1:"14",y2:"18",key:"wjye3r"}],["path",{d:"M16 10h.01",key:"1m94wz"}],["path",{d:"M12 10h.01",key:"1nrarc"}],["path",{d:"M8 10h.01",key:"19clt8"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M8 18h.01",key:"lrp35t"}]]);/** 106 * @license lucide-react v0.462.0 - ISC 107 * 108 * This source code is licensed under the ISC license. 109 * See the LICENSE file in the root directory of this source tree. 110 */const Xm=le("CalendarDays",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]]);/** 111 * @license lucide-react v0.462.0 - ISC 112 * 113 * This source code is licensed under the ISC license. 114 * See the LICENSE file in the root directory of this source tree. 115 */const lD=le("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/** 116 * @license lucide-react v0.462.0 - ISC 117 * 118 * This source code is licensed under the ISC license. 119 * See the LICENSE file in the root directory of this source tree. 120 */const uD=le("Camera",[["path",{d:"M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z",key:"1tc9qg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]]);/** 121 * @license lucide-react v0.462.0 - ISC 122 * 123 * This source code is licensed under the ISC license. 124 * See the LICENSE file in the root directory of this source tree. 125 */const Jx=le("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** 126 * @license lucide-react v0.462.0 - ISC 127 * 128 * This source code is licensed under the ISC license. 129 * See the LICENSE file in the root directory of this source tree. 130 */const Ec=le("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** 131 * @license lucide-react v0.462.0 - ISC 132 * 133 * This source code is licensed under the ISC license. 134 * See the LICENSE file in the root directory of this source tree. 135 */const ts=le("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** 136 * @license lucide-react v0.462.0 - ISC 137 * 138 * This source code is licensed under the ISC license. 139 * See the LICENSE file in the root directory of this source tree. 140 */const Qx=le("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** 141 * @license lucide-react v0.462.0 - ISC 142 * 143 * This source code is licensed under the ISC license. 144 * See the LICENSE file in the root directory of this source tree. 145 */const oi=le("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/** 146 * @license lucide-react v0.462.0 - ISC 147 * 148 * This source code is licensed under the ISC license. 149 * See the LICENSE file in the root directory of this source tree. 150 */const cD=le("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** 151 * @license lucide-react v0.462.0 - ISC 152 * 153 * This source code is licensed under the ISC license. 154 * See the LICENSE file in the root directory of this source tree. 155 */const dD=le("CircleDollarSign",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8",key:"1h4pet"}],["path",{d:"M12 18V6",key:"zqpxq5"}]]);/** 156 * @license lucide-react v0.462.0 - ISC 157 * 158 * This source code is licensed under the ISC license. 159 * See the LICENSE file in the root directory of this source tree. 160 */const m2=le("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** 161 * @license lucide-react v0.462.0 - ISC 162 * 163 * This source code is licensed under the ISC license. 164 * See the LICENSE file in the root directory of this source tree. 165 */const Qu=le("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/** 166 * @license lucide-react v0.462.0 - ISC 167 * 168 * This source code is licensed under the ISC license. 169 * See the LICENSE file in the root directory of this source tree. 170 */const hD=le("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/** 171 * @license lucide-react v0.462.0 - ISC 172 * 173 * This source code is licensed under the ISC license. 174 * See the LICENSE file in the root directory of this source tree. 175 */const Ac=le("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/** 176 * @license lucide-react v0.462.0 - ISC 177 * 178 * This source code is licensed under the ISC license. 179 * See the LICENSE file in the root directory of this source tree. 180 */const mD=le("Crown",[["path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]]);/** 181 * @license lucide-react v0.462.0 - ISC 182 * 183 * This source code is licensed under the ISC license. 184 * See the LICENSE file in the root directory of this source tree. 185 */const _0=le("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/** 186 * @license lucide-react v0.462.0 - ISC 187 * 188 * This source code is licensed under the ISC license. 189 * See the LICENSE file in the root directory of this source tree. 190 */const Nn=le("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/** 191 * @license lucide-react v0.462.0 - ISC 192 * 193 * This source code is licensed under the ISC license. 194 * See the LICENSE file in the root directory of this source tree. 195 */const f2=le("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/** 196 * @license lucide-react v0.462.0 - ISC 197 * 198 * This source code is licensed under the ISC license. 199 * See the LICENSE file in the root directory of this source tree. 200 */const Zm=le("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** 201 * @license lucide-react v0.462.0 - ISC 202 * 203 * This source code is licensed under the ISC license. 204 * See the LICENSE file in the root directory of this source tree. 205 */const p2=le("FileCheck",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"m9 15 2 2 4-4",key:"1grp1n"}]]);/** 206 * @license lucide-react v0.462.0 - ISC 207 * 208 * This source code is licensed under the ISC license. 209 * See the LICENSE file in the root directory of this source tree. 210 */const Jn=le("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/** 211 * @license lucide-react v0.462.0 - ISC 212 * 213 * This source code is licensed under the ISC license. 214 * See the LICENSE file in the root directory of this source tree. 215 */const Xx=le("Flame",[["path",{d:"M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z",key:"96xj49"}]]);/** 216 * @license lucide-react v0.462.0 - ISC 217 * 218 * This source code is licensed under the ISC license. 219 * See the LICENSE file in the root directory of this source tree. 220 */const fD=le("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/** 221 * @license lucide-react v0.462.0 - ISC 222 * 223 * This source code is licensed under the ISC license. 224 * See the LICENSE file in the root directory of this source tree. 225 */const pD=le("GraduationCap",[["path",{d:"M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z",key:"j76jl0"}],["path",{d:"M22 10v6",key:"1lu8f3"}],["path",{d:"M6 12.5V16a6 3 0 0 0 12 0v-3.5",key:"1r8lef"}]]);/** 226 * @license lucide-react v0.462.0 - ISC 227 * 228 * This source code is licensed under the ISC license. 229 * See the LICENSE file in the root directory of this source tree. 230 */const my=le("Hand",[["path",{d:"M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2",key:"1fvzgz"}],["path",{d:"M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2",key:"1kc0my"}],
230["path",{d:"M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8",key:"10h0bg"}],["path",{d:"M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15",key:"1s1gnw"}]]);/** 231 * @license lucide-react v0.462.0 - ISC 232 * 233 * This source code is licensed under the ISC license. 234 * See the LICENSE file in the root directory of this source tree. 235 */const gD=le("HardHat",[["path",{d:"M10 10V5a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v5",key:"1p9q5i"}],["path",{d:"M14 6a6 6 0 0 1 6 6v3",key:"1hnv84"}],["path",{d:"M4 15v-3a6 6 0 0 1 6-6",key:"9ciidu"}],["rect",{x:"2",y:"15",width:"20",height:"4",rx:"1",key:"g3x8cw"}]]);/** 236 * @license lucide-react v0.462.0 - ISC 237 * 238 * This source code is licensed under the ISC license. 239 * See the LICENSE file in the root directory of this source tree. 240 */const g2=le("Heart",[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}]]);/** 241 * @license lucide-react v0.462.0 - ISC 242 * 243 * This source code is licensed under the ISC license. 244 * See the LICENSE file in the root directory of this source tree. 245 */const yD=le("History",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);/** 246 * @license lucide-react v0.462.0 - ISC 247 * 248 * This source code is licensed under the ISC license. 249 * See the LICENSE file in the root directory of this source tree. 250 */const y2=le("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);/** 251 * @license lucide-react v0.462.0 - ISC 252 * 253 * This source code is licensed under the ISC license. 254 * See the LICENSE file in the root directory of this source tree. 255 */const wD=le("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]);/** 256 * @license lucide-react v0.462.0 - ISC 257 * 258 * This source code is licensed under the ISC license. 259 * See the LICENSE file in the root directory of this source tree. 260 */const Zx=le("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/** 261 * @license lucide-react v0.462.0 - ISC 262 * 263 * This source code is licensed under the ISC license. 264 * See the LICENSE file in the root directory of this source tree. 265 */const xD=le("Landmark",[["line",{x1:"3",x2:"21",y1:"22",y2:"22",key:"j8o0r"}],["line",{x1:"6",x2:"6",y1:"18",y2:"11",key:"10tf0k"}],["line",{x1:"10",x2:"10",y1:"18",y2:"11",key:"54lgf6"}],["line",{x1:"14",x2:"14",y1:"18",y2:"11",key:"380y"}],["line",{x1:"18",x2:"18",y1:"18",y2:"11",key:"1kevvc"}],["polygon",{points:"12 2 20 7 4 7",key:"jkujk7"}]]);/** 266 * @license lucide-react v0.462.0 - ISC 267 * 268 * This source code is licensed under the ISC license. 269 * See the LICENSE file in the root directory of this source tree. 270 */const kD=le("Languages",[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]]);/** 271 * @license lucide-react v0.462.0 - ISC 272 * 273 * This source code is licensed under the ISC license. 274 * See the LICENSE file in the root directory of this source tree. 275 */const vD=le("Laptop",[["path",{d:"M20 16V7a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v9m16 0H4m16 0 1.28 2.55a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45L4 16",key:"tarvll"}]]);/** 276 * @license lucide-react v0.462.0 - ISC 277 * 278 * This source code is licensed under the ISC license. 279 * See the LICENSE file in the root directory of this source tree. 280 */const bD=le("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);/** 281 * @license lucide-react v0.462.0 - ISC 282 * 283 * This source code is licensed under the ISC license. 284 * See the LICENSE file in the root directory of this source tree. 285 */const Be=le("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** 286 * @license lucide-react v0.462.0 - ISC 287 * 288 * This source code is licensed under the ISC license. 289 * See the LICENSE file in the root directory of this source tree.
290 */const jD=le("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/** 291 * @license lucide-react v0.462.0 - ISC 292 * 293 * This source code is licensed under the ISC license. 294 * See the LICENSE file in the root directory of this source tree. 295 */const w2=le("LogIn",[["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}],["polyline",{points:"10 17 15 12 10 7",key:"1ail0h"}],["line",{x1:"15",x2:"3",y1:"12",y2:"12",key:"v6grx8"}]]);/** 296 * @license lucide-react v0.462.0 - ISC 297 * 298 * This source code is licensed under the ISC license. 299 * See the LICENSE file in the root directory of this source tree. 300 */const fy=le("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/** 301 * @license lucide-react v0.462.0 - ISC 302 * 303 * This source code is licensed under the ISC license. 304 * See the LICENSE file in the root directory of this source tree. 305 */const py=le("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);/** 306 * @license lucide-react v0.462.0 - ISC 307 * 308 * This source code is licensed under the ISC license. 309 * See the LICENSE file in the root directory of this source tree. 310 */const Pc=le("MapPin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);/** 311 * @license lucide-react v0.462.0 - ISC 312 * 313 * This source code is licensed under the ISC license. 314 * See the LICENSE file in the root directory of this source tree. 315 */const S0=le("Medal",[["path",{d:"M7.21 15 2.66 7.14a2 2 0 0 1 .13-2.2L4.4 2.8A2 2 0 0 1 6 2h12a2 2 0 0 1 1.6.8l1.6 2.14a2 2 0 0 1 .14 2.2L16.79 15",key:"143lza"}],["path",{d:"M11 12 5.12 2.2",key:"qhuxz6"}],["path",{d:"m13 12 5.88-9.8",key:"hbye0f"}],["path",{d:"M8 7h8",key:"i86dvs"}],["circle",{cx:"12",cy:"17",r:"5",key:"qbz8iq"}],["path",{d:"M12 18v-2h-.5",key:"fawc4q"}]]);/** 316 * @license lucide-react v0.462.0 - ISC 317 * 318 * This source code is licensed under the ISC license. 319 * See the LICENSE file in the root directory of this source tree. 320 */const _D=le("Megaphone",[["path",{d:"m3 11 18-5v12L3 14v-3z",key:"n962bs"}],["path",{d:"M11.6 16.8a3 3 0 1 1-5.8-1.6",key:"1yl0tm"}]]);/** 321 * @license lucide-react v0.462.0 - ISC 322 * 323 * This source code is licensed under the ISC license. 324 * See the LICENSE file in the root directory of this source tree. 325 */const SD=le("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/** 326 * @license lucide-react v0.462.0 - ISC 327 * 328 * This source code is licensed under the ISC license. 329 * See the LICENSE file in the root directory of this source tree. 330 */const Ns=le("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/** 331 * @license lucide-react v0.462.0 - ISC 332 * 333 * This source code is licensed under the ISC license. 334 * See the LICENSE file in the root directory of this source tree. 335 */const ND=le("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/** 336 * @license lucide-react v0.462.0 - ISC 337 * 338 * This source code is licensed under the ISC license. 339 * See the LICENSE file in the root directory of this source tree. 340 */const CD=le("Music2",[["circle",{cx:"8",cy:"18",r:"4",key:"1fc0mg"}],["path",{d:"M12 18V2l7 4",key:"g04rme"}]]);/** 341 * @license lucide-react v0.462.0 - ISC 342 * 343 * This source code is licensed under the ISC license. 344 * See the LICENSE file in the root directory of this source tree. 345 */const TD=le("Pause",[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]]);/** 346 * @license lucide-react v0.462.0 - ISC 347 * 348 * This source code is licensed under the ISC license. 349 * See the LICENSE file in the root directory of this source tree. 350 */const ED=le("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/** 351 * @license lucide-react v0.462.0 - ISC 352 * 353 * This source code is licensed under the ISC license. 354 * See the LICENSE file in the root directory of this source tree. 355 */const AD=le("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/** 356 * @license lucide-react v0.462.0 - ISC 357 * 358 * This source code is licensed under the ISC license. 359 * See the LICENSE file in the root directory of this source tree. 360 */const ek=le("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** 361 * @license lucide-react v0.462.0 - ISC 362 * 363 * This source code is licensed under the ISC license. 364 * See the LICENSE file in the root directory of this source tree. 365 */const PD=le("Quote",[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]]);/** 366 * @license lucide-react v0.462.0 - ISC 367 * 368 * This source code is licensed under the ISC license. 369 * See the LICENSE file in the root directory of this source tree. 370 */const x2=le("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/** 371 * @license lucide-react v0.462.0 - ISC 372 * 373 * This source code is licensed under the ISC license. 374 * See the LICENSE file in the root directory of this source tree. 375 */const MD=le("Reply",[["polyline",{points:"9 17 4 12 9 7",key:"hvgpf2"}
375],["path",{d:"M20 18v-2a4 4 0 0 0-4-4H4",key:"5vmcpk"}]]);/** 376 * @license lucide-react v0.462.0 - ISC 377 * 378 * This source code is licensed under the ISC license. 379 * See the LICENSE file in the root directory of this source tree. 380 */const RD=le("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/** 381 * @license lucide-react v0.462.0 - ISC 382 * 383 * This source code is licensed under the ISC license. 384 * See the LICENSE file in the root directory of this source tree. 385 */const ID=le("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]);/** 386 * @license lucide-react v0.462.0 - ISC 387 * 388 * This source code is licensed under the ISC license. 389 * See the LICENSE file in the root directory of this source tree. 390 */const gy=le("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/** 391 * @license lucide-react v0.462.0 - ISC 392 * 393 * This source code is licensed under the ISC license. 394 * See the LICENSE file in the root directory of this source tree. 395 */const Ft=le("Scale",[["path",{d:"m16 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z",key:"7g6ntu"}],["path",{d:"m2 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z",key:"ijws7r"}],["path",{d:"M7 21h10",key:"1b0cd5"}],["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"M3 7h2c2 0 5-1 7-2 2 1 5 2 7 2h2",key:"3gwbw2"}]]);/** 396 * @license lucide-react v0.462.0 - ISC 397 * 398 * This source code is licensed under the ISC license. 399 * See the LICENSE file in the root directory of this source tree. 400 */const k2=le("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** 401 * @license lucide-react v0.462.0 - ISC 402 * 403 * This source code is licensed under the ISC license. 404 * See the LICENSE file in the root directory of this source tree. 405 */const Vn=le("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/** 406 * @license lucide-react v0.462.0 - ISC 407 * 408 * This source code is licensed under the ISC license. 409 * See the LICENSE file in the root directory of this source tree. 410 */const OD=le("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);/** 411 * @license lucide-react v0.462.0 - ISC 412 * 413 * This source code is licensed under the ISC license. 414 * See the LICENSE file in the root directory of this source tree. 415 */const v2=le("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** 416 * @license lucide-react v0.462.0 - ISC 417 * 418 * This source code is licensed under the ISC license. 419 * See the LICENSE file in the root directory of this source tree. 420 */const LD=le("Share2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]);/** 421 * @license lucide-react v0.462.0 - ISC 422 * 423 * This source code is licensed under the ISC license. 424 * See the LICENSE file in the root directory of this source tree. 425 */const Ai=le("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",ke
425y:"oel41y"}]]);/** 426 * @license lucide-react v0.462.0 - ISC 427 * 428 * This source code is licensed under the ISC license. 429 * See the LICENSE file in the root directory of this source tree. 430 */const Hn=le("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/** 431 * @license lucide-react v0.462.0 - ISC 432 * 433 * This source code is licensed under the ISC license. 434 * See the LICENSE file in the root directory of this source tree. 435 */const DD=le("Tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);/** 436 * @license lucide-react v0.462.0 - ISC 437 * 438 * This source code is licensed under the ISC license. 439 * See the LICENSE file in the root directory of this source tree. 440 */const zD=le("ThumbsUp",[["path",{d:"M7 10v12",key:"1qc93n"}],["path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z",key:"emmmcr"}]]);/** 441 * @license lucide-react v0.462.0 - ISC 442 * 443 * This source code is licensed under the ISC license. 444 * See the LICENSE file in the root directory of this source tree. 445 */const FD=le("Tractor",[["path",{d:"m10 11 11 .9a1 1 0 0 1 .8 1.1l-.665 4.158a1 1 0 0 1-.988.842H20",key:"she1j9"}],["path",{d:"M16 18h-5",key:"bq60fd"}],["path",{d:"M18 5a1 1 0 0 0-1 1v5.573",key:"1kv8ia"}],["path",{d:"M3 4h8.129a1 1 0 0 1 .99.863L13 11.246",key:"1q1ert"}],["path",{d:"M4 11V4",key:"9ft8pt"}],["path",{d:"M7 15h.01",key:"k5ht0j"}],["path",{d:"M8 10.1V4",key:"1jgyzo"}],["circle",{cx:"18",cy:"18",r:"2",key:"1emm8v"}],["circle",{cx:"7",cy:"15",r:"5",key:"ddtuc"}]]);/** 446 * @license lucide-react v0.462.0 - ISC 447 * 448 * This source code is licensed under the ISC license. 449 * See the LICENSE file in the root directory of this source tree. 450 */const Mc=le("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/** 451 * @license lucide-react v0.462.0 - ISC 452 * 453 * This source code is licensed under the ISC license. 454 * See the LICENSE file in the root directory of this source tree. 455 */const Jh=le("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/** 456 * @license lucide-react v0.462.0 - ISC 457 * 458 * This source code is licensed under the ISC license. 459 * See the LICENSE file in the root directory of this source tree. 460 */const b2=le("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** 461 * @license lucide-react v0.462.0 - ISC 462 * 463 * This source code is licensed under the ISC license. 464 * See the LICENSE file in the root directory of this source tree. 465 */const Wn=le("Trophy",[["path",{d:"M6 9H4.5a2.5 2.5 0 0 1 0-5H6",key:"17hqa7"}],["path",{d:"M18 9h1.5a2.5 2.5 0 0 0 0-5H18",key:"lmptdp"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22",key:"1nw9bq"}],["path",{d:"M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22",key:"1np0yb"}],["path",{d:"M18 2H6v7a6 6 0 0 0 12 0V2Z",key:"u46fv3"}]]);/** 466 * @license lucide-react v0.462.0 - ISC 467 * 468 * This source code is licensed under the ISC license. 469 * See the LICENSE file in the root directory of this source tree. 470 */const bu=le("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/** 471 * @license lucide-react v0.462.0 - ISC 472 * 473 * This source code is licensed under the ISC license. 474 * See the LICENSE file in the root directory of this source tree. 475 */const j2=le("UserCheck",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}
vendor: 8,978 bytes, lines 475-515
475],["polyline",{points:"16 11 18 13 22 9",key:"1pwet4"}]]);/** 476 * @license lucide-react v0.462.0 - ISC 477 * 478 * This source code is licensed under the ISC license. 479 * See the LICENSE file in the root directory of this source tree. 480 */const BD=le("UserPlus",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]);/** 481 * @license lucide-react v0.462.0 - ISC 482 * 483 * This source code is licensed under the ISC license. 484 * See the LICENSE file in the root directory of this source tree. 485 */const ef=le("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/** 486 * @license lucide-react v0.462.0 - ISC 487 * 488 * This source code is licensed under the ISC license. 489 * See the LICENSE file in the root directory of this source tree. 490 */const Si=le("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/** 491 * @license lucide-react v0.462.0 - ISC 492 * 493 * This source code is licensed under the ISC license. 494 * See the LICENSE file in the root directory of this source tree. 495 */const KD=le("VolumeX",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]]);/** 496 * @license lucide-react v0.462.0 - ISC 497 * 498 * This source code is licensed under the ISC license. 499 * See the LICENSE file in the root directory of this source tree. 500 */const nl=le("Vote",[["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}],["path",{d:"M5 7c0-1.1.9-2 2-2h10a2 2 0 0 1 2 2v12H5V7Z",key:"1ezoue"}],["path",{d:"M22 19H2",key:"nuriw5"}]]);/** 501 * @license lucide-react v0.462.0 - ISC 502 * 503 * This source code is licensed under the ISC license. 504 * See the LICENSE file in the root directory of this source tree. 505 */const yl=le("Wallet",[["path",{d:"M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1",key:"18etb6"}],["path",{d:"M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4",key:"xoc0q4"}]]);/** 506 * @license lucide-react v0.462.0 - ISC 507 * 508 * This source code is licensed under the ISC license. 509 * See the LICENSE file in the root directory of this source tree. 510 */const Rc=le("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/** 511 * @license lucide-react v0.462.0 - ISC 512 * 513 * This source code is licensed under the ISC license. 514 * See the LICENSE file in the root directory of this source tree. 515 */const _2=le("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),tk="-",$D=e=>{const t=VD(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:s=>{const l=s.split(tk);return l[0]===""&&l.length!==1&&l.shift(),S2(l,t)||UD(s)},getConflictingClassGroupIds:(s,l)=>{const u=n[s]||[];return l&&a[s]?[...u,...a[s]]:u}}},S2=(e,t)=>{var s;if(e.length===0)return t.classGroupId;const n=e[0],a=t.nextPart.get(n),i=a?S2(e.slice(1),a):void 0;if(i)return i;if(t.validators.length===0)return;const r=e.join(tk);return(s=t.validators.find(({validator:l})=>l(r)))==null?void 0:s.classGroupId},N0=/^\[(.+)\]$/,UD=e=>{if(N0.test(e)){const t=N0.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},VD=e=>{const{theme:t,prefix:n}=e,a={nextPart:new Map,validators:[]};return WD(Object.entries(e.classGroups),n).forEach(([r,s])=>{yy(s,a,r,t)}),a},yy=(e,t,n,a)=>{e.forEach(i=>{if(typeof i=="string"){const r=i===""?t:C0(t,i);r.classGroupId=n;return}if(typeof i=="function"){if(HD(i)){yy(i(a),t,n,a);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([r,s])=>{yy(s,C0(t,r),n,a)})})},C0=(e,t)=>{let n=e;return t.split(tk).forEach(a=>{n.nextPart.has(a)||n.nextPart.set(a,{nextPart:new Map,validators:[]}),n=n.nextPart.get(a)}),n},HD=e=>e.isThemeGetter,WD=(e,t)=>t?e.map(([n,a])=>{const i=a.map(r=>typeof r=="string"?t+r:typeof r=="object"?Object.fromEntries(Object.entries(r).map(([s,l])=>[t+s,l])):r);return[n,i]}):e,qD=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,a=new Map;const i=(r,s)=>{n.set(r,s),t++,t>e&&(t=0,a=n,n=new Map)};return{get(r){let s=n.get(r);if(s!==void 0)return s;if((s=a.get(r))!==void 0)return i(r,s),s},set(r,s){n.has(r)?n.set(r,s):i(r,s)}}},N2="!",GD=e=>{const{separator:t,experimentalParseClassName:n}=e,a=t.length===1,i=t[0],r=t.length,s=l=>{const u=[];let c=0,h=0,d;for(let x=0;x<l.length;x++){let w=l[x];if(c===0){if(w===i&&(a||l.slice(x,x+r)===t)){u.push(l.slice(h,x)),h=x+r;continue}if(w==="/"){d=x;continue}}w==="["?c++:w==="]"&&c--}const m=u.length===0?l:l.substring(h),f=m.startsWith(N2),y=f?m.substring(1):m,g=d&&d>h?d-h:void 0;return{modifiers:u,hasImportantModifier:f,baseClassName:y,maybePostfixModifierPosition:g}};return n?l=>n({className:l,parseClassName:s}):s},YD=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(a=>{a[0]==="["?(t.push(...n.sort(),a),n=[]):n.push(a)}),t.push(...n.sort()),t},JD=e=>({cache:qD(e.cacheSize),parseClassName:GD(e),...$D(e)}),QD=/\s+/,XD=(e,t)=>{const{parseClassName:n,getClassGroupId:a,getConflictingClassGroupIds:i}=t,r=[],s=e.trim().split(QD);let l="";for(let u=s.length-1;u>=0;u-=1){const c=s[u],{modifiers:h,hasImportantModifier:d,baseClassName:m,maybePostfixModifierPosition:f}=n(c);let y=!!f,g=a(y?m.substring(0,f):m);if(!g){if(!y){l=c+(l.length>0?" "+l:l);continue}if(g=a(m),!g){l=c+(l.length>0?" "+l:l);continue}y=!1}const x=YD(h).join(":"),w=d?x+N2:x,v=w+g;if(r.includes(v))continue;r.push(v);const k=i(g,y);for(let j=0;j<k.length;++j){const S=k[j];r.push(w+S)}l=c+(l.length>0?" "+l:l)}return l};function ZD(){let e=0,t,n,a="";for(;e<arguments.length;)(t=arguments[e++])&&(n=C2(t))&&(a&&(a+=" "),a+=n);return a}const C2=e=>{if(typeof e=="string")return e;let t,n="";for(let a=0;a<e.length;a++)e[a]&&(t=C2(e[a]))&&(n&&(n+=" "),n+=t);return n};function ez(e,...t){let n,a,i,r=s;function s(u){const c=t.reduce((h,d)=>d(h),e());return n=JD(c),a=n.cache.get,i=n.cache.set,r=l,l(u)}function l(u){const c=a(u);if(c)return c;const h=XD(u,n);return i(u,h),h}return function(){return r(ZD.apply(null,arguments))}}const ot=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},T2=/^\[(?:([a-z-]+):)?(.+)\]$/i,tz=/^\d+\/\d+$/,nz=new Set(["px","full","screen"]),az=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,iz=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,rz=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,sz=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,oz=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,mi=e=>Eo(e)||nz.has(e)||tz.test(e),Bi=e=>wl(e,"length",pz),Eo=e=>!!e&&!Number.isNaN(Number(e)),xp=e=>wl(e,"number",Eo),Vl=e=>!!e&&Number.isInteger(Number(e)),lz=e=>e.endsWith("%")&&Eo(e.slice(0,-1)),Ie=e=>T2.test(e),Ki=e=>az.test(e),uz=new Set(["length","size","percentage"]),cz=e=>wl(e,uz,E2),dz=e=>wl(e,"position",E2),hz=new Set(["image","url"]),mz=e=>wl(e,hz,yz),fz=e=>wl(e,"",gz),Hl=()=>!0,wl=(e,t,n)=>{const a=T2.exec(e);return a?a[1]?typeof t=="string"?a[1]===t:t.has(a[1]):n(a[2]):!1},pz=e=>iz.test(e)&&!rz.test(e),E2=()=>!1,gz=e=>sz.test(e),yz=e=>oz.test(e),wz=()=>{const e=ot("colors"),t=ot("spacing"),n=ot("blur"),a=ot("brightness"),i=ot("borderColor"),r=ot("borderRadius"),s=ot("borderSpacing"),l=ot("borderWidth"),u=ot("contrast"),c=ot("grayscale"),h=ot("hueRotate"),d=ot("invert"),m=ot("gap"),f=ot("gradientColorStops"),y=ot("gradientColorStopPositions"),g=ot("inset"),x=ot("margin"),w=ot("opacity"),v=ot("padding"),k=ot("saturate"),j=ot("scale"),S=ot("sepia"),_=ot("skew"),T=ot("space"),E=ot("translate"),O=()=>["auto","contain","none"],A=()=>["auto","hidden","clip","visible","scroll"],R=()=>["auto",Ie,t],F=()=>[Ie,t],Y=()=>["",mi,Bi],V=()=>["auto",Eo,Ie],z=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],W=()=>["solid","dashed","dotted","double","none"],B=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],M=()=>["start","end","center","between","around","evenly","stretch"],I=()=>["","0",Ie],b=()=>["auto","avoid","all","avoid-page","page","left","right","column"],C=()=>[Eo,Ie];return{cacheSize:500,separator:":",theme:{colors:[Hl],spacing:[mi,Bi],blur:["none","",Ki,Ie],brightness:C(),borderColor:[e],borderRadius:["n
515one","","full",Ki,Ie],borderSpacing:F(),borderWidth:Y(),contrast:C(),grayscale:I(),hueRotate:C(),invert:I(),gap:F(),gradientColorStops:[e],gradientColorStopPositions:[lz,Bi],inset:R(),margin:R(),opacity:C(),padding:F(),saturate:C(),scale:C(),sepia:I(),skew:C(),space:F(),translate:F()},classGroups:{aspect:[{aspect:["auto","square","video",Ie]}],container:["container"],columns:[{columns:[Ki]}],"break-after":[{"break-after":b()}],"break-before":[{"break-before":b()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...z(),Ie]}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:O()}],"overscroll-x":[{"overscroll-x":O()}],"overscroll-y":[{"overscroll-y":O()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Vl,Ie]}],basis:[{basis:R()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Ie]}],grow:[{grow:I()}],shrink:[{shrink:I()}],order:[{order:["first","last","none",Vl,Ie]}],"grid-cols":[{"grid-cols":[Hl]}],"col-start-end":[{col:["auto",{span:["full",Vl,Ie]},Ie]}],"col-start":[{"col-start":V()}],"col-end":[{"col-end":V()}],"grid-rows":[{"grid-rows":[Hl]}],"row-start-end":[{row:["auto",{span:[Vl,Ie]},Ie]}],"row-start":[{"row-start":V()}],"row-end":[{"row-end":V()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Ie]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Ie]}],gap:[{gap:[m]}],"gap-x":[{"gap-x":[m]}],"gap-y":[{"gap-y":[m]}],"justify-content":[{justify:["normal",...M()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...M(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...M(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[v]}],px:[{px:[v]}],py:[{py:[v]}],ps:[{ps:[v]}],pe:[{pe:[v]}],pt:[{pt:[v]}],pr:[{pr:[v]}],pb:[{pb:[v]}],pl:[{pl:[v]}],m:[{m:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],me:[{me:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[T]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[T]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Ie,t]}],"min-w":[{"min-w":[Ie,t,"min","max","fit"]}],"max-w":[{"max-w":[Ie,t,"none","full","min","max","fit","prose",{screen:[Ki]},Ki]}],h:[{h:[Ie,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Ie,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Ie,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Ie,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Ki,Bi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",xp]}],"font-family":[{font:[Hl]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Ie]}],"line-clamp":[{"line-clamp":["none",Eo,xp]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",mi,Ie]}],"list-image":[{"list-image":["none",Ie]}],"list-style-type":[{list:["none","disc","decimal",Ie]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[w]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[w]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...W(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",mi,Bi]}],"underline-offset":[{"underline-offset":["auto",mi,Ie]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:F()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ie]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ie]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[w]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...z(),dz]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",cz]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},mz]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[y]}
vendor: 5,180 bytes, line 515
515],"gradient-via-pos":[{via:[y]}],"gradient-to-pos":[{to:[y]}],"gradient-from":[{from:[f]}],"gradient-via":[{via:[f]}],"gradient-to":[{to:[f]}],rounded:[{rounded:[r]}],"rounded-s":[{"rounded-s":[r]}],"rounded-e":[{"rounded-e":[r]}],"rounded-t":[{"rounded-t":[r]}],"rounded-r":[{"rounded-r":[r]}],"rounded-b":[{"rounded-b":[r]}],"rounded-l":[{"rounded-l":[r]}],"rounded-ss":[{"rounded-ss":[r]}],"rounded-se":[{"rounded-se":[r]}],"rounded-ee":[{"rounded-ee":[r]}],"rounded-es":[{"rounded-es":[r]}],"rounded-tl":[{"rounded-tl":[r]}],"rounded-tr":[{"rounded-tr":[r]}],"rounded-br":[{"rounded-br":[r]}],"rounded-bl":[{"rounded-bl":[r]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[w]}],"border-style":[{border:[...W(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[w]}],"divide-style":[{divide:W()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...W()]}],"outline-offset":[{"outline-offset":[mi,Ie]}],"outline-w":[{outline:[mi,Bi]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Y()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[w]}],"ring-offset-w":[{"ring-offset":[mi,Bi]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Ki,fz]}],"shadow-color":[{shadow:[Hl]}],opacity:[{opacity:[w]}],"mix-blend":[{"mix-blend":[...B(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":B()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[a]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",Ki,Ie]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[h]}],invert:[{invert:[d]}],saturate:[{saturate:[k]}],sepia:[{sepia:[S]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[a]}],"backdrop-contrast":[{"backdrop-contrast":[u]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[h]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[w]}],"backdrop-saturate":[{"backdrop-saturate":[k]}],"backdrop-sepia":[{"backdrop-sepia":[S]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Ie]}],duration:[{duration:C()}],ease:[{ease:["linear","in","out","in-out",Ie]}],delay:[{delay:C()}],animate:[{animate:["none","spin","ping","pulse","bounce",Ie]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[j]}],"scale-x":[{"scale-x":[j]}],"scale-y":[{"scale-y":[j]}],rotate:[{rotate:[Vl,Ie]}],"translate-x":[{"translate-x":[E]}],"translate-y":[{"translate-y":[E]}],"skew-x":[{"skew-x":[_]}],"skew-y":[{"skew-y":[_]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Ie]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ie]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":F()}],"scroll-mx":[{"scroll-mx":F()}],"scroll-my":[{"scroll-my":F()}],"scroll-ms":[{"scroll-ms":F()}],"scroll-me":[{"scroll-me":F()}],"scroll-mt":[{"scroll-mt":F()}],"scroll-mr":[{"scroll-mr":F()}],"scroll-mb":[{"scroll-mb":F()}],"scroll-ml":[{"scroll-ml":F()}],"scroll-p":[{"scroll-p":F()}],"scroll-px":[{"scroll-px":F()}],"scroll-py":[{"scroll-py":F()}],"scroll-ps":[{"scroll-ps":F()}],"scroll-pe":[{"scroll-pe":F()}],"scroll-pt":[{"scroll-pt":F()}],"scroll-pr":[{"scroll-pr":F()}],"scroll-pb":[{"scroll-pb":F()}],"scroll-pl":[{"scroll-pl":F()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}
vendor: 4,647 bytes, line 515
515],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ie]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[mi,Bi,xp]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},xz=ez(wz);function ce(...e){return xz(c2(e))}const kz=nD,A2=p.forwardRef(({className:e,...t},n)=>o.jsx(a2,{ref:n,className:ce("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));A2.displayName=a2.displayName;const vz=Qm("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),P2=p.forwardRef(({className:e,variant:t,...n},a)=>o.jsx(i2,{ref:a,className:ce(vz({variant:t}),e),...n}));P2.displayName=i2.displayName;const bz=p.forwardRef(({className:e,...t},n)=>o.jsx(o2,{ref:n,className:ce("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors group-[.destructive]:border-muted/40 hover:bg-secondary group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 group-[.destructive]:focus:ring-destructive disabled:pointer-events-none disabled:opacity-50",e),...t}));bz.displayName=o2.displayName;const M2=p.forwardRef(({className:e,...t},n)=>o.jsx(l2,{ref:n,className:ce("absolute right-2 top-2 rounded-md p-1 text-foreground
515/50 opacity-0 transition-opacity group-hover:opacity-100 group-[.destructive]:text-red-300 hover:text-foreground group-[.destructive]:hover:text-red-50 focus:opacity-100 focus:outline-none focus:ring-2 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:o.jsx(Rc,{className:"h-4 w-4"})}));M2.displayName=l2.displayName;const R2=p.forwardRef(({className:e,...t},n)=>o.jsx(r2,{ref:n,className:ce("text-sm font-semibold",e),...t}));R2.displayName=r2.displayName;const I2=p.forwardRef(({className:e,...t},n)=>o.jsx(s2,{ref:n,className:ce("text-sm opacity-90",e),...t}));I2.displayName=s2.displayName;function jz(){const{toasts:e}=Zn();return o.jsxs(kz,{children:[e.map(function({id:t,title:n,description:a,action:i,...r}){return o.jsxs(P2,{...r,children:[o.jsxs("div",{className:"grid gap-1",children:[n&&o.jsx(R2,{children:n}),a&&o.jsx(I2,{children:a})]}),i,o.jsx(M2,{})]},t)}),o.jsx(A2,{})]})}var T0=["light","dark"],_z="(prefers-color-scheme: dark)",Sz=p.createContext(void 0),Nz={setTheme:e=>{},themes:[]},Cz=()=>{var e;return(e=p.useContext(Sz))!=null?e:Nz};p.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:a,enableColorScheme:i,defaultTheme:r,value:s,attrs:l,nonce:u})=>{let c=r==="system",h=n==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${l.map(y=>`'${y}'`).join(",")})`};`:`var d=document.documentElement,n='${n}',s='setAttribute';`,d=i?T0.includes(r)&&r?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${r}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",m=(y,g=!1,x=!0)=>{let w=s?s[y]:y,v=g?y+"|| ''":`'${w}'`,k="";return i&&x&&!g&&T0.includes(y)&&(k+=`d.style.colorScheme = '${y}';`),n==="class"?g||w?k+=`c.add(${v})`:k+="null":w&&(k+=`d[s](n,${v})`),k},f=e?`!function(){${h}${m(e)}}()`:a?`!function(){try{${h}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${c})){var t='${_z}',m=window.matchMedia(t);if(m.media!==t||m.matches){${m("dark")}}else{${m("light")}}}else if(e){${s?`var x=${JSON.stringify(s)};`:""}${m(s?"x[e]":"e",!0)}}${c?"":"else{"+m(r,!1,!1)+"}"}${d}}catch(e){}}()`:`!function(){try{${h}var e=localStorage.getItem('${t}');if(e){${s?`var x=${JSON.stringify(s)};`:""}${m(s?"x[e]":"e",!0)}}else{${m(r,!1,!1)};}${d}}catch(t){}}();`;return p.createElement("script",{nonce:u,dangerouslySetInnerHTML:{__html:f}})});var Tz=e=>{switch(e){case"success":return Pz;case"info":return Rz;case"warning":return Mz;case"error":return Iz;default:return null}},Ez=Array(12).fill(0),Az=({visible:e,className:t})=>ne.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},ne.createElement("div",{className:"sonner-spinner"},Ez.map((n,a)=>ne.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${a}`})))),Pz=ne.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ne.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),Mz=ne.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},ne.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),Rz=ne.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ne.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),Iz=ne.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ne.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),Oz=ne.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},ne.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ne.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),Lz=()=>{let[e,t]=ne.useState(document.hidden);return ne.useEffect(()=>{let n=()=>{t(document.hidden)};
515return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},wy=1,Dz=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:n,...a}=e,i=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:wy++,r=this.toasts.find(l=>l.id===i),s=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(i)&&this.dismissedToasts.delete(i),r?this.toasts=this.toasts.map(l=>l.id===i?(this.publish({...l,...e,id:i,title:n}),{...l,...e,id:i,dismissible:s,title:n}):l):this.addToast({title:n,...a,dismissible:s,id:i}),i},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>
515this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let a=e instanceof Promise?e:e(),i=n!==void 0,r,s=a.then(async u=>{if(r=["resolve",u],ne.isValidElement(u))i=!1,this.create({id:n,type:"default",message:u});else if(Fz(u)&&!u.ok){i=!1;let c=typeof t.error=="function"?await t.error(`HTTP error! status: ${u.status}`):t.error,h=typeof t.description=="function"?await t.description(`HTTP error! status: ${u.status}`):t.description;this.create({id:n,type:"error",message:c,description:h})}else if(t.success!==void 0){i=!1;let c=typeof t.success=="function"?await t.success(u):t.success,h=typeof t.description=="function"?await t.description(u):t.description;this.create({id:n,type:"success",message:c,description:h})}}).catch(async u=>{if(r=["reject",u],t.error!==void 0){i=!1;let c=typeof t.error=="function"?await t.error(u):t.error,h=typeof t.description=="function"?await t.description(u):t.description;this.create({id:n,type:"error",message:c,description:h})}}).finally(()=>{var u;i&&(this.dismiss(n),n=void 0),(u=t.finally)==null||u.call(t)}),l=()=>new Promise((u,c)=>s.then(()=>r[0]==="reject"?c(r[1]):u(r[1])).catch(c));return typeof n!="string"&&typeof n!="number"?{unwrap:l}:Object.assign(n,{unwrap:l})},this.custom=(e,t)=>{let n=(t==null?void 0:t.id)||wy++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},bn=new Dz,zz=(e,t)=>{let n=(t==null?void 0:t.id)||wy++;return bn.addToast({title:e,...t,id:n}),n},Fz=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Bz=zz,Kz=()=>bn.toasts,$z=()=>bn.getActiveToasts(),nn=Object.assign(Bz,{success:bn.success,info:bn.info,warning:bn.warning,error:bn.error,custom:bn.custom,message:bn.message,promise:bn.promise,dismiss:bn.dismiss,loading:bn.loading},{getHistory:Kz,getToasts:$z});function Uz(e,{insertAt:t}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css",t==="top"&&n.firstChild?n.insertBefore(a,n.firstChild):n.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e))}Uz(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;
515left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}
515:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);
515--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)} 516`);function kd(e){return e.label!==void 0}var Vz=3,Hz="32px",Wz="16px",E0=4e3,qz=356,Gz=14,Yz=20,Jz=200;function xa(...e){return e.filter(Boolean).join(" ")}function Qz(e){let[t,n]=e.split("-"),a=[];return t&&a.push(t),n&&a.push(n),a}var Xz=e=>{var t,n,a,i,r,s,l,u,c,h,d;let{invert:m,toast:f,unstyled:y,interacting:g,setHeights:x,visibleToasts:w,heights:v,index:k,toasts:j,expanded:S,removeToast:_,defaultRichColors:T,closeButton:E,style:O,cancelButtonStyle:A,actionButtonStyle:R,className:F="",descriptionClassName:Y="",duration:V,position:z,gap:W,loadingIcon:B,expandByDefault:M,classNames:I,icons:b,closeButtonAriaLabel:C="Close toast",pauseWhenPageIsHidden:D}=e,[N,J]=ne.useState(null),[re,ee]=ne.useState(null),[G,ie]=ne.useState(!1),[q,ae]=ne.useState(!1),[de,me]=ne.useState(!1),[Ce,ke]=ne.useState(!1),[Ve,We]=ne.useState(!1),[Ge,ht]=ne.useState(0),[mt,st]=ne.useState(0),$=ne.useRef(f.duration||V||E0),he=ne.useRef(null),xe=ne.useRef(null),Me=k===0,be=k+1<=w,U=f.type,P=f.dismissible!==!1,L=f.className||"",H=f.descriptionClassName||"",Z=ne.useMemo(()=>v.findIndex(Ee=>Ee.toastId===f.id)||0,[v,f.id]),Ae=ne.useMemo(()=>{var Ee;return(Ee=f.closeButton)!=null?Ee:E},[f.closeButton,E]),je=ne.useMemo(()=>f.duration||V||E0,[f.duration,V]),Qe=ne.useRef(0),Ke=ne.useRef(0),Nt=ne.useRef(0),Xe=ne.useRef(null),[wn,Ct]=z.split("-"),hi=ne.useMemo(()=>v.reduce((Ee,He,tt)=>tt>=Z?Ee:Ee+He.height,0),[v,Z]),Br=Lz(),Bs=f.invert||m,pa=U==="loading";Ke.current=ne.useMemo(()=>Z*W+hi,[Z,hi]),ne.useEffect(()=>{$.current=je},[je]),ne.useEffect(()=>{ie(!0)},[]),ne.useEffect(()=>{let Ee=xe.current;if(Ee){let He=Ee.getBoundingClientRect().height;return st(He),x(tt=>[{toastId:f.id,height:He,position:f.position},...tt]),()=>x(tt=>tt.filter(In=>In.toastId!==f.id))}},[x,f.id]),ne.useLayoutEffect(()=>{if(!G)return;let Ee=xe.current,He=Ee.style.height;Ee.style.height="auto";let tt=Ee.getBoundingClientRect().height;Ee.style.height=He,st(tt),x(In=>In.find(ga=>ga.toastId===f.id)?In.map(ga=>ga.toastId===f.id?{...ga,height:tt}:ga):[{toastId:f.id,height:tt,position:f.position},...In])},[G,f.title,f.description,x,f.id]);let Jt=ne.useCallback(()=>{ae(!0),ht(Ke.current),x(Ee=>Ee.filter(He=>He.toastId!==f.id)),setTimeout(()=>{_(f)},Jz)},[f,_,x,Ke]);ne.useEffect(()=>{if(f.promise&&U==="loading"||f.duration===1/0||f.type==="loading")return;let Ee;return S||g||D&&Br?(()=>{if(Nt.current<Qe.current){let He=new Date().getTime()-Qe.current;$.current=$.current-He}
516Nt.current=new Date().getTime()})():$.current!==1/0&&(Qe.current=new Date().getTime(),Ee=setTimeout(()=>{var He;(He=f.onAutoClose)==null||He.call(f,f),Jt()},$.current)),()=>clearTimeout(Ee)},[S,g,f,U,D,Br,Jt]),ne.useEffect(()=>{f.delete&&Jt()},[Jt,f.delete]);function $f(){var Ee,He,tt;return b!=null&&b.loading?ne.createElement("div",{className:xa(I==null?void 0:I.loader,(Ee=f==null?void 0:f.classNames)==null?void 0:Ee.loader,"sonner-loader"),"data-visible":U==="loading"},b.loading):B?ne.createElement("div",{className:xa(I==null?void 0:I.loader,(He=f==null?void 0:f.classNames)==null?void 0:He.loader,"sonner-loader"),"data-visible":U==="loading"},B):ne.createElement(Az,{className:xa(I==null?void 0:I.loader,(tt=f==null?void 0:f.classNames)==null?void 0:tt.loader),visible:U==="loading"})}return ne.createElement("li",{tabIndex:0,ref:xe,className:xa(F,L,I==null?void 0:I.toast,(t=f==null?void 0:f.classNames)==null?void 0:t.toast,I==null?void 0:I.default,I==null?void 0:I[U],(n=f==null?void 0:f.classNames)==null?void 0:n[U]),"data-sonner-toast":"","data-rich-colors":(a=f.richColors)!=null?a:T,"data-styled":!(f.jsx||f.unstyled||y),"data-mounted":G,"data-promise":!!f.promise,"data-swiped":Ve,"data-removed":q,"data-visible":be,"data-y-position":wn,"data-x-position":Ct,"data-index":k,"data-front":Me,"data-swiping":de,"data-dismissible":P,"data-type":U,"data-invert":Bs,"data-swipe-out":Ce,"data-swipe-direction":re,"data-expanded":!!(S||M&&G),style:{"--index":k,"--toasts-before":k,"--z-index":j.length-k,"--offset":`${q?Ge:Ke.current}px`,"--initial-height":M?"auto":`${mt}px`,...O,...f.style},onDragEnd:()=>{me(!1),J(null),Xe.current=null},onPointerDown:Ee=>{pa||!P||(he.current=new Date,ht(Ke.current),Ee.target.setPointerCapture(Ee.pointerId),Ee.target.tagName!=="BUTTON"&&(me(!0),Xe.current={x:Ee.clientX,y:Ee.clientY}))},onPointerUp:()=>{var Ee,He,tt,In;if(Ce||!P)return;Xe.current=null;let ga=Number(((Ee=xe.current)==null?void 0:Ee.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Di=Number(((He=xe.current)==null?void 0:He.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Kr=new Date().getTime()-((tt=he.current)==null?void 0:tt.getTime()),ya=N==="x"?ga:Di,zi=Math.abs(ya)/Kr;if(Math.abs(ya)>=Yz||zi>.11){ht(Ke.current),(In=f.onDismiss)==null||In.call(f,f),ee(N==="x"?ga>0?"right":"left":Di>0?"down":"up"),Jt(),ke(!0),We(!1);return}me(!1),J(null)},onPointerMove:Ee=>{var He,tt,In,ga;if(!Xe.current||!P||((He=window.getSelection())==null?void 0:He.toString().length)>0)return;let Di=Ee.clientY-Xe.current.y,Kr=Ee.clientX-Xe.current.x,ya=(tt=e.swipeDirections)!=null?tt:Qz(z);!N&&(Math.abs(Kr)>1||Math.abs(Di)>1)&&J(Math.abs(Kr)>Math.abs(Di)?"x":"y");let zi={x:0,y:0};N==="y"?(ya.includes("top")||ya.includes("bottom"))&&(ya.includes("top")&&Di<0||ya.includes("bottom")&&Di>0)&&(zi.y=Di):N==="x"&&(ya.includes("left")||ya.includes("right"))&&(ya.includes("left")&&Kr<0||ya.includes("right")&&Kr>0)&&(zi.x=Kr),(Math.abs(zi.x)>0||Math.abs(zi.y)>0)&&We(!0),(In=xe.current)==null||In.style.setProperty("--swipe-amount-x",`${zi.x}px`),(ga=xe.current)==null||ga.style.setProperty("--swipe-amount-y",`${zi.y}px`)}},Ae&&!f.jsx?ne.createElement("button",{"aria-label":C,"data-disabled":pa,"data-close-button":!0,onClick:pa||!P?()=>{}:()=>{var Ee;Jt(),(Ee=f.onDismiss)==null||Ee.call(f,f)},className:xa(I==null?void 0:I.closeButton,(i=f==null?void 0:f.classNames)==null?void 0:i.closeButton)},(r=b==null?void 0:b.close)!=null?r:Oz):null,f.jsx||p.isValidElement(f.title)?f.jsx?f.jsx:typeof f.title=="function"?f.title():f.title:ne.createElement(ne.Fragment,null,U||f.icon||f.promise?ne.createElement("div",{"data-icon":"",className:xa(I==null?void 0:I.icon,(s=f==null?void 0:f.classNames)==null?void 0:s.icon)},f.promise||f.type==="loading"&&!f.icon?f.icon||$f():null,f.type!=="loading"?f.icon||(b==null?void 0:b[U])||Tz(U):null):null,ne.createElement("div",{"data-content":"",className:xa(I==null?void 0:I.content,(l=f==null?void 0:f.classNames)==null?void 0:l.content)},ne.createElement("div",{"data-title":"",className:xa(I==null?void 0:I.title,(u=f==null?void 0:f.classNames)==null?void 0:u.title)},typeof f.title=="function"?f.title():f.title),f.description?ne.createElement("div",{"data-description":"",className:xa(Y,H,I==null?void 0:I.description,(c=f==null?void 0:f.classNames)==null?void 0:c.description)},typeof f.description=="function"?f.description():f.description):null),p.isValidElement(f.cancel)?f.cancel:f.cancel&&kd(f.cancel)?ne.createElement("button",{"data-button":!0,"data-cancel":!0,style:f.cancelButtonStyle||A,onClick:Ee=>{var He,tt;kd(f.cancel)&&P&&((tt=(He=f.cancel).onClick)==null||tt.call(He,Ee),Jt())},className:xa(I==null?void 0:I.cancelButton,(h=f==null?void 0:f.classNames)==null?void 0:h.cancelButton)},f.cancel.label):null,p.isValidElement(f.action)?f.action:f.action&&kd(f.action)?ne.createElement("button",{"data-button":!0,"data-action":!0,style:f.actionButtonStyle||R,onClick:Ee=>{var He,tt;kd(f.action)&&((tt=(He=f.action).onClick)==null||tt.call(He,Ee),!Ee.defaultPrevented&&Jt())},className:xa(I==null?void 0:I.actionButton,(d=f==null?void 0:f.classNames)==null?void 0:d.actionButton)},f.action.label):null))};
vendor: 5,404 bytes, line 516
516function A0(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function Zz(e,t){let n={};return[e,t].forEach((a,i)=>{let r=i===1,s=r?"--mobile-offset":"--offset",l=r?Wz:Hz;function u(c){["top","right","bottom","left"].forEach(h=>{n[`${s}-${h}`]=typeof c=="number"?`${c}px`:c})}typeof a=="number"||typeof a=="string"?u(a):typeof a=="object"?["top","right","bottom","left"].forEach(c=>{a[c]===void 0?n[`${s}-${c}`]=l:n[`${s}-${c}`]=typeof a[c]=="number"?`${a[c]}px`:a[c]}):u(l)}),n}var e4=p.forwardRef(function(e,t){let{invert:n,position:a="bottom-right",hotkey:i=["altKey","KeyT"],expand:r,closeButton:s,className:l,offset:u,mobileOffset:c,theme:h="light",richColors:d,duration:m,style:f,visibleToasts:y=Vz,toastOptions:g,dir:x=A0(),gap:w=Gz,loadingIcon:v,icons:k,containerAriaLabel:j="Notifications",pauseWhenPageIsHidden:S}=e,[_,T]=ne.useState([]),E=ne.useMemo(()=>Array.from(new Set([a].concat(_.filter(D=>D.position).map(D=>D.position)))),[_,a]),[O,A]=ne.useState([]),[R,F]=ne.useState(!1),[Y,V]=ne.useState(!1),[z,W]=ne.useState(h!=="system"?h:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),B=ne.useRef(null),M=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),I=ne.useRef(null),b=ne.useRef(!1),C=ne.useCallback(D=>{T(N=>{var J;return(J=N.find(re=>re.id===D.id))!=null&&J.delete||bn.dismiss(D.id),N.filter(({id:re})=>re!==D.id)})},[]);return ne.useEffect(()=>bn.subscribe(D=>{if(D.dismiss){T(N=>N.map(J=>J.id===D.id?{...J,delete:!0}:J));return}setTimeout(()=>{LC.flushSync(()=>{T(N=>{let J=N.findIndex(re=>re.id===D.id);return J!==-1?[...N.slice(0,J),{...N[J],...D},...N.slice(J+1)]:[D,...N]})})})}),[]),ne.useEffect(()=>{if(h!=="system"){W(h);return}if(h==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?W("dark"):W("light")),typeof window>"u")return;let D=window.matchMedia("(prefers-color-scheme: dark)");try{D.addEventListener("change",({matches:N})=>{W(N?"dark":"light")})}catch{D.addListener(({matches:J})=>{try{W(J?"dark":"light")}catch(re){console.error(re)}})}},[h]),ne.useEffect(()=>{_.length<=1&&F(!1)},[_]),ne.useEffect(()=>{let D=N=>{var J,re;i.every(ee=>N[ee]||N.code===ee)&&(F(!0),(J=B.current)==null||J.focus()),N.code==="Escape"&&(document.activeElement===B.current||(re=B.current)!=null&&re.contains(document.activeElement))&&F(!1)};return document.addEventListener("keydown",D),()=>document.removeEventListener("keydown",D)},[i]),ne.useEffect(()=>{if(B.current)return()=>{I.current&&(I.current.focus({preventScroll:!0}),I.current=null,b.current=!1)}},[B.current]),ne.createElement("section",{ref:t,"aria-label":`${j} ${M}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},E.map((D,N)=>{var J;let[re,ee]=D.split("-");return _.length?ne.createElement("ol",{key:D,dir:x==="auto"?A0():x,tabIndex:-1,ref:B,className:l,"data-sonner-toaster":!0,"data-theme":z,"data-y-position":re,"data-lifted":R&&_.length>1&&!r,"data-x-position":ee,style:{"--front-toast-height":`${((J=O[0])==null?void 0:J.height)||0}px`,"--width":`${qz}px`,"--gap":`${w}px`,...f,...Zz(u,c)},onBlur:G=>{b.current&&!G.currentTarget.contains(G.relatedTarget)&&(b.current=!1,I.current&&(I.current.focus({preventScroll:!0}),I.current=null))},onFocus:G=>{G.target instanceof HTMLElement&&G.target.dataset.dismissible==="false"||b.current||(b.current=!0,I.current=G.relatedTarget)},onMouseEnter:()=>F(!0),onMouseMove:()=>F(!0),onMouseLeave:()=>{Y||F(!1)},onDragEnd:()=>F(!1),onPointerDown:G=>{G.target instanceof HTMLElement&&G.target.dataset.dismissible==="false"||V(!0)},onPointerUp:()=>V(!1)},_.filter(G=>!G.position&&N===0||G.position===D).map((G,ie)=>{var q,ae;return ne.createElement(Xz,{key:G.id,icons:k,index:ie,toast:G,defaultRichColors:d,duration:(q=g==null?void 0:g.duration)!=null?q:m,className:g==null?void 0:g.className,descriptionClassName:g==null?void 0:g.descriptionClassName,invert:n,visibleToasts:y,closeButton:(ae=g==null?void 0:g.closeButton)!=null?ae:s,interacting:Y,position:D,style:g==null?void 0:g.style,unstyled:g==null?void 0:g.unstyled,classNames:g==null?void 0:g.classNames,cancelButtonStyle:g==null?void 0:g.cancelButtonStyle,actionButtonStyle:g==null?void 0:g.actionButtonStyle,removeToast:C,toasts:_.filter(de=>de.position==G.position),heights:O.filter(de=>de.position==G.position),setHeights:A,expandByDefault:r,gap:w,loadingIcon:v,expanded:R,pauseWhenPageIsHidden:S,swipeDirections:e.swipeDirections})})):null}))});const t4=({...e})=>{const{theme:t="system"}=Cz();return o.jsx(e4,{theme:t,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...e})};var n4=tx[" useId ".trim().toString()]||(()=>{}),a4=0;function la(e){const[t,n]=p.useState(n4());return St(()=>{e||n(a=>a??String(a4++))},[e]),e||(t?`radix-${t}`:"")}const i4=["top","right","bottom","left"],Cr=Math.min,zn=Math.max,Qh=Math.round,vd=Math.floor,ri=e=>({x:e,y:e}
vendor: 11,289 bytes, line 516
516),r4={left:"right",right:"left",bottom:"top",top:"bottom"},s4={start:"end",end:"start"};function xy(e,t,n){return zn(e,Cr(t,n))}function Pi(e,t){return typeof e=="function"?e(t):e}function Mi(e){return e.split("-")[0]}function xl(e){return e.split("-")[1]}function nk(e){return e==="x"?"y":"x"}function ak(e){return e==="y"?"height":"width"}const o4=new Set(["top","bottom"]);function ni(e){return o4.has(Mi(e))?"y":"x"}function ik(e){return nk(ni(e))}function l4(e,t,n){n===void 0&&(n=!1);const a=xl(e),i=ik(e),r=ak(i);let s=i==="x"?a===(n?"end":"start")?"right":"left":a==="start"?"bottom":"top";return t.reference[r]>t.floating[r]&&(s=Xh(s)),[s,Xh(s)]}function u4(e){const t=Xh(e);return[ky(e),t,ky(t)]}function ky(e){return e.replace(/start|end/g,t=>s4[t])}const P0=["left","right"],M0=["right","left"],c4=["top","bottom"],d4=["bottom","top"];function h4(e,t,n){switch(e){case"top":case"bottom":return n?t?M0:P0:t?P0:M0;case"left":case"right":return t?c4:d4;default:return[]}}function m4(e,t,n,a){const i=xl(e);let r=h4(Mi(e),n==="start",a);return i&&(r=r.map(s=>s+"-"+i),t&&(r=r.concat(r.map(ky)))),r}function Xh(e){return e.replace(/left|right|bottom|top/g,t=>r4[t])}function f4(e){return{top:0,right:0,bottom:0,left:0,...e}}function O2(e){return typeof e!="number"?f4(e):{top:e,right:e,bottom:e,left:e}}function Zh(e){const{x:t,y:n,width:a,height:i}=e;return{width:a,height:i,top:n,left:t,right:t+a,bottom:n+i,x:t,y:n}}function R0(e,t,n){let{reference:a,floating:i}=e;const r=ni(t),s=ik(t),l=ak(s),u=Mi(t),c=r==="y",h=a.x+a.width/2-i.width/2,d=a.y+a.height/2-i.height/2,m=a[l]/2-i[l]/2;let f;switch(u){case"top":f={x:h,y:a.y-i.height};break;case"bottom":f={x:h,y:a.y+a.height};break;case"right":f={x:a.x+a.width,y:d};break;case"left":f={x:a.x-i.width,y:d};break;default:f={x:a.x,y:a.y}}switch(xl(t)){case"start":f[s]-=m*(n&&c?-1:1);break;case"end":f[s]+=m*(n&&c?-1:1);break}return f}const p4=async(e,t,n)=>{const{placement:a="bottom",strategy:i="absolute",middleware:r=[],platform:s}=n,l=r.filter(Boolean),u=await(s.isRTL==null?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:i}),{x:h,y:d}=R0(c,a,u),m=a,f={},y=0;for(let g=0;g<l.length;g++){const{name:x,fn:w}=l[g],{x:v,y:k,data:j,reset:S}=await w({x:h,y:d,initialPlacement:a,placement:m,strategy:i,middlewareData:f,rects:c,platform:s,elements:{reference:e,floating:t}});h=v??h,d=k??d,f={...f,[x]:{...f[x],...j}},S&&y<=50&&(y++,typeof S=="object"&&(S.placement&&(m=S.placement),S.rects&&(c=S.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:i}):S.rects),{x:h,y:d}=R0(c,m,u)),g=-1)}return{x:h,y:d,placement:m,strategy:i,middlewareData:f}};async function Xu(e,t){var n;t===void 0&&(t={});const{x:a,y:i,platform:r,rects:s,elements:l,strategy:u}=e,{boundary:c="clippingAncestors",rootBoundary:h="viewport",elementContext:d="floating",altBoundary:m=!1,padding:f=0}=Pi(t,e),y=O2(f),x=l[m?d==="floating"?"reference":"floating":d],w=Zh(await r.getClippingRect({element:(n=await(r.isElement==null?void 0:r.isElement(x)))==null||n?x:x.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(l.floating)),boundary:c,rootBoundary:h,strategy:u})),v=d==="floating"?{x:a,y:i,width:s.floating.width,height:s.floating.height}:s.reference,k=await(r.getOffsetParent==null?void 0:r.getOffsetParent(l.floating)),j=await(r.isElement==null?void 0:r.isElement(k))?await(r.getScale==null?void 0:r.getScale(k))||{x:1,y:1}:{x:1,y:1},S=Zh(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:v,offsetParent:k,strategy:u}):v);return{top:(w.top-S.top+y.top)/j.y,bottom:(S.bottom-w.bottom+y.bottom)/j.y,left:(w.left-S.left+y.left)/j.x,right:(S.right-w.right+y.right)/j.x}}const g4=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:a,placement:i,rects:r,platform:s,elements:l,middlewareData:u}=t,{element:c,padding:h=0}=Pi(e,t)||{};if(c==null)return{};const d=O2(h),m={x:n,y:a},f=ik(i),y=ak(f),g=await s.getDimensions(c),x=f==="y",w=x?"top":"left",v=x?"bottom":"right",k=x?"clientHeight":"clientWidth",j=r.reference[y]+r.reference[f]-m[f]-r.floating[y],S=m[f]-r.reference[f],_=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let T=_?_[k]:0;(!T||!await(s.isElement==null?void 0:s.isElement(_)))&&(T=l.floating[k]||r.floating[y]);const E=j/2-S/2,O=T/2-g[y]/2-1,A=Cr(d[w],O),R=Cr(d[v],O),F=A,Y=T-g[y]-R,V=T/2-g[y]/2+E,z=xy(F,V,Y),W=!u.arrow&&xl(i)!=null&&V!==z&&r.reference[y]/2-(V<F?A:R)-g[y]/2<0,B=W?V<F?V-F:V-Y:0;return{[f]:m[f]+B,data:{[f]:z,centerOffset:V-z-B,...W&&{alignmentOffset:B}},reset:W}}}),y4=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,a;const{placement:i,middlewareData:r,rects:s,initialPlacement:l,platform:u,elements:c}=t,{mainAxis:h=!0,crossAxis:d=!0,fallbackPlacements:m,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:g=!0,...x}=Pi(e,t);if((n=r.arrow)!=null&&n.alignmentOffset)return{};const w=Mi(i),v=ni(l),k=Mi(l)===l,j=await(u.isRTL==null?void 0:u.isRTL(c.floating)),S=m||(k||!g?[Xh(l)]:u4(l)),_=y!=="none";!m&&_&&S.push(...m4(l,g,y,j));const T=[l,...S],E=await Xu(t,x),O=[];let A=((a=r.flip)==null?void 0:a.overflows)||[];if(h&&O.push(E[w]),d){const V=l4(i,s,j);O.push(E[V[0]],E[V[1]])}if(A=[...A,{placement:i,overflows:O}],!O.every(V=>V<=0)){var R,F;const V=(((R=r.flip)==null?void 0:R.index)||0)+1,z=T[V];if(z&&(!(d==="alignment"?v!==ni(z):!1)||A.every(M=>M.overflows[0]>0&&ni(M.placement)===v)))return{data:{index:V,overflows:A},reset:{placement:z}};let W=(F=A.filter(B=>B.overflows[0]<=0).sort((B,M)=>B.overflows[1]-M.overflows[1])[0])==null?void 0:F.placement;if(!W)switch(f){case"bestFit":{var Y;const B=(Y=A.filter(M=>{if(_){const I=ni(M.placement);return I===v||I==="y"}return!0}).map(M=>[M.placement,M.overflows.filter(I=>I>0).reduce((I,b)=>I+b,0)]).sort((M,I)=>M[1]-I[1])[0])==null?void 0:Y[0];B&&(W=B);break}case"initialPlacement":W=l;break}if(i!==W)return{reset:{placement:W}}}return{}}}};function I0(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function O0(e){return i4.some(t=>e[t]>=0)}const w4=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:a="referenceHidden",...i}=Pi(e,t);switch(a){case"referenceHidden":{const r=await Xu(t,{...i,elementContext:"reference"}),s=I0(r,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:O0(s)}}}case"escaped":{const r=await Xu(t,{...i,altBoundary:!0}),s=I0(r,n.floating);return{data:{escapedOffsets:s,escaped:O0(s)}}}default:return{}}}}},L2=new Set(["left","top"]);async function x4(e,t){const{placement:n,platform:a,elements:i}=e,r=await(a.isRTL==null?void 0:a.isRTL(i.floating)),s=Mi(n),l=xl(n),u=ni(n)==="y",c=L2.has(s)?-1:1,h=r&&u?-1:1,d=Pi(t,e);let{mainAxis:m,crossAxis:f,alignmentAxis:y}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return l&&typeof y=="number"&&(f=l==="end"?y*-1:y),u?{x:f*h,y:m*c}:{x:m*c,y:f*h}}const k4=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,a;const{x:i,y:r,placement:s,middlewareData:l}=t,u=await x4(t,e);return s===((n=l.offset)==null?void 0:n.placement)&&(a=l.arrow)!=null&&a.alignmentOffset?{}:{x:i+u.x,y:r+u.y,data:{...u,placement:s}}}}},v4=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:a,placement:i}=t,{mainAxis:r=!0,crossAxis:s=!1,limiter:l={fn:x=>{let{x:w,y:v}=x;return{x:w,y:v}}},...u}=Pi(e,t),c={x:n,y:a},h=await Xu(t,u),d=ni(Mi(i)),m=nk(d);let f=c[m],y=c[d];if(r){const x=m==="y"?"top":"left",w=m==="y"?"bottom":"right",v=f+h[x],k=f-h[w];f=xy(v,f,k)}if(s){const x=d==="y"?"top":"left",w=d==="y"?"bottom":"right",v=y+h[x],k=y-h[w];y=xy(v,y,k)}const g=l.fn({...t,[m]:f,[d]:y});return{...g,data:{x:g.x-n,y:g.y-a,enabled:{[m]:r,[d]:s}}}}}},b4=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:a,placement:i,rects:r,middlewareData:s}=t,{offset:l=0,mainAxis:u=!0,crossAxis:c=!0}=Pi(e,t),h={x:n,y:a},d=ni(i),m=nk(d);let f=h[m],y=h[d];const g=Pi(l,t),x=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(u){const k=m==="y"?"height":"width",j=r.reference[m]-r.floating[k]+x.mainAxis,S=r.reference[m]+r.reference[k]-x.mainAxis;f<j?f=j:f>S&&(f=S)}if(c){var w,v;const k=m==="y"?"width":"height",j=L2.has(Mi(i)),S=r.reference[d]-r.floating[k]+(j&&((w=s.offset)==null?void 0:w[d])||0)+(j?0:x.crossAxis),_=r.reference[d]+r.reference[k]+(j?0:((v=s.offset)==null?void 0:v[d])||0)-(j?x.crossAxis:0);y<S?y=S:y>_&&(y=_)}return{[m]:f,[d]:y}}}},j4=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,a;const{placement:i,rects:r,platform:s,elements:l}=t,{apply:u=()=>{},...c}=Pi(e,t),h=await Xu(t,c),d=Mi(i),m=xl(i),f=ni(i)==="y",{width:y,height:g}=r.floating;let x,w;d==="top"||d==="bottom"?(x=d,w=m===(await(s.isRTL==null?void 0:s.isRTL(l.floating))?"start":"end")?"left":"right"):(w=d,x=m==="end"?"top":"bottom");const v=g-h.top-h.bottom,k=y-h.left-h.right,j=Cr(g-h[x],v),S=Cr(y-h[w],k),_=!t.middlewareData.shift;let T=j,E=S;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(E=k),(a=t.middlewareData.shift)!=null&&a.enabled.y&&(T=v),_&&!m){const A=zn(h.left,0),R=zn(h.right,0),F=zn(h.top,0),Y=zn(h.bottom,0);f?E=y-2*(A!==0||R!==0?A+R:zn(h.left,h.right)):T=g-2*(F!==0||Y!==0?F+Y:zn(h.top,h.bottom))}await u({...t,availableWidth:E,availableHeight:T});const O=await s.getDimensions(l.floating);return y!==O.width||g!==O.height?{reset:{rects:!0}}:{}}}};function tf(){return typeof window<"u"}function kl(e){return D2(e)?(e.nodeName||"").toLowerCase():"#document"}function qn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function di(e){var t;return(t=(D2(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function D2(e){return tf()?e instanceof Node||e instanceof qn(e).Node:!1}function Da(e){return tf()?e instanceof Element||e instanceof qn(e).Element:!1}function li(e){return tf()?e instanceof HTMLElement||e instanceof qn(e).HTMLElement:!1}function L0(e){return!tf()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof qn(e).ShadowRoot}const _4=new Set(["inline","contents"]);function Ic(e){const{overflow:t,overflowX:n,overflowY:a,display:i}=za(e);return/auto|scroll|overlay|hidden|clip/.test(t+a+n)&&!_4.has(i)}const S4=new Set(["table","td","th"]);function N4(e){return S4.has(kl(e))}const C4=[":popover-open",":modal"];function nf(e){return C4.some(t=>{try{return e.matches(t)}catch{return!1}})}const T4=["transform","translate","scale","rotate","perspective"],E4=["transform","translate","scale","rotate","perspective","filter"],A4=["paint","layout","strict","content"];function rk(e){const t=sk(),n=Da(e)?za(e):e;return T4.some(a=>n[a]?n[a]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||E4.some(a=>(n.willChange||"").includes(a))||A4.some(a=>(n.contain||"").includes(a))}function P4(e){let t=Tr(e);for(;li(t)&&!al(t);){if(rk(t))return t;if(nf(t))return null;t=Tr(t)}return null}function sk(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}
vendor: 4,112 bytes, line 516
516const M4=new Set(["html","body","#document"]);function al(e){return M4.has(kl(e))}function za(e){return qn(e).getComputedStyle(e)}function af(e){return Da(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Tr(e){if(kl(e)==="html")return e;const t=e.assignedSlot||e.parentNode||L0(e)&&e.host||di(e);return L0(t)?t.host:t}function z2(e){const t=Tr(e);return al(t)?e.ownerDocument?e.ownerDocument.body:e.body:li(t)&&Ic(t)?t:z2(t)}function Zu(e,t,n){var a;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=z2(e),r=i===((a=e.ownerDocument)==null?void 0:a.body),s=qn(i);if(r){const l=vy(s);return t.concat(s,s.visualViewport||[],Ic(i)?i:[],l&&n?Zu(l):[])}return t.concat(i,Zu(i,[],n))}function vy(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function F2(e){const t=za(e);let n=parseFloat(t.width)||0,a=parseFloat(t.height)||0;const i=li(e),r=i?e.offsetWidth:n,s=i?e.offsetHeight:a,l=Qh(n)!==r||Qh(a)!==s;return l&&(n=r,a=s),{width:n,height:a,$:l}}function ok(e){return Da(e)?e:e.contextElement}function Ao(e){const t=ok(e);if(!li(t))return ri(1);const n=t.getBoundingClientRect(),{width:a,height:i,$:r}=F2(t);let s=(r?Qh(n.width):n.width)/a,l=(r?Qh(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const R4=ri(0);function B2(e){const t=qn(e);return!sk()||!t.visualViewport?R4:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function I4(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==qn(e)?!1:t}function Cs(e,t,n,a){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),r=ok(e);let s=ri(1);t&&(a?Da(a)&&(s=Ao(a)):s=Ao(e));const l=I4(r,n,a)?B2(r):ri(0);let u=(i.left+l.x)/s.x,c=(i.top+l.y)/s.y,h=i.width/s.x,d=i.height/s.y;if(r){const m=qn(r),f=a&&Da(a)?qn(a):a;let y=m,g=vy(y);for(;g&&a&&f!==y;){const x=Ao(g),w=g.getBoundingClientRect(),v=za(g),k=w.left+(g.clientLeft+parseFloat(v.paddingLeft))*x.x,j=w.top+(g.clientTop+parseFloat(v.paddingTop))*x.y;u*=x.x,c*=x.y,h*=x.x,d*=x.y,u+=k,c+=j,y=qn(g),g=vy(y)}}return Zh({width:h,height:d,x:u,y:c})}function lk(e,t){const n=af(e).scrollLeft;return t?t.left+n:Cs(di(e)).left+n}function K2(e,t,n){n===void 0&&(n=!1);const a=e.getBoundingClientRect(),i=a.left+t.scrollLeft-(n?0:lk(e,a)),r=a.top+t.scrollTop;return{x:i,y:r}}function O4(e){let{elements:t,rect:n,offsetParent:a,strategy:i}=e;const r=i==="fixed",s=di(a),l=t?nf(t.floating):!1;if(a===s||l&&r)return n;let u={scrollLeft:0,scrollTop:0},c=ri(1);const h=ri(0),d=li(a);if((d||!d&&!r)&&((kl(a)!=="body"||Ic(s))&&(u=af(a)),li(a))){const f=Cs(a);c=Ao(a),h.x=f.x+a.clientLeft,h.y=f.y+a.clientTop}const m=s&&!d&&!r?K2(s,u,!0):ri(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-u.scrollLeft*c.x+h.x+m.x,y:n.y*c.y-u.scrollTop*c.y+h.y+m.y}}function L4(e){return Array.from(e.getClientRects())}function D4(e){const t=di(e),n=af(e),a=e.ownerDocument.body,i=zn(t.scrollWidth,t.clientWidth,a.scrollWidth,a.clientWidth),r=zn(t.scrollHeight,t.clientHeight,a.scrollHeight,a.clientHeight);let s=-n.scrollLeft+lk(e);const l=-n.scrollTop;return za(a).direction==="rtl"&&(s+=zn(t.clientWidth,a.clientWidth)-i),{width:i,height:r,x:s,y:l}}function z4(e,t){const n=qn(e),a=di(e),i=n.visualViewport;let r=a.clientWidth,s=a.clientHeight,l=0,u=0;if(i){r=i.width,s=i.height;const c=sk();(!c||c&&t==="fixed")&&(l=i.offsetLeft,u=i.offsetTop)}return{width:r,height:s,x:l,y:u}}const F4=new Set(["absolute","fixed"]);function B4(e,t){const n=Cs(e,!0,t==="fixed"),a=n.top+e.clientTop,i=n.left+e.clientLeft,r=li(e)?Ao(e):ri(1),s=e.clientWidth*r.x,l=e.clientHeight*r.y,u=i*r.x,c=a*r.y;return{width:s,height:l,x:u,y:c}}function D0(e,t,n){let a;if(t==="viewport")a=z4(e,n);else if(t==="document")a=D4(di(e));else if(Da(t))a=B4(t,n);else{const i=B2(e);a={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Zh(a)}function $2(e,t){const n=Tr(e);return n===t||!Da(n)||al(n)?!1:za(n).position==="fixed"||$2(n,t)}function K4(e,t){const n=t.get(e);if(n)return n;let a=Zu(e,[],!1).filter(l=>Da(l)&&kl(l)!=="body"),i=null;const r=za(e).position==="fixed";let s=r?Tr(e):e;for(;Da(s)&&!al(s);
vendor: 9,604 bytes, line 516
516){const l=za(s),u=rk(s);!u&&l.position==="fixed"&&(i=null),(r?!u&&!i:!u&&l.position==="static"&&!!i&&F4.has(i.position)||Ic(s)&&!u&&$2(e,s))?a=a.filter(h=>h!==s):i=l,s=Tr(s)}return t.set(e,a),a}function $4(e){let{element:t,boundary:n,rootBoundary:a,strategy:i}=e;const s=[...n==="clippingAncestors"?nf(t)?[]:K4(t,this._c):[].concat(n),a],l=s[0],u=s.reduce((c,h)=>{const d=D0(t,h,i);return c.top=zn(d.top,c.top),c.right=Cr(d.right,c.right),c.bottom=Cr(d.bottom,c.bottom),c.left=zn(d.left,c.left),c},D0(t,l,i));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function U4(e){const{width:t,height:n}=F2(e);return{width:t,height:n}}function V4(e,t,n){const a=li(t),i=di(t),r=n==="fixed",s=Cs(e,!0,r,t);let l={scrollLeft:0,scrollTop:0};const u=ri(0);function c(){u.x=lk(i)}if(a||!a&&!r)if((kl(t)!=="body"||Ic(i))&&(l=af(t)),a){const f=Cs(t,!0,r,t);u.x=f.x+t.clientLeft,u.y=f.y+t.clientTop}else i&&c();r&&!a&&i&&c();const h=i&&!a&&!r?K2(i,l):ri(0),d=s.left+l.scrollLeft-u.x-h.x,m=s.top+l.scrollTop-u.y-h.y;return{x:d,y:m,width:s.width,height:s.height}}function kp(e){return za(e).position==="static"}function z0(e,t){if(!li(e)||za(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return di(e)===n&&(n=n.ownerDocument.body),n}function U2(e,t){const n=qn(e);if(nf(e))return n;if(!li(e)){let i=Tr(e);for(;i&&!al(i);){if(Da(i)&&!kp(i))return i;i=Tr(i)}return n}let a=z0(e,t);for(;a&&N4(a)&&kp(a);)a=z0(a,t);return a&&al(a)&&kp(a)&&!rk(a)?n:a||P4(e)||n}const H4=async function(e){const t=this.getOffsetParent||U2,n=this.getDimensions,a=await n(e.floating);return{reference:V4(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:a.width,height:a.height}}};function W4(e){return za(e).direction==="rtl"}const q4={convertOffsetParentRelativeRectToViewportRelativeRect:O4,getDocumentElement:di,getClippingRect:$4,getOffsetParent:U2,getElementRects:H4,getClientRects:L4,getDimensions:U4,getScale:Ao,isElement:Da,isRTL:W4};function V2(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function G4(e,t){let n=null,a;const i=di(e);function r(){var l;clearTimeout(a),(l=n)==null||l.disconnect(),n=null}function s(l,u){l===void 0&&(l=!1),u===void 0&&(u=1),r();const c=e.getBoundingClientRect(),{left:h,top:d,width:m,height:f}=c;if(l||t(),!m||!f)return;const y=vd(d),g=vd(i.clientWidth-(h+m)),x=vd(i.clientHeight-(d+f)),w=vd(h),k={rootMargin:-y+"px "+-g+"px "+-x+"px "+-w+"px",threshold:zn(0,Cr(1,u))||1};let j=!0;function S(_){const T=_[0].intersectionRatio;if(T!==u){if(!j)return s();T?s(!1,T):a=setTimeout(()=>{s(!1,1e-7)},1e3)}T===1&&!V2(c,e.getBoundingClientRect())&&s(),j=!1}try{n=new IntersectionObserver(S,{...k,root:i.ownerDocument})}catch{n=new IntersectionObserver(S,k)}n.observe(e)}return s(!0),r}function Y4(e,t,n,a){a===void 0&&(a={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:u=!1}=a,c=ok(e),h=i||r?[...c?Zu(c):[],...Zu(t)]:[];h.forEach(w=>{i&&w.addEventListener("scroll",n,{passive:!0}),r&&w.addEventListener("resize",n)});const d=c&&l?G4(c,n):null;let m=-1,f=null;s&&(f=new ResizeObserver(w=>{let[v]=w;v&&v.target===c&&f&&(f.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var k;(k=f)==null||k.observe(t)})),n()}),c&&!u&&f.observe(c),f.observe(t));let y,g=u?Cs(e):null;u&&x();function x(){const w=Cs(e);g&&!V2(g,w)&&n(),g=w,y=requestAnimationFrame(x)}return n(),()=>{var w;h.forEach(v=>{i&&v.removeEventListener("scroll",n),r&&v.removeEventListener("resize",n)}),d==null||d(),(w=f)==null||w.disconnect(),f=null,u&&cancelAnimationFrame(y)}}const J4=k4,Q4=v4,X4=y4,Z4=j4,eF=w4,F0=g4,tF=b4,nF=(e,t,n)=>{const a=new Map,i={platform:q4,...n},r={...i.platform,_c:a};return p4(e,t,{...i,platform:r})};var aF=typeof document<"u",iF=function(){},ch=aF?p.useLayoutEffect:iF;function em(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,a,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(a=n;a--!==0;)if(!em(e[a],t[a]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(a=n;a--!==0;)if(!{}.hasOwnProperty.call(t,i[a]))return!1;for(a=n;a--!==0;){const r=i[a];if(!(r==="_owner"&&e.$$typeof)&&!em(e[r],t[r]))return!1}return!0}return e!==e&&t!==t}function H2(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function B0(e,t){const n=H2(e);return Math.round(t*n)/n}function vp(e){const t=p.useRef(e);return ch(()=>{t.current=e}),t}function rF(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:a=[],platform:i,elements:{reference:r,floating:s}={},transform:l=!0,whileElementsMounted:u,open:c}=e,[h,d]=p.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,f]=p.useState(a);em(m,a)||f(a);const[y,g]=p.useState(null),[x,w]=p.useState(null),v=p.useCallback(M=>{M!==_.current&&(_.current=M,g(M))},[]),k=p.useCallback(M=>{M!==T.current&&(T.current=M,w(M))},[]),j=r||y,S=s||x,_=p.useRef(null),T=p.useRef(null),E=p.useRef(h),O=u!=null,A=vp(u),R=vp(i),F=vp(c),Y=p.useCallback(()=>{if(!_.current||!T.current)return;const M={placement:t,strategy:n,middleware:m};R.current&&(M.platform=R.current),nF(_.current,T.current,M).then(I=>{const b={...I,isPositioned:F.current!==!1};V.current&&!em(E.current,b)&&(E.current=b,Os.flushSync(()=>{d(b)}))})},[m,t,n,R,F]);ch(()=>{c===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,d(M=>({...M,isPositioned:!1})))},[c]);const V=p.useRef(!1);ch(()=>(V.current=!0,()=>{V.current=!1}),[]),ch(()=>{if(j&&(_.current=j),S&&(T.current=S),j&&S){if(A.current)return A.current(j,S,Y);Y()}},[j,S,Y,A,O]);const z=p.useMemo(()=>({reference:_,floating:T,setReference:v,setFloating:k}),[v,k]),W=p.useMemo(()=>({reference:j,floating:S}),[j,S]),B=p.useMemo(()=>{const M={position:n,left:0,top:0};if(!W.floating)return M;const I=B0(W.floating,h.x),b=B0(W.floating,h.y);return l?{...M,transform:"translate("+I+"px, "+b+"px)",...H2(W.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:I,top:b}},[n,l,W.floating,h.x,h.y]);return p.useMemo(()=>({...h,update:Y,refs:z,elements:W,floatingStyles:B}),[h,Y,z,W,B])}const sF=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:a,padding:i}=typeof e=="function"?e(n):e;return a&&t(a)?a.current!=null?F0({element:a.current,padding:i}).fn(n):{}:a?F0({element:a,padding:i}).fn(n):{}}}},oF=(e,t)=>({...J4(e),options:[e,t]}),lF=(e,t)=>({...Q4(e),options:[e,t]}),uF=(e,t)=>({...tF(e),options:[e,t]}),cF=(e,t)=>({...X4(e),options:[e,t]}),dF=(e,t)=>({...Z4(e),options:[e,t]}),hF=(e,t)=>({...eF(e),options:[e,t]}),mF=(e,t)=>({...sF(e),options:[e,t]});var fF="Arrow",W2=p.forwardRef((e,t)=>{const{children:n,width:a=10,height:i=5,...r}=e;return o.jsx(we.svg,{...r,ref:t,width:a,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:o.jsx("polygon",{points:"0,0 30,0 15,10"})})});W2.displayName=fF;var pF=W2;function uk(e){const[t,n]=p.useState(void 0);return St(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const a=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const r=i[0];let s,l;if("borderBoxSize"in r){const u=r.borderBoxSize,c=Array.isArray(u)?u[0]:u;s=c.inlineSize,l=c.blockSize}else s=e.offsetWidth,l=e.offsetHeight;n({width:s,height:l})});return a.observe(e,{box:"border-box"}),()=>a.unobserve(e)}else n(void 0)},[e]),t}var ck="Popper",[q2,vl]=Yt(ck),[gF,G2]=q2(ck),Y2=e=>{const{__scopePopper:t,children:n}=e,[a,i]=p.useState(null);return o.jsx(gF,{scope:t,anchor:a,onAnchorChange:i,children:n})};Y2.displayName=ck;var J2="PopperAnchor",Q2=p.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:a,...i}=e,r=G2(J2,n),s=p.useRef(null),l=Pe(t,s);return p.useEffect(()=>{r.onAnchorChange((a==null?void 0:a.current)||s.current)}),a?null:o.jsx(we.div,{...i,ref:l})});Q2.displayName=J2;var dk="PopperContent",[yF,wF]=q2(dk),X2=p.forwardRef((e,t)=>{var G,ie,q,ae,de,me;const{__scopePopper:n,side:a="bottom",sideOffset:i=0,align:r="center",alignOffset:s=0,arrowPadding:l=0,avoidCollisions:u=!0,collisionBoundary:c=[],collisionPadding:h=0,sticky:d="partial",hideWhenDetached:m=!1,updatePositionStrategy:f="optimized",onPlaced:y,...g}=e,x=G2(dk,n),[w,v]=p.useState(null),k=Pe(t,Ce=>v(Ce)),[j,S]=p.useState(null),_=uk(j),T=(_==null?void 0:_.width)??0,E=(_==null?void 0:_.height)??0,O=a+(r!=="center"?"-"+r:""),A=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},R=Array.isArray(c)?c:[c],F=R.length>0,Y={padding:A,boundary:R.filter(kF),altBoundary:F},{refs:V,floatingStyles:z,placement:W,isPositioned:B,middlewareData:M}=rF({strategy:"fixed",placement:O,whileElementsMounted:(...Ce)=>Y4(...Ce,{animationFrame:f==="always"}),elements:{reference:x.anchor},middleware:[oF({mainAxis:i+E,alignmentAxis:s}),u&&lF({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?uF():void 0,...Y}),u&&cF({...Y}),dF({...Y,apply:({elements:Ce,rects:ke,availableWidth:Ve,availableHeight:We})=>{const{width:Ge,height:ht}=ke.reference,mt=Ce.floating.style;mt.setProperty("--radix-popper-available-width",`${Ve}px`),mt.setProperty("--radix-popper-available-height",`${We}px`),mt.setProperty("--radix-popper-anchor-width",`${Ge}px`),mt.setProperty("--radix-popper-anchor-height",`${ht}px`)}}),j&&mF({element:j,padding:l}),vF({arrowWidth:T,arrowHeight:E}),m&&hF({strategy:"referenceHidden",...Y})]}),[I,b]=tT(W),C=fn(y);St(()=>{B&&(C==null||C())},[B,C]);const D=(G=M.arrow)==null?void 0:G.x,N=(ie=M.arrow)==null?void 0:ie.
vendor: 8,504 bytes, line 516
516y,J=((q=M.arrow)==null?void 0:q.centerOffset)!==0,[re,ee]=p.useState();return St(()=>{w&&ee(window.getComputedStyle(w).zIndex)},[w]),o.jsx("div",{ref:V.setFloating,"data-radix-popper-content-wrapper":"",style:{...z,transform:B?z.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:re,"--radix-popper-transform-origin":[(ae=M.transformOrigin)==null?void 0:ae.x,(de=M.transformOrigin)==null?void 0:de.y].join(" "),...((me=M.hide)==null?void 0:me.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:o.jsx(yF,{scope:n,placedSide:I,onArrowChange:S,arrowX:D,arrowY:N,shouldHideArrow:J,children:o.jsx(we.div,{"data-side":I,"data-align":b,...g,ref:k,style:{...g.style,animation:B?void 0:"none"}})})})});X2.displayName=dk;var Z2="PopperArrow",xF={top:"bottom",right:"left",bottom:"top",left:"right"},eT=p.forwardRef(function(t,n){const{__scopePopper:a,...i}=t,r=wF(Z2,a),s=xF[r.placedSide];return o.jsx("span",{ref:r.onArrowChange,style:{position:"absolute",left:r.arrowX,top:r.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[r.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[r.placedSide],visibility:r.shouldHideArrow?"hidden":void 0},children:o.jsx(pF,{...i,ref:n,style:{...i.style,display:"block"}})})});eT.displayName=Z2;function kF(e){return e!==null}var vF=e=>({name:"transformOrigin",options:e,fn(t){var x,w,v;const{placement:n,rects:a,middlewareData:i}=t,s=((x=i.arrow)==null?void 0:x.centerOffset)!==0,l=s?0:e.arrowWidth,u=s?0:e.arrowHeight,[c,h]=tT(n),d={start:"0%",center:"50%",end:"100%"}[h],m=(((w=i.arrow)==null?void 0:w.x)??0)+l/2,f=(((v=i.arrow)==null?void 0:v.y)??0)+u/2;let y="",g="";return c==="bottom"?(y=s?d:`${m}px`,g=`${-u}px`):c==="top"?(y=s?d:`${m}px`,g=`${a.floating.height+u}px`):c==="right"?(y=`${-u}px`,g=s?d:`${f}px`):c==="left"&&(y=`${a.floating.width+u}px`,g=s?d:`${f}px`),{data:{x:y,y:g}}}});function tT(e){const[t,n="center"]=e.split("-");return[t,n]}var nT=Y2,hk=Q2,mk=X2,fk=eT,[rf,uie]=Yt("Tooltip",[vl]),pk=vl(),aT="TooltipProvider",bF=700,K0="tooltip.open",[jF,iT]=rf(aT),rT=e=>{const{__scopeTooltip:t,delayDuration:n=bF,skipDelayDuration:a=300,disableHoverableContent:i=!1,children:r}=e,s=p.useRef(!0),l=p.useRef(!1),u=p.useRef(0);return p.useEffect(()=>{const c=u.current;return()=>window.clearTimeout(c)},[]),o.jsx(jF,{scope:t,isOpenDelayedRef:s,delayDuration:n,onOpen:p.useCallback(()=>{window.clearTimeout(u.current),s.current=!1},[]),onClose:p.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>s.current=!0,a)},[a]),isPointerInTransitRef:l,onPointerInTransitChange:p.useCallback(c=>{l.current=c},[]),disableHoverableContent:i,children:r})};rT.displayName=aT;var sT="Tooltip",[cie,sf]=rf(sT),by="TooltipTrigger",_F=p.forwardRef((e,t)=>{const{__scopeTooltip:n,...a}=e,i=sf(by,n),r=iT(by,n),s=pk(n),l=p.useRef(null),u=Pe(t,l,i.onTriggerChange),c=p.useRef(!1),h=p.useRef(!1),d=p.useCallback(()=>c.current=!1,[]);return p.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),o.jsx(hk,{asChild:!0,...s,children:o.jsx(we.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...a,ref:u,onPointerMove:ue(e.onPointerMove,m=>{m.pointerType!=="touch"&&!h.current&&!r.isPointerInTransitRef.current&&(i.onTriggerEnter(),h.current=!0)}),onPointerLeave:ue(e.onPointerLeave,()=>{i.onTriggerLeave(),h.current=!1}),onPointerDown:ue(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:ue(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:ue(e.onBlur,i.onClose),onClick:ue(e.onClick,i.onClose)})})});_F.displayName=by;var SF="TooltipPortal",[die,NF]=rf(SF,{forceMount:void 0}),il="TooltipContent",oT=p.forwardRef((e,t)=>{const n=NF(il,e.__scopeTooltip),{forceMount:a=n.forceMount,side:i="top",...r}=e,s=sf(il,e.__scopeTooltip);return o.jsx(fa,{present:a||s.open,children:s.disableHoverableContent?o.jsx(lT,{side:i,...r,ref:t}):o.jsx(CF,{side:i,...r,ref:t})})}),CF=p.forwardRef((e,t)=>{const n=sf(il,e.__scopeTooltip),a=iT(il,e.__scopeTooltip),i=p.useRef(null),r=Pe(t,i),[s,l]=p.useState(null),{trigger:u,onClose:c}=n,h=i.current,{onPointerInTransitChange:d}=a,m=p.useCallback(()=>{l(null),d(!1)},[d]),f=p.useCallback((y,g)=>{const x=y.currentTarget,w={x:y.clientX,y:y.clientY},v=MF(w,x.getBoundingClientRect()),k=RF(w,v),j=IF(g.getBoundingClientRect()),S=LF([...k,...j]);l(S),d(!0)},[d]);return p.useEffect(()=>()=>m(),[m]),p.useEffect(()=>{if(u&&h){const y=x=>f(x,h),g=x=>f(x,u);return u.addEventListener("pointerleave",y),h.addEventListener("pointerleave",g),()=>{u.removeEventListener("pointerleave",y),h.removeEventListener("pointerleave",g)}}},[u,h,f,m]),p.useEffect(()=>{if(s){const y=g=>{const x=g.target,w={x:g.clientX,y:g.clientY},v=(u==null?void 0:u.contains(x))||(h==null?void 0:h.contains(x)),k=!OF(w,s);v?m():k&&(m(),c())};return document.addEventListener("pointermove",y),()=>document.removeEventListener("pointermove",y)}},[u,h,s,c,m]),o.jsx(lT,{...e,ref:r})}),[TF,EF]=rf(sT,{isInside:!1}),AF=FC("TooltipContent"),lT=p.forwardRef((e,t)=>{const{__scopeTooltip:n,children:a,"aria-label":i,onEscapeKeyDown:r,onPointerDownOutside:s,...l}=e,u=sf(il,n),c=pk(n),{onClose:h}=u;return p.useEffect(()=>(document.addEventListener(K0,h),()=>document.removeEventListener(K0,h)),[h]),p.useEffect(()=>{if(u.trigger){const d=m=>{const f=m.target;f!=null&&f.contains(u.trigger)&&h()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[u.trigger,h]),o.jsx(gl,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:d=>d.preventDefault(),onDismiss:h,children:o.jsxs(mk,{"data-state":u.stateAttribute,...c,...l,ref:t,style:{...l.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[o.jsx(AF,{children:a}),o.jsx(TF,{scope:n,isInside:!0,children:o.jsx(z3,{id:u.contentId,role:"tooltip",children:i||a})})]})})});oT.displayName=il;var uT="TooltipArrow",PF=p.forwardRef((e,t)=>{const{__scopeTooltip:n,...a}=e,i=pk(n);return EF(uT,n).isInside?null:o.jsx(fk,{...i,...a,ref:t})});PF.displayName=uT;function MF(e,t){const n=Math.abs(t.top-e.y),a=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),r=Math.abs(t.left-e.x);switch(Math.min(n,a,i,r)){case r:return"left";case i:return"right";case n:return"top";case a:return"bottom";default:throw new Error("unreachable")}}function RF(e,t,n=5){const a=[];switch(t){case"top":a.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":a.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":a.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":a.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return a}function IF(e){const{top:t,right:n,bottom:a,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:a},{x:i,y:a}]}function OF(e,t){const{x:n,y:a}=e;let i=!1;for(let r=0,s=t.length-1;r<t.length;s=r++){const l=t[r],u=t[s],c=l.x,h=l.y,d=u.x,m=u.y;h>a!=m>a&&n<(d-c)*(a-h)/(m-h)+c&&(i=!i)}return i}function LF(e){const t=e.slice();return t.sort((n,a)=>n.x<a.x?-1:n.x>a.x?1:n.y<a.y?-1:n.y>a.y?1:0),DF(t)}function DF(e){if(e.length<=1)return e.slice();const t=[];for(let a=0;a<e.length;a++){const i=e[a];for(;t.length>=2;){const r=t[t.length-1],s=t[t.length-2];if((r.x-s.x)*(i.y-s.y)>=(r.y-s.y)*(i.x-s.x))t.pop();else break}t.push(i)}t.pop();const n=[];for(let a=e.length-1;a>=0;a--){const i=e[a];for(;n.length>=2;){const r=n[n.length-1],s=n[n.length-2];if((r.x-s.x)*(i.y-s.y)>=(r.y-s.y)*(i.x-s.x))n.pop();else break}n.push(i)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var zF=rT,cT=oT;const FF=zF,BF=p.forwardRef(({className:e,sideOffset:t=4,...n},a)=>o.jsx(cT,{ref:a,sideOffset:t,className:ce("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:sli
516de-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}));BF.displayName=cT.displayName;var Oc=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Ts=typeof window>"u"||"Deno"in globalThis;function jn(){}function KF(e,t){return typeof e=="function"?e(t):e}function jy(e){return typeof e=="number"&&e>=0&&e!==1/0}function dT(e,t){return Math.max(e+(t||0)-Date.now(),0)}function jr(e,t){return typeof e=="function"?e(t):e}function ta(e,t){return typeof e=="function"?e(t):e}function $0(e,t){const{type:n="all",exact:a,fetchStatus:i,predicate:r,queryKey:s,stale:l}=e;if(s){if(a){if(t.queryHash!==gk(s,t.options))return!1}else if(!tc(t.queryKey,s))return!1}if(n!=="all"){const u=t.isActive();if(n==="active"&&!u||n==="inactive"&&u)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||i&&i!==t.state.fetchStatus||r&&!r(t))}function U0(e,t){const{exact:n,status:a,predicate:i,mutationKey:r}=e;if(r){if(!t.options.mutationKey)return!1;if(n){if(ec(t.options.mutationKey)!==ec(r))return!1}else if(!tc(t.options.mutationKey,r))return!1}return!(a&&t.state.status!==a||i&&!i(t))}function gk(e,t){return((t==null?void 0:t.queryKeyHashFn)||ec)(e)}function ec(e){return JSON.stringify(e,(t,n)=>Sy(n)?Object.keys(n).sort().reduce((a,i)=>(a[i]=n[i],a),{}):n)}function tc(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>tc(e[n],t[n])):!1}function hT(e,t){if(e===t)return e;const n=V0(e)&&V0(t);if(n||Sy(e)&&Sy(t)){const a=n?e:Object.keys(e),i=a.length,r=n?t:Object.keys(t),s=r.length,l=n?[]:{},u=new Set(a);let c=0;for(let h=0;h<s;h++){const d=n?h:r[h];(!n&&u.has(d)||n)&&e[d]===void 0&&t[d]===void 0?(l[d]=void 0,c++):(l[d]=hT(e[d],t[d]),l[d]===e[d]&&e[d]!==void 0&&c++)}return i===s&&c===i?e:l}return t}function _y(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function V0(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Sy(e){if(!H0(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!H0(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function H0(e){return Object.prototype.toString.call(e)==="[object Object]"}function $F(e){return new Promise(t=>{setTimeout(t,e)})}function Ny(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?hT(e,t):t}function UF(e,t,n=0){const a=[...e,t];return n&&a.length>n?a.slice(1):a}function VF(e,t,n=0){const a=[t,...e];return n&&a.length>n?a.slice(0,-1):a}var yk=Symbol();function mT(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===yk?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function HF(e,t){return typeof e=="function"?e(...t):!!e}var ss,tr,Lo,pS,WF=(pS=class extends Oc{constructor(){super();Ne(this,ss);Ne(this,tr);Ne(this,Lo);pe(this,Lo,t=>{if(!Ts&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){K(this,tr)||this.setEventListener(K(this,Lo))}onUnsubscribe(){var t;this.hasListeners()||((t=K(this,tr))==null||t.call(this),pe(this,tr,void 0))}setEventListener(t){var n;pe(this,Lo,t),(n=K(this,tr))==null||n.call(this),pe(this,tr,t(a=>{typeof a=="boolean"?this.setFocused(a):this.onFocus()}))}setFocused(t){K(this,ss)!==t&&(pe(this,ss,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof K(this,ss)=="boolean"?K(this,ss):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},ss=new WeakMap,tr=new WeakMap,Lo=new WeakMap,pS),wk=new WF,Do,nr,zo,gS,qF=(gS=class extends Oc{constructor(){super();Ne(this,Do,!0);Ne(this,nr);Ne(this,zo);pe(this,zo,t=>{if(!Ts&&window.addEventListener){const n=()=>t(!0),a=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",a,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",a)}}})}onSubscribe(){K(this,nr)||this.setEventListener(K(this,zo))}onUnsubscribe(){var t;this.hasListeners()||((t=K(this,nr))==null||t.call(this),pe(this,nr,void 0))}setEventListener(t){var n;pe(this,zo,t),(n=K(this,nr))==null||n.call(this),pe(this,nr,t(this.setOnline.bind(this)))}setOnline(t){K(this,Do)!==t&&(pe(this,Do,t),this.listeners.forEac
vendor: 28,460 bytes, line 516
516h(a=>{a(t)}))}isOnline(){return K(this,Do)}},Do=new WeakMap,nr=new WeakMap,zo=new WeakMap,gS),tm=new qF;function Cy(){let e,t;const n=new Promise((i,r)=>{e=i,t=r});n.status="pending",n.catch(()=>{});function a(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{a({status:"fulfilled",value:i}),e(i)},n.reject=i=>{a({status:"rejected",reason:i}),t(i)},n}function GF(e){return Math.min(1e3*2**e,3e4)}function fT(e){return(e??"online")==="online"?tm.isOnline():!0}var pT=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function bp(e){return e instanceof pT}function gT(e){let t=!1,n=0,a=!1,i;const r=Cy(),s=g=>{var x;a||(m(new pT(g)),(x=e.abort)==null||x.call(e))},l=()=>{t=!0},u=()=>{t=!1},c=()=>wk.isFocused()&&(e.networkMode==="always"||tm.isOnline())&&e.canRun(),h=()=>fT(e.networkMode)&&e.canRun(),d=g=>{var x;a||(a=!0,(x=e.onSuccess)==null||x.call(e,g),i==null||i(),r.resolve(g))},m=g=>{var x;a||(a=!0,(x=e.onError)==null||x.call(e,g),i==null||i(),r.reject(g))},f=()=>new Promise(g=>{var x;i=w=>{(a||c())&&g(w)},(x=e.onPause)==null||x.call(e)}).then(()=>{var g;i=void 0,a||(g=e.onContinue)==null||g.call(e)}),y=()=>{if(a)return;let g;const x=n===0?e.initialPromise:void 0;try{g=x??e.fn()}catch(w){g=Promise.reject(w)}Promise.resolve(g).then(d).catch(w=>{var _;if(a)return;const v=e.retry??(Ts?0:3),k=e.retryDelay??GF,j=typeof k=="function"?k(n,w):k,S=v===!0||typeof v=="number"&&n<v||typeof v=="function"&&v(n,w);if(t||!S){m(w);return}n++,(_=e.onFail)==null||_.call(e,n,w),$F(j).then(()=>c()?void 0:f()).then(()=>{t?m(w):y()})})};return{promise:r,cancel:s,continue:()=>(i==null||i(),r),cancelRetry:l,continueRetry:u,canStart:h,start:()=>(h()?y():f().then(y),r)}}var YF=e=>setTimeout(e,0);function JF(){let e=[],t=0,n=l=>{l()},a=l=>{l()},i=YF;const r=l=>{t?e.push(l):i(()=>{n(l)})},s=()=>{const l=e;e=[],l.length&&i(()=>{a(()=>{l.forEach(u=>{n(u)})})})};return{batch:l=>{let u;t++;try{u=l()}finally{t--,t||s()}return u},batchCalls:l=>(...u)=>{r(()=>{l(...u)})},schedule:r,setNotifyFunction:l=>{n=l},setBatchNotifyFunction:l=>{a=l},setScheduler:l=>{i=l}}}var Vt=JF(),os,yS,yT=(yS=class{constructor(){Ne(this,os)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),jy(this.gcTime)&&pe(this,os,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Ts?1/0:5*60*1e3))}clearGcTimeout(){K(this,os)&&(clearTimeout(K(this,os)),pe(this,os,void 0))}},os=new WeakMap,yS),Fo,ls,ea,us,Zt,wc,cs,Na,gi,wS,QF=(wS=class extends yT{constructor(t){super();Ne(this,Na);Ne(this,Fo);Ne(this,ls);Ne(this,ea);Ne(this,us);Ne(this,Zt);Ne(this,wc);Ne(this,cs);pe(this,cs,!1),pe(this,wc,t.defaultOptions),this.setOptions(t.options),this.observers=[],pe(this,us,t.client),pe(this,ea,K(this,us).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,pe(this,Fo,XF(this.options)),this.state=t.state??K(this,Fo),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=K(this,Zt))==null?void 0:t.promise}setOptions(t){this.options={...K(this,wc),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&K(this,ea).remove(this)}setData(t,n){const a=Ny(this.state.data,t,this.options);return ze(this,Na,gi).call(this,{data:a,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),a}setState(t,n){ze(this,Na,gi).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var a,i;const n=(a=K(this,Zt))==null?void 0:a.promise;return(i=K(this,Zt))==null||i.cancel(t),n?n.then(jn).catch(jn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(K(this,Fo))}isActive(){return this.observers.some(t=>ta(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===yk||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>jr(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!dT(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(a=>a.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=K(this,Zt))==null||n.continue()}onOnline(){var n;const t=this.observers.find(a=>a.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=K(this,Zt))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),K(this,ea).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(K(this,Zt)&&(K(this,cs)?K(this,Zt).cancel({revert:!0}):K(this,Zt).cancelRetry()),this.scheduleGc()),K(this,ea).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||ze(this,Na,gi).call(this,{type:"invalidate"})}fetch(t,n){var c,h,d;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(K(this,Zt))return K(this,Zt).continueRetry(),K(this,Zt).promise}if(t&&this.setOptions(t),!this.options.queryFn){const m=this.observers.find(f=>f.options.queryFn);m&&this.setOptions(m.options)}const a=new AbortController,i=m=>{Object.defineProperty(m,"signal",{enumerable:!0,get:()=>(pe(this,cs,!0),a.signal)})},r=()=>{const m=mT(this.options,n),y=(()=>{const g={client:K(this,us),queryKey:this.queryKey,meta:this.meta};return i(g),g})();return pe(this,cs,!1),this.options.persister?this.options.persister(m,y,this):m(y)},l=(()=>{const m={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:K(this,us),state:this.state,fetchFn:r};return i(m),m})();(c=this.options.behavior)==null||c.onFetch(l,this),pe(this,ls,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((h=l.fetchOptions)==null?void 0:h.meta))&&ze(this,Na,gi).call(this,{type:"fetch",meta:(d=l.fetchOptions)==null?void 0:d.meta});const u=m=>{var f,y,g,x;bp(m)&&m.silent||ze(this,Na,gi).call(this,{type:"error",error:m}),bp(m)||((y=(f=K(this,ea).config).onError)==null||y.call(f,m,this),(x=(g=K(this,ea).config).onSettled)==null||x.call(g,this.state.data,m,this)),this.scheduleGc()};return pe(this,Zt,gT({initialPromise:n==null?void 0:n.initialPromise,fn:l.fetchFn,abort:a.abort.bind(a),onSuccess:m=>{var f,y,g,x;if(m===void 0){u(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(m)}catch(w){u(w);return}(y=(f=K(this,ea).config).onSuccess)==null||y.call(f,m,this),(x=(g=K(this,ea).config).onSettled)==null||x.call(g,m,this.state.error,this),this.scheduleGc()},onError:u,onFail:(m,f)=>{ze(this,Na,gi).call(this,{type:"failed",failureCount:m,error:f})},onPause:()=>{ze(this,Na,gi).call(this,{type:"pause"})},onContinue:()=>{ze(this,Na,gi).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0})),K(this,Zt).start()}},Fo=new WeakMap,ls=new WeakMap,ea=new WeakMap,us=new WeakMap,Zt=new WeakMap,wc=new WeakMap,cs=new WeakMap,Na=new WeakSet,gi=function(t){const n=a=>{switch(t.type){case"failed":return{...a,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...a,fetchStatus:"paused"};case"continue":return{...a,fetchStatus:"fetching"};case"fetch":return{...a,...wT(a.data,this.options),fetchMeta:t.meta??null};case"success":return pe(this,ls,void 0),{...a,data:t.data,dataUpdateCount:a.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=t.error;return bp(i)&&i.revert&&K(this,ls)?{...K(this,ls),fetchStatus:"idle"}:{...a,error:i,errorUpdateCount:a.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:a.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...a,isInvalidated:!0};case"setState":return{...a,...t.state}}};this.state=n(this.state),Vt.batch(()=>{this.observers.forEach(a=>{a.onQueryUpdate()}),K(this,ea).notify({query:this,type:"updated",action:t})})},wS);function wT(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:fT(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function XF(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,a=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?a??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Ga,xS,ZF=(xS=class extends Oc{constructor(t={}){super();Ne(this,Ga);this.config=t,pe(this,Ga,new Map)}build(t,n,a){const i=n.queryKey,r=n.queryHash??gk(i,n);let s=this.get(r);return s||(s=new QF({client:t,queryKey:i,queryHash:r,options:t.defaultQueryOptions(n),state:a,defaultOptions:t.getQueryDefaults(i)}),this.add(s)),s}add(t){K(this,Ga).has(t.queryHash)||(K(this,Ga).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=K(this,Ga).get(t.queryHash);n&&(t.destroy(),n===t&&K(this,Ga).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Vt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return K(this,Ga).get(t)}getAll(){return[...K(this,Ga).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(a=>$0(n,a))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(a=>$0(t,a)):n}notify(t){Vt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Vt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Vt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Ga=new WeakMap,xS),Ya,on,ds,Ja,Hi,kS,eB=(kS=class extends yT{constructor(t){super();Ne(this,Ja);Ne(this,Ya);Ne(this,on);Ne(this,ds);this.mutationId=t.mutationId,pe(this,on,t.mutationCache),pe(this,Ya,[]),this.state=t.state||tB(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){K(this,Ya).includes(t)||(K(this,Ya).push(t),this.clearGcTimeout(),K(this,on).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){pe(this,Ya,K(this,Ya).filter(n=>n!==t)),this.scheduleGc(),K(this,on).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){K(this,Ya).length||(this.state.status==="pending"?this.scheduleGc():K(this,on).remove(this))}continue(){var t;return((t=K(this,ds))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var r,s,l,u,c,h,d,m,f,y,g,x,w,v,k,j,S,_,T,E;const n=()=>{ze(this,Ja,Hi).call(this,{type:"continue"})};pe(this,ds,gT({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(O,A)=>{ze(this,Ja,Hi).call(this,{type:"failed",failureCount:O,error:A})},onPause:()=>{ze(this,Ja,Hi).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>K(this,on).canRun(this)}));const a=this.state.status==="pending",i=!K(this,ds).canStart();try{if(a)n();else{ze(this,Ja,Hi).call(this,{type:"pending",variables:t,isPaused:i}),await((s=(r=K(this,on).config).onMutate)==null?void 0:s.call(r,t,this));const A=await((u=(l=this.options).onMutate)==null?void 0:u.call(l,t));A!==this.state.context&&ze(this,Ja,Hi).call(this,{type:"pending",context:A,variables:t,isPaused:i})}const O=await K(this,ds).start();return await((h=(c=K(this,on).config).onSuccess)==null?void 0:h.call(c,O,t,this.state.context,this)),await((m=(d=this.options).onSuccess)==null?void 0:m.call(d,O,t,this.state.context)),await((y=(f=K(this,on).config).onSettled)==null?void 0:y.call(f,O,null,this.state.variables,this.state.context,this)),await((x=(g=this.options).onSettled)==null?void 0:x.call(g,O,null,t,this.state.context)),ze(this,Ja,Hi).call(this,{type:"success",data:O}),O}catch(O){try{throw await((v=(w=K(this,on).config).onError)==null?void 0:v.call(w,O,t,this.state.context,this)),await((j=(k=this.options).onError)==null?void 0:j.call(k,O,t,this.state.context)),await((_=(S=K(this,on).config).onSettled)==null?void 0:_.call(S,void 0,O,this.state.variables,this.state.context,this)),await((E=(T=this.options).onSettled)==null?void 0:E.call(T,void 0,O,t,this.state.context)),O}finally{ze(this,Ja,Hi).call(this,{type:"error",error:O})}}finally{K(this,on).runNext(this)}}},Ya=new WeakMap,on=new WeakMap,ds=new WeakMap,Ja=new WeakSet,Hi=function(t){const n=a=>{switch(t.type){case"failed":return{...a,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...a,isPaused:!0};case"continue":return{...a,isPaused:!1};case"pending":return{...a,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...a,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...a,data:void 0,error:t.error,failureCount:a.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Vt.batch(()=>{K(this,Ya).forEach(a=>{a.onMutationUpdate(t)}),K(this,on).notify({mutation:this,type:"updated",action:t})})},kS);function tB(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var vi,Ca,xc,vS,nB=(vS=class extends Oc{constructor(t={}){super();Ne(this,vi);Ne(this,Ca);Ne(this,xc);this.config=t,pe(this,vi,new Set),pe(this,Ca,new Map),pe(this,xc,0)}build(t,n,a){const i=new eB({mutationCache:this,mutationId:++ed(this,xc)._,options:t.defaultMutationOptions(n),state:a});return this.add(i),i}add(t){K(this,vi).add(t);const n=bd(t);if(typeof n=="string"){const a=K(this,Ca).get(n);a?a.push(t):K(this,Ca).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(K(this,vi).delete(t)){const n=bd(t);if(typeof n=="string"){const a=K(this,Ca).get(n);if(a)if(a.length>1){const i=a.indexOf(t);i!==-1&&a.splice(i,1)}else a[0]===t&&K(this,Ca).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=bd(t);if(typeof n=="string"){const a=K(this,Ca).get(n),i=a==null?void 0:a.find(r=>r.state.status==="pending");return!i||i===t}else return!0}runNext(t){var a;const n=bd(t);if(typeof n=="string"){const i=(a=K(this,Ca).get(n))==null?void 0:a.find(r=>r!==t&&r.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Vt.batch(()=>{K(this,vi).forEach(t=>{this.notify({type:"removed",mutation:t})}),K(this,vi).clear(),K(this,Ca).clear()})}getAll(){return Array.from(K(this,vi))}find(t){const n={exact:!0,...t};return this.getAll().find(a=>U0(n,a))}findAll(t={}){return this.getAll().filter(n=>U0(t,n))}notify(t){Vt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Vt.batch(()=>Promise.all(t.map(n=>n.continue().catch(jn))))}},vi=new WeakMap,Ca=new WeakMap,xc=new WeakMap,vS);function bd(e){var t;return(t=e.options.scope)==null?void 0:t.id}function W0(e){return{onFetch:(t,n)=>{var h,d,m,f,y;const a=t.options,i=(m=(d=(h=t.fetchOptions)==null?void 0:h.meta)==null?void 0:d.fetchMore)==null?void 0:m.direction,r=((f=t.state.data)==null?void 0:f.pages)||[],s=((y=t.state.data)==null?void 0:y.pageParams)||[];let l={pages:[],pageParams:[]},u=0;const c=async()=>{let g=!1;const x=k=>{Object.defineProperty(k,"signal",{enumerable:!0,get:()=>(t.signal.aborted?g=!0:t.signal.addEventListener("abort",()=>{g=!0}),t.signal)})},w=mT(t.options,t.fetchOptions),v=async(k,j,S)=>{if(g)return Promise.reject();if(j==null&&k.pages.length)return Promise.resolve(k);const T=(()=>{const R={client:t.client,queryKey:t.queryKey,pageParam:j,direction:S?"backward":"forward",meta:t.options.meta};return x(R),R})(),E=await w(T),{maxPages:O}=t.options,A=S?VF:UF;return{pages:A(k.pages,E,O),pageParams:A(k.pageParams,j,O)}};if(i&&r.length){const k=i==="backward",j=k?aB:q0,S={pages:r,pageParams:s},_=j(a,S);l=await v(S,_,k)}else{const k=e??r.length;do{const j=u===0?s[0]??a.initialPageParam:q0(a,l);if(u>0&&j==null)break;l=await v(l,j),u++}while(u<k)}return l};t.options.persister?t.fetchFn=()=>{var g,x;return(x=(g=t.options).persister)==null?void 0:x.call(g,c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=c}}}function q0(e,{pages:t,pageParams:n}){const a=t.length-1;return t.length>0?e.getNextPageParam(t[a],t,n[a],n):void 0}function aB(e,{pages:t,pageParams:n}){var a;return t.length>0?(a=e.getPreviousPageParam)==null?void 0:a.call(e,t[0],t,n[0],n):void 0}var kt,ar,ir,Bo,Ko,rr,$o,Uo,bS,iB=(bS=class{constructor(e={}){Ne(this,kt);Ne(this,ar);Ne(this,ir);Ne(this,Bo);Ne(this,Ko);Ne(this,rr);Ne(this,$o);Ne(this,Uo);pe(this,kt,e.queryCache||new ZF),pe(this,ar,e.mutationCache||new nB),pe(this,ir,e.defaultOptions||{}),pe(this,Bo,new Map),pe(this,Ko,new Map),pe(this,rr,0)}mount(){ed(this,rr)._++,K(this,rr)===1&&(pe(this,$o,wk.subscribe(async e=>{e&&(await this.resumePausedMutations(),K(this,kt).onFocus())})),pe(this,Uo,tm.subscribe(async e=>{e&&(await this.resumePausedMutations(),K(this,kt).onOnline())})))}unmount(){var e,t;ed(this,rr)._--,K(this,rr)===0&&((e=K(this,$o))==null||e.call(this),pe(this,$o,void 0),(t=K(this,Uo))==null||t.call(this),pe(this,Uo,void 0))}isFetching(e){return K(this,kt).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return K(this,ar).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=K(this,kt).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=K(this,kt).build(this,t),a=n.state.data;return a===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(jr(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(a))}getQueriesData(e){return K(this,kt).findAll(e).map(({queryKey:t,state:n})=>{const a=n.data;return[t,a]})}setQueryData(e,t,n){const a=this.defaultQueryOptions({queryKey:e}),i=K(this,kt).get(a.queryHash),r=i==null?void 0:i.state.data,s=KF(t,r);if(s!==void 0)return K(this,kt).build(this,a).setData(s,{...n,manual:!0})}setQueriesData(e,t,n){return Vt.batch(()=>K(this,kt).findAll(e).map(({queryKey:a})=>[a,this.setQueryData(a,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=K(this,kt).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=K(this,kt);Vt.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=K(this,kt);return Vt.batch(()=>(n.findAll(e).forEach(a=>{a.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},a=Vt.batch(()=>K(this,kt).findAll(e).map(i=>i.cancel(n)));return Promise.all(a).then(jn).catch(jn)}invalidateQueries(e,t={}){return Vt.batch(()=>(K(this,kt).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},a=Vt.batch(()=>K(this,kt).findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let r=i.fetch(void 0,n);return n.throwOnError||(r=r.catch(jn)),i.state.fetchStatus==="paused"?Promise.resolve():r}));return Promise.all(a).then(jn)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=K(this,kt).build(this,t);return n.isStaleByTime(jr(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(jn).catch(jn)}fetchInfiniteQuery(e){return e.behavior=W0(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(jn).catch(jn)}ensureInfiniteQueryData(e){return e.behavior=W0(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return tm.isOnline()?K(this,ar).resumePausedMutations():Promise.resolve()}getQueryCache(){return K(this,kt)}getMutationCache(){return K(this,ar)}getDefaultOptions(){return K(this,ir)}setDefaultOptions(e){pe(this,ir,e)}setQueryDefaults(e,t){K(this,Bo).set(ec(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...K(this,Bo).values()],n={};return t.forEach(a=>{tc(e,a.queryKey)&&Object.assign(n,a.defaultOptions)}),n}setMutationDefaults(e,t){K(this,Ko).set(ec(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...K(this,Ko).values()],n={};return t.forEach(a=>{tc(e,a.mutationKey)&&Object.assign(n,a.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...K(this,ir).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=gk(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===yk&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...K(this,ir).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){K(this,kt).clear(),K(this,ar).clear()}},kt=new WeakMap,ar=new WeakMap,ir=new WeakMap,Bo=new WeakMap,Ko=new WeakMap,rr=new WeakMap,$o=new WeakMap,Uo=new WeakMap,bS),vn,Fe,kc,ln,hs,Vo,sr,or,vc,Ho,Wo,ms,fs,lr,qo,Ye,ru,Ty,Ey,Ay,Py,My,Ry,Iy,xT,jS,rB=(jS=class extends Oc{constructor(t,n){super();Ne(this,Ye);Ne(this,vn);Ne(this,Fe);Ne(this,kc);Ne(this,ln);Ne(this,hs);Ne(this,Vo);Ne(this,sr);Ne(this,or);Ne(this,vc);Ne(this,Ho);Ne(this,Wo);Ne(this,ms);Ne(this,fs);Ne(this,lr);Ne(this,qo,new Set);this.options=n,pe(this,vn,t),pe(this,or,null),pe(this,sr,Cy()),this.options.experimental_prefetchInRender||K(this,sr).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(K(this,Fe).addObserver(this),G0(K(this,Fe),this.options)?ze(this,Ye,ru).call(this):this.updateResult(),ze(this,Ye,Py).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Oy(K(this,Fe),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Oy(K(this,Fe),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ze(this,Ye,My).call(this),ze(this,Ye,Ry).call(this),K(this,Fe).removeObserver(this)}setOptions(t){const n=this.options,a=K(this,Fe);if(this.options=K(this,vn).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof ta(this.options.enabled,K(this,Fe))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");ze(this,Ye,Iy).call(this),K(this,Fe).setOptions(this.options),n._defaulted&&!_y(this.options,n)&&K(this,vn).getQueryCache().notify({type:"observerOptionsUpdated",query:K(this,Fe),observer:this});const i=this.hasListeners();i&&Y0(K(this,Fe),a,this.options,n)&&ze(this,Ye,ru).call(this),this.updateResult(),i&&(K(this,Fe)!==a||ta(this.options.enabled,K(this,Fe))!==ta(n.enabled,K(this,Fe))||jr(this.options.staleTime,K(this,Fe))!==jr(n.staleTime,K(this,Fe)))&&ze(this,Ye,Ty).call(this);const r=ze(this,Ye,Ey).call(this);i&&(K(this,Fe)!==a||ta(this.options.enabled,K(this,Fe))!==ta(n.enabled,K(this,Fe))||r!==K(this,lr))&&ze(this,Ye,Ay).call(this,r)}getOptimisticResult(t){const n=K(this,vn).getQueryCache().build(K(this,vn),t),a=this.createResult(n,t);return oB(this,a)&&(pe(this,ln,a),pe(this,Vo,this.options),pe(this,hs,K(this,Fe).state)),a}getCurrentResult(){return K(this,ln)}trackResult(t,n){return new Proxy(t,{get:(a,i)=>(this.trackProp(i),n==null||n(i),Reflect.get(a,i))})}trackProp(t){K(this,qo).add(t)}getCurrentQuery(){return K(this,Fe)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=K(this,vn).defaultQueryOptions(t),a=K(this,vn).getQueryCache().build(K(this,vn),n);return a.fetch().then(()=>this.createResult(a,n))}fetch(t){return ze(this,Ye,ru).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),K(this,ln)))}createResult(t,n){var O;const a=K(this,Fe),i=this.options,r=K(this,ln),s=K(this,hs),l=K(this,Vo),c=t!==a?t.state:K(this,kc),{state:h}=t;let d={...h},m=!1,f;if(n._optimisticResults){const A=this.hasListeners(),R=!A&&G0(t,n),F=A&&Y0(t,a,n,i);(R||F)&&(d={...d,...wT(h.data,t.options)}),n._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:y,errorUpdatedAt:g,status:x}=d;f=d.data;let w=!1;if(n.placeholderData!==void 0&&f===void 0&&x==="pending"){let A;r!=null&&r.isPlaceholderData&&n.placeholderData===(l==null?void 0:l.placeholderData)?(A=r.data,w=!0):A=typeof n.placeholderData=="function"?n.placeholderData((O=K(this,Wo))==null?void 0:O.state.data,K(this,Wo)):n.placeholderData,A!==void 0&&(x="success",f=Ny(r==null?void 0:r.data,A,n),m=!0)}if(n.select&&f!==void 0&&!w)if(r&&f===(s==null?void 0:s.data)&&n.select===K(this,vc))f=K(this,Ho);else try{pe(this,vc,n.select),f=n.select(f),f=Ny(r==null?void 0:r.data,f,n),pe(this,Ho,f),pe(this,or,null)}catch(A){pe(this,or,A)}K(this,or)&&(y=K(this,or),f=K(this,Ho),g=Date.now(),x="error");const v=d.fetchStatus==="fetching",k=x==="pending",j=x==="error",S=k&&v,_=f!==void 0,E={status:x,fetchStatus:d.fetchStatus,isPending:k,isSuccess:x==="success",isError:j,isInitialLoading:S,isLoading:S,data:f,dataUpdatedAt:d.dataUpdatedAt,error:y,errorUpdatedAt:g,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>c.dataUpdateCount||d.errorUpdateCount>c.errorUpdateCount,isFetching:v,isRefetching:v&&!k,isLoadingError:j&&!_,isPaused:d.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:j&&_,isStale:xk(t,n),refetch:this.refetch,promise:K(this,sr),isEnabled:ta(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const A=Y=>{E.status==="error"?Y.reject(E.error):E.data!==void 0&&Y.resolve(E.data)},R=()=>{const Y=pe(this,sr,E.promise=Cy());A(Y)},F=K(this,sr);switch(F.status){case"pending":t.queryHash===a.queryHash&&A(F);break;case"fulfilled":(E.status==="error"||E.data!==F.value)&&R();break;case"rejected":(E.status!=="error"||E.error!==F.reason)&&R();break}}return E}updateResult(){const t=K(this,ln),n=this.createResult(K(this,Fe),this.options);if(pe(this,hs,K(this,Fe).state),pe(this,Vo,this.options),K(this,hs).data!==void 0&&pe(this,Wo,K(this,Fe)),_y(n,t))return;pe(this,ln,n);const a=()=>{if(!t)return!0;const{notifyOnChangeProps:i}=this.options,r=typeof i=="function"?i():i;if(r==="all"||!r&&!K(this,qo).size)return!0;const s=new Set(r??K(this,qo));return this.options.throwOnError&&s.add("error"),Object.keys(K(this,ln)).some(l=>{const u=l;return K(this,ln)[u]!==t[u]&&s.has(u)})};ze(this,Ye,xT).call(this,{listeners:a()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ze(this,Ye,Py).call(this)}},vn=new WeakMap,Fe=new WeakMap,kc=new WeakMap,ln=new WeakMap,hs=new WeakMap,Vo=new WeakMap,sr=new WeakMap,or=new WeakMap,vc=new WeakMap,Ho=new WeakMap,Wo=new WeakMap,ms=new WeakMap,fs=new WeakMap,lr=new WeakMap,qo=new WeakMap,Ye=new WeakSet,ru=function(t){ze(this,Ye,Iy).call(this);let n=K(this,Fe).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(jn)),n},Ty=function(){ze(this,Ye,My).call(this);const t=jr(this.options.staleTime,K(this,Fe));if(Ts||K(this,ln).isStale||!jy(t))return;const a=dT(K(this,ln).dataUpdatedAt,t)+1;pe(this,ms,setTimeout(()=>{K(this,ln).isStale||this.updateResult()},a))},Ey=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(K(this,Fe)):this.options.refetchInterval)??!1},Ay=function(t){ze(this,Ye,Ry).call(this),pe(this,lr,t),!(Ts||ta(this.options.enabled,K(this,Fe))===!1||!jy(K(this,lr))||K(this,lr)===0)&&pe(this,fs,setInterval(()=>
516{(this.options.refetchIntervalInBackground||wk.isFocused())&&ze(this,Ye,ru).call(this)},K(this,lr)))},Py=function(){ze(this,Ye,Ty).call(this),ze(this,Ye,Ay).call(this,ze(this,Ye,Ey).call(this))},My=function(){K(this,ms)&&(clearTimeout(K(this,ms)),pe(this,ms,void 0))},Ry=function(){K(this,fs)&&(clearInterval(K(this,fs)),pe(this,fs,void 0))},Iy=function(){const t=K(this,vn).getQueryCache().build(K(this,vn),this.options);if(t===K(this,Fe))return;const n=K(this,Fe);pe(this,Fe,t),pe(this,kc,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},xT=function(t){Vt.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(K(this,ln))}),K(this,vn).getQueryCache().notify({query:K(this,Fe),type:"observerResultsUpdated"})})},jS);function sB(e,t){return ta(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function G0(e,t){return sB(e,t)||e.state.data!==void 0&&Oy(e,t,t.refetchOnMount)}function Oy(e,t,n){if(ta(t.enabled,e)!==!1&&jr(t.staleTime,e)!=="static"){const a=typeof n=="function"?n(e):n;return a==="always"||a!==!1&&xk(e,t)}return!1}function Y0(e,t,n,a){return(e!==t||ta(a.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&xk(e,n)}function xk(e,t){return ta(t.enabled,e)!==!1&&e.isStaleByTime(jr(t.staleTime,e))}function oB(e,t){return!_y(e.getCurrentResult(),t)}var kT=p.createContext(void 0),lB=e=>{const t=p.useContext(kT);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},uB=({client:e,children:t})=>(p.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),o.jsx(kT.Provider,{value:e,children:t})),vT=p.createContext(!1),cB=()=>p.useContext(vT);vT.Provider;function dB(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var hB=p.createContext(dB()),mB=()=>p.useContext(hB),fB=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},pB=e=>{p.useEffect(()=>{e.clearReset()},[e])},gB=({result:e,errorResetBoundary:t,throwOnError:n,query:a,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&a&&(i&&e.data===void 0||HF(n,[e.error,a])),yB=e=>{if(e.suspense){const t=a=>a==="static"?a:Math.max(a??1e3,1e3),n=e.staleTime;e.staleTime=typeof n=="function"?(...a)=>t(n(...a)):t(n),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},wB=(e,t)=>e.isLoading&&e.isFetching&&!t,xB=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,J0=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function kB(e,t,n){var d,m,f,y,g;const a=cB(),i=mB(),r=lB(),s=r.defaultQueryOptions(e);(m=(d=r.getDefaultOptions().queries)==null?void 0:d._experimental_beforeQuery)==null||m.call(d,s),s._optimisticResults=a?"isRestoring":"optimistic",yB(s),fB(s,i),pB(i);const l=!r.getQueryCache().get(s.queryHash),[u]=p.useState(()=>new t(r,s)),c=u.getOptimisticResult(s),h=!a&&e.subscribed!==!1;if(p.useSyncExternalStore(p.useCallback(x=>{const w=h?u.subscribe(Vt.batchCalls(x)):jn;return u.updateResult(),w},[u,h]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),p.useEffect(()=>{u.setOptions(s)},[s,u]),xB(s,c))throw J0(s,u,i);if(gB({result:c,errorResetBoundary:i,throwOnError:s.throwOnError,query:r.getQueryCache().get(s.queryHash),suspense:s.suspense}))throw c.error;if((y=(f=r.getDefaultOptions().queries)==null?void 0:f._experimental_afterQuery)==null||y.call(f,s,c),s.experimental_prefetchInRender&&!Ts&&wB(c,a)){const x=l?J0(s,u,i):(g=r.getQueryCache().get(s.queryHash))==null?void 0:g.promise;x==null||x.catch(jn).finally(()=>{u.updateResult()})}return s.notifyOnChangeProps?c:u.trackResult(c)}function bl(e,t){return kB(e,rB)}/** 517 * @remix-run/router v1.23.0 518 * 519 * Copyright (c) Remix Software Inc. 520 * 521 * This source code is licensed under the MIT license found in the 522 * LICENSE.md file in the root directory of this source tree. 523 * 524 * @license MIT 525 */function nc(){return nc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},nc.apply(this,arguments)}var dr;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(dr||(dr={}));const Q0="popstate";function vB(e){e===void 0&&(e={});function t(a,i){let{pathname:r,search:s,hash:l}=a.location;return Ly("",{pathname:r,search:s,hash:l},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function n(a,i){return typeof i=="string"?i:nm(i)}return jB(t,n,null,e)}function _t(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function bT(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function bB(){return Math.random().toString(36).substr(2,8)}function X0(e,t){return{usr:e.state,key:e.key,idx:t}}function Ly(e,t,n,a){return n===void 0&&(n=null),nc({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?jl(t):t,{state:n,key:t&&t.key||a||bB()})}function nm(e){let{pathname:t="/",search:n="",hash:a=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),a&&a!=="#"&&(t+=a.charAt(0)==="#"?a:"#"+a),t}function jl(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let a=e.indexOf("?");a>=0&&(t.search=e.substr(a),e=e.substr(0,a)),e&&(t.pathname=e)}return t}function jB(e,t,n,a){a===void 0&&(a={});let{window:i=document.defaultView,v5Compat:r=!1}=a,s=i.history,l=dr.Pop,u=null,c=h();c==null&&(c=0,s.replaceState(nc({},s.state,{idx:c}),""));function h(){return(s.state||{idx:null}).idx}function d(){l=dr.Pop;let x=h(),w=x==null?null:x-c;c=x,u&&u({action:l,location:g.location,delta:w})}function m(x,w){l=dr.Push;let v=Ly(g.location,x,w);c=h()+1;let k=X0(v,c),j=g.createHref(v);try{s.pushState(k,"",j)}catch(S){if(S instanceof DOMException&&S.name==="DataCloneError")throw S;i.location.assign(j)}r&&u&&u({action:l,location:g.location,delta:1})}function f(x,w){l=dr.Replace;let v=Ly(g.location,x,w);c=h();let k=X0(v,c),j=g.createHref(v);s.replaceState(k,"",j),r&&u&&u({action:l,location:g.location,delta:0})}function y(x){let w=i.location.origin!=="null"?i.location.origin:i.location.href,v=typeof x=="str
525ing"?x:nm(x);return v=v.replace(/ $/,"%20"),_t(w,"No window.location.(origin|href) available to create URL for href: "+v),new URL(v,w)}let g={get action(){return l},get location(){return e(i,s)},listen(x){if(u)throw new Error("A history only accepts one active listener");return i.addEventListener(Q0,d),u=x,()=>{i.removeEventListener(Q0,d),u=null}},createHref(x){return t(i,x)},createURL:y,encodeLocation(x){let w=y(x);return{pathname:w.pathname,search:w.search,hash:w.hash}},push:m,replace:f,go(x){return s.go(x)}};return g}var Z0;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Z0||(Z0={}));function _B(e,t,n){return n===void 0&&(n="/"),SB(e,t,n,!1)}function SB(e,t,n,a){let i=typeof t=="string"?jl(t):t,r=kk(i.pathname||"/",n);if(r==null)return null;let s=jT(e);NB(s);let l=null;for(let u=0;l==null&&u<s.length;++u){let c=DB(r);l=OB(s[u],c,a)}return l}function jT(e,t,n,a){t===void 0&&(t=[]),n===void 0&&(n=[]),a===void 0&&(a="");let i=(r,s,l)=>{let u={relativePath:l===void 0?r.path||"":l,caseSensitive:r.caseSensitive===!0,childrenIndex:s,route:r};u.relativePath.startsWith("/")&&(_t(u.relativePath.startsWith(a),'Absolute route path "'+u.relativePath+'" nested under path '+('"'+a+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),u.relativePath=u.relativePath.slice(a.length));let c=_r([a,u.relativePath]),h=n.concat(u);r.children&&r.children.length>0&&(_t(r.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),jT(r.children,t,h,c)),!(r.path==null&&!r.index)&&t.push({path:c,score:RB(c,r.index),routesMeta:h})};return e.forEach((r,s)=>{var l;if(r.path===""||!((l=r.path)!=null&&l.includes("?")))i(r,s);else for(let u of _T(r.path))i(r,s,u)}),t}function _T(e){let t=e.split("/");if(t.length===0)return[];let[n,...a]=t,i=n.endsWith("?"),r=n.replace(/\?$/,"");if(a.length===0)return i?[r,""]:[r];let s=_T(a.join("/")),l=[];return l.push(...s.map(u=>u===""?r:[r,u].join("/"))),i&&l.push(...s),l.map(u=>e.startsWith("/")&&u===""?"/":u)}function NB(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:IB(t.routesMeta.map(a=>a.childrenIndex),n.routesMeta.map(a=>a.childrenIndex)))}const CB=/^:[\w-]+$/,TB=3,EB=2,AB=1,PB=10,MB=-2,e1=e=>e==="*";function RB(e,t){let n=e.split("/"),a=n.length;return n.some(e1)&&(a+=MB),t&&(a+=EB),n.filter(i=>!e1(i)).reduce((i,r)=>i+(CB.test(r)?TB:r===""?AB:PB),a)}function IB(e,t){return e.length===t.length&&e.slice(0,-1).every((a,i)=>a===t[i])?e[e.length-1]-t[t.length-1]:0}function OB(e,t,n){let{routesMeta:a}=e,i={},r="/",s=[];for(let l=0;l<a.length;++l){let u=a[l],c=l===a.length-1,h=r==="/"?t:t.slice(r.length)||"/",d=t1({path:u.relativePath,caseSensitive:u.caseSensitive,end:c},h),m=u.route;if(!d&&c&&n&&!a[a.length-1].route.index&&(d=t1({path:u.relativePath,caseSensitive:u.caseSensitive,end:!1},h)),!d)return null;
vendor: 6,917 bytes, lines 525-534
525Object.assign(i,d.params),s.push({params:i,pathname:_r([r,d.pathname]),pathnameBase:KB(_r([r,d.pathnameBase])),route:m}),d.pathnameBase!=="/"&&(r=_r([r,d.pathnameBase]))}return s}function t1(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,a]=LB(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let r=i[0],s=r.replace(/(.)\/+$/,"$1"),l=i.slice(1);return{params:a.reduce((c,h,d)=>{let{paramName:m,isOptional:f}=h;if(m==="*"){let g=l[d]||"";s=r.slice(0,r.length-g.length).replace(/(.)\/+$/,"$1")}const y=l[d];return f&&!y?c[m]=void 0:c[m]=(y||"").replace(/%2F/g,"/"),c},{}),pathname:r,pathnameBase:s,pattern:e}}function LB(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),bT(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let a=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(s,l,u)=>(a.push({paramName:l,isOptional:u!=null}),u?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(a.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),a]}function DB(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return bT(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function kk(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,a=e.charAt(n);return a&&a!=="/"?null:e.slice(n)||"/"}function zB(e,t){t===void 0&&(t="/");let{pathname:n,search:a="",hash:i=""}=typeof e=="string"?jl(e):e;return{pathname:n?n.startsWith("/")?n:FB(n,t):t,search:$B(a),hash:UB(i)}}function FB(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function jp(e,t,n,a){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(a)+"]. 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 BB(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function vk(e,t){let n=BB(e);return t?n.map((a,i)=>i===n.length-1?a.pathname:a.pathnameBase):n.map(a=>a.pathnameBase)}function bk(e,t,n,a){a===void 0&&(a=!1);let i;typeof e=="string"?i=jl(e):(i=nc({},e),_t(!i.pathname||!i.pathname.includes("?"),jp("?","pathname","search",i)),_t(!i.pathname||!i.pathname.includes("#"),jp("#","pathname","hash",i)),_t(!i.search||!i.search.includes("#"),jp("#","search","hash",i)));let r=e===""||i.pathname==="",s=r?"/":i.pathname,l;if(s==null)l=n;else{let d=t.length-1;if(!a&&s.startsWith("..")){let m=s.split("/");for(;m[0]==="..";)m.shift(),d-=1;i.pathname=m.join("/")}l=d>=0?t[d]:"/"}let u=zB(i,l),c=s&&s!=="/"&&s.endsWith("/"),h=(r||s===".")&&n.endsWith("/");return!u.pathname.endsWith("/")&&(c||h)&&(u.pathname+="/"),u}const _r=e=>e.join("/").replace(/\/\/+/g,"/"),KB=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),$B=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,UB=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function VB(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const ST=["post","put","patch","delete"];new Set(ST);const HB=["get",...ST];new Set(HB);/** 526 * React Router v6.30.1 527 * 528 * Copyright (c) Remix Software Inc. 529 * 530 * This source code is licensed under the MIT license found in the 531 * LICENSE.md file in the root directory of this source tree. 532 * 533 * @license MIT 534 */function ac(){return ac=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},ac.apply(this,arguments)}const jk=p.createContext(null),WB=p.createContext(null),Ir=p.createContext(null),of=p.createContext(null),Ii=p.createContext({outlet:null,matches:[],isDataRoute:!1}),NT=p.createContext(null);function qB(e,t){let{relative:n}=t===void 0?{}:t;_l()||_t(!1);let{basename:a,navigator:i}=p.useContext(Ir),{hash:r,pathname:s,search:l}=TT(e,{relative:n}),u=s;return a!=="/"&&(u=s==="/"?a:_r([a,s])),i.createHref({pathname:u,search:l,hash:r})}function _l(){return p.useContext(of)!=null}function Or(){return _l()||_t(!1),p.useContext(of).location}function CT(e){p.useContext(Ir).static||p.useLayoutEffect(e)}function Mn(){let{isDataRoute:e}=p.useContext(Ii);return e?oK():GB()}function GB(){_l()||_t(!1);let e=p.useContext(jk),{basename:t,future:n,navigator:a}=p.useContext(Ir),{matches:i}=p.useContext(Ii),{pathname:r}=Or(),s=JSON.stringify(vk(i,n.v7_relativeSplatPath)),l=p.useRef(!1);return CT(()=>{l.current=!0}),p.useCallback(function(c,h){if(h===void 0&&(h={}),!l.current)return;if(typeof c=="number"){a.go(c);return}let d=bk(c,JSON.parse(s),r,h.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:_r([t,d.pathname])),(h.replace?a.replace:a.push)(d,h.state,h)},[t,a,s,r,e])}function YB(){let{matches:e}=p.useContext(Ii),t=e[e.length-1];return t?t.params:{}}function TT(e,t){let{relative:n}=t===void 0?{}:t,{future:a}=p.useContext(Ir),{matches:i}=p.useContext(Ii),{pathname:r}=Or(),s=JSON.stringify(vk(i,a.v7_relativeSplatPath));return p.useMemo(()=>bk(e,JSON.parse(s),r,n==="path"),[e,s,r,n])}function JB(e,t){return QB(e,t)}function QB(e,t,n,a){_l()||_t(!1);let{navigator:i}=p.useContext(Ir),{matches:r}=p.useContext(Ii),s=r[r.length-1],l=s?s.params:{};s&&s.pathname;let u=s?s.pathnameBase:"/";s&&s.route;let c=Or(),h;if(t){var d;let x=typeof t=="string"?jl(t):t;u==="/"||(d=x.pathname)!=null&&d.startsWith(u)||_t(!1),h=x}else h=c;let m=h.pathname||"/",f=m;if(u!=="/"){let x=u.replace(/^\//,"").split("/");f="/"+m.replace(/^\//,"").split("/").slice(x.length).join("/")}let y=_B(e,{pathname:f}),g=nK(y&&y.map(x=>Object.assign({},x,{params:Object.assign({},l,x.params),pathname:_r([u,i.encodeLocation?i.encodeLocation(x.pathname).pathname:x.pathname]),pathnameBase:x.pathnameBase==="/"?u:_r([u,i.encodeLocation?i.encodeLocation(x.pathnameBase).pathname:x.pathnameBase])})),r,n,a);return t&&g?p.createElement(of.Provider,{value:{location:ac({pathname:"/",search:"",hash:"",state:null,key:"default"},h),navigationType:dr.Pop}},g):g}function XB(){let e=sK(),t=VB(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return p.createElement(p.Fragment,null,p.createElement("h2",null,"Unexpected Application
534Error!"),p.createElement("h3",{style:{fontStyle:"italic"}},t),n?p.createElement("pre",{style:i},n):null,null)}const ZB=p.createElement(XB,null);class eK extends p.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,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?p.createElement(Ii.Provider,{value:this.props.routeContext},p.createElement(NT.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function tK(e){let{routeContext:t,match:n,children:a}=e,i=p.useContext(jk);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),p.createElement(Ii.Provider,{value:t},a)}function nK(e,t,n,a){var i;if(t===void 0&&(t=[]),n===void 0&&(n=null),a===void 0&&(a=null),e==null){var r;if(!n)return null;if(n.errors)e=n.matches;else if((r=a)!=null&&r.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let s=e,l=(i=n)==null?void 0:i.errors;if(l!=null){let h=s.findIndex(d=>d.route.id&&(l==null?void 0:l[d.route.id])!==void 0);h>=0||_t(!1),s=s.slice(0,Math.min(s.length,h+1))}let u=!1,c=-1;if(n&&a&&a.v7_partialHydration)for(let h=0;h<s.length;h++){let d=s[h];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(c=h),d.route.id){let{loaderData:m,errors:f}=n,y=d.route.loader&&m[d.route.id]===void 0&&(!f||f[d.route.id]===void 0);if(d.route.lazy||y){u=!0,c>=0?s=s.slice(0,c+1):s=[s[0]];break}}}return s.reduceRight((h,d,m)=>{let f,y=!1,g=null,x=null;n&&(f=l&&d.route.id?l[d.route.id]:void 0,g=d.route.errorElement||ZB,u&&(c<0&&m===0?(y=!0,x=null):c===m&&(y=!0,x=d.route.hydrateFallbackElement||null)));let w=t.concat(s.slice(0,m+1)),v=()=>{let k;return f?k=g:y?k=x:d.route.Component?k=p.createElement(d.route.Component,null):d.route.element?k=d.route.element:k=h,p.createElement(tK,{match:d,routeContext:{outlet:h,matches:w,isDataRoute:n!=null},children:k})};return n&&(d.route.ErrorBoundary||d.route.errorElement||m===0)?p.createElement(eK,{location:n.location,revalidation:n.revalidation,component:g,error:f,children:v(),routeContext:{outlet:null,matches:w,isDataRoute:!0}}):v()},null)}var ET=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(ET||{}),am=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(am||{});function aK(e){let t=p.useContext(jk);return t||_t(!1),t}function iK(e){let t=p.useContext(WB);return t||_t(!1),t}function rK(e){let t=p.useContext(Ii);return t||_t(!1),t}function AT(e){let t=rK(),n=t.matches[t.matches.length-1];return n.route.id||_t(!1),n.route.id}function sK(){var e;let t=p.useContext(NT),n=iK(am.UseRouteError),a=AT(am.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[a]}function oK(){let{router:e}=aK(ET.UseNavigateStable),t=AT(am.UseNavigateStable),n=p.useRef(!1);return CT(()=>{n.current=!0}),p.useCallback(function(i,r){r===void 0&&(r={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,ac({fromRouteId:t},r)))},[e,t])}function lK(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function PT(e){let{to:t,replace:n,state:a,relative:i}=e;_l()||_t(!1);let{future:r,static:s}=p.useContext(Ir),{matches:l}=p.useContext(Ii),{pathname:u}=Or(),c=Mn(),h=bk(t,vk(l,r.v7_relativeSplatPath),u,i==="path"),d=JSON.stringify(h);return p.useEffect(()=>c(JSON.parse(d),{replace:n,state:a,relative:i}),[c,d,i,n,a]),null}function ut(e){_t(!1)}function uK(e){let{basename:t="/",children:n=null,location:a,navigationType:i=dr.Pop,navigator:r,static:s=!1,future:l}=e;_l()&&_t(!1);let u=t.replace(/^\/*/,"/"),c=p.useMemo(()=>({basename:u,navigator:r,static:s,future:ac({v7_relativeSplatPath:!1},l)}),[u,l,r,s]);
534typeof a=="string"&&(a=jl(a));let{pathname:h="/",search:d="",hash:m="",state:f=null,key:y="default"}=a,g=p.useMemo(()=>{let x=kk(h,u);return x==null?null:{location:{pathname:x,search:d,hash:m,state:f,key:y},navigationType:i}},[u,h,d,m,f,y,i]);return g==null?null:p.createElement(Ir.Provider,{value:c},p.createElement(of.Provider,{children:n,value:g}))}function cK(e){let{children:t,location:n}=e;return JB(Dy(t),n)}new Promise(()=>{});function Dy(e,t){t===void 0&&(t=[]);let n=[];return p.Children.forEach(e,(a,i)=>{if(!p.isValidElement(a))return;let r=[...t,i];if(a.type===p.Fragment){n.push.apply(n,Dy(a.props.children,r));return}a.type!==ut&&_t(!1),!a.props.index||!a.props.children||_t(!1);let s={id:a.props.id||r.join("-"),caseSensitive:a.props.caseSensitive,element:a.props.element,Component:a.props.Component,index:a.props.index,path:a.props.path,loader:a.props.loader,action:a.props.action,errorElement:a.props.errorElement,ErrorBoundary:a.props.ErrorBoundary,hasErrorBoundary:a.props.ErrorBoundary!=null||a.props.errorElement!=null,shouldRevalidate:a.props.shouldRevalidate,handle:a.props.handle,lazy:a.props.lazy};a.props.children&&(s.children=Dy(a.props.children,r)),n.push(s)}),n}/** 535 * React Router DOM v6.30.1 536 * 537 * Copyright (c) Remix Software Inc. 538 * 539 * This source code is licensed under the MIT license found in the 540 * LICENSE.md file in the root directory of this source tree. 541 * 542 * @license MIT 543 */function zy(){return zy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},zy.apply(this,arguments)}function dK(e,t){if(e==null)return{};var n={},a=Object.keys(e),i,r;for(r=0;r<a.length;r++)i=a[r],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function hK(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function mK(e,t){return e.button===0&&(!t||t==="_self")&&!hK(e)}function Fy(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let a=e[n];return t.concat(Array.isArray(a)?a.map(i=>[n,i]):[[n,a]])},[]))}function fK(e,t){let n=Fy(e);return t&&t.forEach((a,i)=>{n.has(i)||t.getAll(i).forEach(r=>{n.append(i,r)})}),n}const pK=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],gK="6";try{window.__reactRouterVersion=gK}catch{}const yK="startTransition",n1=tx[yK];function wK(e){let{basename:t,children:n,future:a,window:i}=e,r=p.useRef();r.current==null&&(r.current=vB({window:i,v5Compat:!0}));let s=r.current,[l,u]=p.useState({action:s.action,location:s.location}),{v7_startTransition:c}=a||{},h=p.useCallback(d=>{c&&n1?n1(()=>u(d)):u(d)},[u,c]);return p.useLayoutEffect(()=>s.listen(h),[s,h]),p.useEffect(()=>lK(a),[a]),p.createElement(uK,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:s,future:a})}const xK=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",kK=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ue=p.forwardRef(function(t,n){let{onClick:a,relative:i,reloadDocument:r,replace:s,state:l,target:u,to:c,preventScrollReset:h,viewTransition:d}=t,m=dK(t,pK),{basename:f}=p.useContext(Ir),y,g=!1;if(typeof c=="string"&&kK.test(c)&&(y=c,xK))try{let k=new URL(window.location.href),j=c.startsWith("//")?new URL(k.protocol+c):new URL(c),S=kk(j.pathname,f);j.origin===k.origin&&S!=null?c=S+j.search+j.hash:g=!0}catch{}let x=qB(c,{relative:i}),w=vK(c,{replace:s,state:l,target:u,preventScrollReset:h,relative:i,viewTransition:d});function v(k){a&&a(k),k.defaultPrevented||w(k)}return p.createElement("a",zy({},m,{href:y||x,onClick:g||r?a:v,ref:n,target:u}))});var a1;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(a1||(a1={}));var i1;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(i1||(i1={}));function vK(e,t){let{target:n,replace:a,state:i,preventScrollReset:r,relative:s,viewTransition:l}=t===void 0?{}:t,u=Mn(),c=Or(),h=TT(e,{relative:s});return p.useCallback(d=>
543{if(mK(d,n)){d.preventDefault();let m=a!==void 0?a:nm(c)===nm(h);u(e,{replace:m,state:i,preventScrollReset:r,relative:s,viewTransition:l})}},[c,u,h,a,i,n,e,r,s,l])}function bK(e){let t=p.useRef(Fy(e)),n=p.useRef(!1),a=Or(),i=p.useMemo(()=>fK(a.search,n.current?null:t.current),[a.search]),r=Mn(),s=p.useCallback((l,u)=>{const c=Fy(typeof l=="function"?l(i):l);n.current=!0,r("?"+c,u)},[r,i]);return[i,s]}const jK={"AI Summary":{en:"AI Summary",sw:"Muhtasari wa AI",ki:"Ũhoro Mũnene wa AI",luo:"Ti Kaka AI Opuoyo",kal:"Resiniekab AI",kam:"Ũsumarĩsyo wa AI"},"AI confidence:":{en:"AI confidence:",sw:"Uhakika wa AI:",ki:"Wĩtĩkio wa AI:",luo:"Genoga mar AI:",kal:"Ng'omnatetab AI:",kam:"Wĩkwatyo wa AI:"},"AI generation triggered (mock)":{en:"AI generation triggered (mock)",sw:"Utengenezaji wa AI umeanzishwa (jaribio)",ki:"AI nĩ yambĩrĩirie kũruta wĩra (ũcokei)",luo:"AI oketi konyago (ochiwore)",kal:"AI koistoet (kilenjin)",kam:"Mwathanĩre wa AI ũtanĩiw'e (kĩelelezo)"},"AI summary not yet generated.":{en:"AI summary not yet generated.",sw:"Muhtasari wa AI bado haujatengenezwa.",ki:"Ũhoro mũnene wa AI ũtanarutwo.",luo:"Ti Kaka AI Opuoyo pok opuok.",kal:"Resiniekab AI koipate kiresiniek.",kam:"Ũsumarĩsyo wa AI ndwatanatethwa."},"About CLICK":{en:"About CLICK",sw:"Kuhusu CLICK",ki:"Rĩgiĩ CLICK",luo:"Ewi CLICK",kal:"Eun CLICK",kam:"ĩũlũ wa CLICK"},"Access Denied":{en:"Access Denied",sw:"Ufikiaji Umekataliwa",ki:"Kũingĩra Kwahingĩtwo",luo:"Oketo ogeng'",kal:"Konet agebechi",kam:"Kũlika Kũianĩw'e"},"Access Restricted":{en:"Access Restricted",sw:"Ufikiaji Umezuiwa",ki:"Kũingĩra Kwahingĩtwo",luo:"Oketo ogeng' kanyo",kal:"Konet agebechi",kam:"Kũlika Kũsiĩĩw'a"},Act:{en:"Act",sw:"Chukua Hatua",ki:"Ũtungata",luo:"Timo",kal:"Tua",kam:"Keka Meko"},"Admin Access":{en:"Admin Access",sw:"Ufikiaji wa Msimamizi",ki:"Admin Kũingĩra",luo:"Oketo mar Jalochi",kal:"Konetab Admin",kam:"Kũlika kwa Mũsimamisi"},"Admin Dashboard":{en:"Admin Dashboard",sw:"Dashibodi ya Msimamizi",ki:"Admin Dashboard",luo:"Admin Dashboard",kal:"Admin Dashboard",kam:"Kĩlĩla kĩa Mũsimamisi wa Kĩthyomo"},"All Counties":{en:"All Counties",sw:"Kaunti Zote",ki:"Mabũrũri Mothe",luo:"Sirikali Duto",kal:"Ngun'ng'a Koron",kam:"Nthĩ Syonthe"},All:{en:"All",sw:"Zote",ki:"Mothe",luo:"Duto",kal:"Koron",kam:"Syonthe"},"Already have an account?":{en:"Already have an account?",sw:"Tayari una akaunti?",ki:"Wĩ na akaunti?",luo:"Be en gi akaunt?",kal:"Koimwe isakai akaunti?",kam:"Wĩ na akaunti?"},Approve:{en:"Approve",sw:"Kubali",ki:"Kũmĩrĩria",luo:"Yie",kal:"Sich",kam:"Yĩtĩkya"},"Approved! User granted legal role.":{en:"Approved! User granted legal role.",sw:"Imeidhinishwa! Mtumiaji amepewa jukumu la kisheria.",ki:"Kwa kũmĩrĩrio! Mũndũ nĩ anagĩa na wĩra wa kĩhooto.",luo:"Oseyie! Jasanduk ochiw ne tich mar chik.",kal:"Kisich! Amut nekikoneti ng'alali.",kam:"Kwĩtĩkĩw'a! Mũsyaia wa kĩelelĩko nũnengwa kĩanda kya wĩa wa kĩteti."},"Ask a Lawyer":{en:"Ask a Lawyer",sw:"Uliza Wakili",ki:"Ũria Lawyer",luo:"Penj Jawuok",kal:"Amwai Jawuok",kam:"Kũkũla Wakili"},"Ask a Question":{en:"Ask a Question",sw:"Uliza Swali",ki:"Ũria Kĩũria",luo:"Penj Penjo",kal:"Amwai Wal",kam:"Kũkũla Ũkũlũ"},"Ask a focused question (pseudonymous option).":{en:"Ask a focused question (pseudonymous option).",sw:"Uliza swali mahususi (chaguo la utambulisho fiche).",ki:"Ũria kĩũria kĩrĩ kĩrĩra (gĩĩkĩro kĩa ũcũrane).",luo:"Penj penjo mar ng'ato kata agenga (chako madundo).",kal:"Amwai wal ng'wan ng'at (amwai amut).",kam:"Kũkũla ũkũlũ wa kũlikīla (kĩna kĩa ndyoo)."},"Ask about a bill, your rights...":{en:"Ask about a bill, your rights...",sw:"Uliza kuhusu muswada, haki zako...",ki:"Ũria rĩgiĩ bill, mĩgwĩrĩrĩro yaku...",luo:"Penj e wi osimb, ratiroi...",kal:"Amwai wal anyun kiy, kibendi...",kam:"Kũkũla ĩũlũ wa mĩthako, ngũũlũ syaku..."},"Attend public hearings":{en:"Attend public hearings",sw:"Hudhuria vikao vya umma",ki:"Haica mahĩnga ma kĩbũrũri",luo:"Chak bura mar ji",kal:"Choch ng'atutietab jamanut",kam:"Ethĩawa kw'a kũitĩka kũkwatanĩa kwa aĩkĩ kwo"},"Back to Guides":{en:"Back to Guides",sw:"Rudi kwa Miongozo",ki:"Cokera Mĩrongo",luo:"Dwog e Buge",kal:"Eung'uok tuguk",kam:"Ũcũle
543kĩla Ũkũlũ"},"Back to Intro":{en:"Back to Intro",sw:"Rudi kwenye Utangulizi",ki:"Cokera Kĩambĩrĩria",luo:"Dwog e Kwan",kal:"Uok konyit",kam:"Ũcũlĩla Ũtanĩki"},"Back to Login":{en:"Back to Login",sw:"Rudi Kuingia",ki:"Cokera Kũingĩa",luo:"Dwog e Oketo",kal:"Uok kosob",kam:"Ũcũlĩla Kũlika"},Back:{en:"Back",sw:"Rudi",ki:"Cokera",luo:"Dwog",kal:"Uok",kam:"Ũcũla"},"Before they decide, CLICK.":{en:"Before they decide, CLICK.",sw:"Kabla hawajaamua, CLICK.",ki:"Mbere matua itũmi, CLICK.",luo:"Ka pod gisetimo, CLICK.",kal:"Amu mising', CLICK.",kam:"Ĩvindanĩ ya kwĩsumĩka, CLICK."},"Before they decide,":{en:"Before they decide,",sw:"Kabla hawajaamua,",ki:"Mbere matua itũmi,",luo:"Ka pod gisetimo,",kal:"Amu mising',",kam:"Ĩvindanĩ ya kwĩsumĩka,"},"Being reviewed":{en:"Being reviewed",sw:"Inakaguliwa",ki:"Gũkũrũkia",luo:"Intimo nonro",kal:"Koekatet",kam:"Kwoneka"},Bill:{en:"Bill",sw:"Mswada",ki:"Bill",luo:"Osomb",kal:"Kiy",kam:"Mũthako"},"Bills & Amendments":{en:"Bills & Amendments",sw:"Miswada na Marekebisho",ki:"Bills & Igwetũrūkīro",luo:"Osimbe & Tiend Buga",kal:"Kiyo & Kiu
543ng'",kam:"MÄ©thako na KÅ©kyululwa"},Bills:{en:"Bills",sw:"Miswada",ki:"Bills",luo:"Osimbe",kal:"Kiyo",kam:"MÄ©thako"},"Browse all bills and acts":{en:"Browse all bills and acts",sw:"Vinjari miswada na sheria zote",ki:"Rora bills na itÅ©mi ciothe",luo:"Non mondo inyal neno osimb duto",kal:"Nen kiyo aror na tich korob",kam:"Enda mÄ©thako na mĩĩko yonthe"},"Browse as guest":{en:"Browse as guest",sw:"Vinjari bila kujiandikisha",ki:"Rora ta mÅ©geni",luo:"Non kaka ng'ato ma ok oing'ore",kal:"Nen kiroba",kam:"Enda ta mÅ©enyi"},"Budget Policy Statements and other budget documents.":{en:"Budget Policy Statements and other budget documents.",sw:"Taarifa za Sera ya Bajeti na nyaraka nyingine za bajeti.",ki:"MÄ©hothi ya MÄ©tikio ya Bajeti na ciÄ©gÄ©ka ingÄ© cia bajeti.",luo:"Mondo opan kaka bajet otimne to gi buge mamoko mag bajet.",kal:"Tugukab budget agegei, ak tugukab budget agege.",kam:"ĨvukÅ© ya kÄ©tindo kya mboka na mavukÅ© angÄ© ma mboka."},"Budget Proposals":{en:"Budget Proposals",sw:"Mapendekezo ya Bajeti",ki:"Mihothi ya Bajeti",luo:"Mich mag Bajeti",kal:"Amuan budget",kam:"Mboka NthÄ©nÄ©"},Budget:{en:"Budget",sw:"Bajeti",ki:"Bajeti",luo:"Bajet",kal:"Budget",kam:"Mboka"},"By Stage":{en:"By Stage",sw:"Kwa Hatua",ki:"Kwa Ngerekano",luo:"Kod Bach",kal:"Koreb kot",kam:"NÄ© Ng'ina"},"CIVIC LITERACY & INFORMATION FOR CIVIC KNOWLEDGE":{en:"CIVIC LITERACY & INFORMATION FOR CIVIC KNOWLEDGE",sw:"UJUZI WA KIRAIA NA TAARIFA KWA MAARIFA YA KIRAIA",ki:"Ũhoro wa kÅ©manya mawÄ©ra ma bÅ©rÅ©ri na Å©horo wa waminyeti wa bÅ©rÅ©ri",luo:"Konyiso ne ji kaka gibiro timo tich margi e piny, gi ranyisi e wi piny ma gibiro tiye.",kal:"Ng'omnatetab mureno ak tianjetab mureno.",kam:"Kũĩsya Kwa Ũthwĩĩka na Ũvethi wa Ũthwĩĩka Kwoo"},Cancel:{en:"Cancel",sw:"Ghairi",ki:"HingÄ©ra",luo:"Jwang'",kal:"Ach",kam:"Ndamba"},"Chat with Haki":{en:"Chat with Haki",sw:"Ongea na Haki",ki:"ArÄ©rÄ©ria na Haki",luo:"Wuo gi Haki",kal:"Amwai Haki",kam:"Ĩkya ŨtanÄ©a na Haki"},"Check your email for a reset link":{en:"Check your email for a reset link",sw:"Angalia barua pepe yako kwa kiungo cha kuweka upya",ki:"Rora email yaku nÄ©gÅ©korwo Ä©rÄ© na link ya gÅ©cokia",luo:"Non barua-dhahabu mari e gi link mar ng'adho",kal:"Nen e-mail inyoo kosiwuni link",kam:"Ĩsya email yaku kw'o kÄ©siÄ©ndĩĩ kya kÅ©kyÅ©la"},"Check your email to verify your account":{en:"Check your email to verify your account",sw:"Angalia barua pepe yako ili kuthibitisha akaunti yako",ki:"Angalia email yaku niguo uhingie account yaku",luo:"Kwano email mari mondo omi thuolo mar tiyo gi account mari",kal:"Ng'e email-uni si konyi kanyo komong'ung' ",kam:"Angalia email yaku nima iveti account yaku"},"Choose your role to personalize your experience.":{en:"Choose your role to personalize your experience.",sw:"Chagua jukumu lako ili kubinafsisha uzoefu wako.",ki:"Arthurana itua riaku niguo uhote kugeria maudu ta uria uraunda",luo:"Yier migawo mari mondo ikonyi kanyo machuok",kal:"Yekti ng'atuni so kibagei konyosiek che ng'ete kei",kam:"Thaata usyao waku wika uendaoona na mawendi maku"},Citizen:{en:"Citizen",sw:"Mwananchi",ki:"Mwananchi",luo:"Ja-piny",kal:"Mwananchi",kam:"Mutu wa taa"},City:{en:"City",sw:"Mji",ki:"MÅ©cii",luo:"Dala",kal:"Eno",kam:"Veseti"},"Civic Source Ingestion":{en:"Civic Source Ingestion",sw:"Uingizaji wa Vyanzo vya Kiraia",ki:"KÅ©ingia kwa mÄ©thigo ya Å©teti",luo:"Minyo mar gikanyua magi ranyisi margi",kal:"Ingesia ne magi betich",kam:"Weti wa mÄ©singo ye Å©kumbi"},Claimed:{en:"Claimed",sw:"Imechukuliwa",ki:"IhuthÃre",luo:"Ochwanyore",kal:"Ochwany",kam:"Ni ivetiwe"},"Common Mwananchi":{en:"Common Mwananchi",sw:"Mwananchi wa kawaida",ki:"MÅ©thÄ©gia Å©gÄ©",luo:"Mwananchi ma kodi",kal:"Mwananchi",kam:"Mutu wa ndina"}
543,"Confirm password":{en:"Confirm password",sw:"Thibitisha nenosiri",ki:"Hethia password",luo:"Heng'ore paswedi mari",kal:"Heng'orie paswodi neng'u",kam:"Tetha paswoti"},"Connect with coalitions and civic groups.":{en:"Connect with coalitions and civic groups.",sw:"Ungana na muungano na vikundi vya kiraia.",ki:"Hunda githama na thama na rwaro rwa wendani",luo:"Yotore gi ji modho mare kendo gi jolokore",kal:"Hunda githama ne jo ma wendani",kam:"Itina na mikundwa na mikundwa ya utati"},"Constitution of Kenya":{en:"Constitution of Kenya",sw:"Katiba ya Kenya",ki:"Nguvu ya Kenya",luo:"Bunge ya Kenya",kal:"Ketani rwet ne Kenya",kam:"Katiba ya Kenya"},"Contact & Support":{en:"Contact & Support",sw:"Mawasiliano na Usaidizi",ki:"Angalia na kũhata",luo:"Kwero kendo konyo",kal:"Kweso konyo",kam:"Kuona na kũnya"},"Contact (optional)":{en:"Contact (optional)",sw:"Mawasiliano (si lazima)",ki:"Angalia (si ya lazima)",luo:"Kwero (ok en tiyo)",kal:"Kwero (ok tiyo)",kam:"Kuona (si ya lazima)"},"Contact legislators before the final vote.":{en:"Contact legislators before the final vote.",sw:"Wasiliana na wabunge kabla ya kura ya mwisho.",ki:"Thama na mbunge ni niundu wa kura iria cia mwao",luo:"Kwano gi jo-bunge kapok giyeto motimo",kal:"Kwano gi jo-bunge kapok giyeto motimo",kam:"Kuona na aendisi mwanya wa mutio"},County:{en:"County",sw:"Kaunti",ki:"County",luo:"County",kal:"County",kam:"County"},"Create a petition draft and request lawyer review.":{en:"Create a petition draft and request lawyer review.",sw:"Tengeneza rasimu ya ombi na uombe ukaguzi wa wakili.",ki:"Hithia wira wa petition na uririria abithae",luo:"Chak omboko ni mar kony kendo koro jolo jopur",kal:"Hithia omboko ni mar kony kendo koro jolo jopur",kam:"Chukia ivati na uelekelee abithi
543ndũũ kũwona"},"Describe the issue...":{en:"Describe the issue...",sw:"Eleza tatizo...",ki:"Hithia ũndũ ũrĩa ũkũhumbĩka...",luo:"Le jore gi dho-gi...",kal:"Le jo jore gi dho-gi...",kam:"Ika kũvũnga vaku kwa iye..."},"Describe your legal qualifications...":{en:"Describe your legal qualifications...",sw:"Eleza sifa zako za kisheria...",ki:"Hithia ũndũ waku wa kĩndũmbĩ...",luo:"Le jore gi dho-gi maro mar jopuonjre...",kal:"Le jore gi dho-gi maro mar jopuonjre...",kam:"Ika kũvũnga vaku kwa iye va kima..."},"Describe your question or grievance in detail...":{en:"Describe your question or grievance in detail...",sw:"Eleza swali lako au malalamiko kwa undani...",ki:"Hithia ũndũ waku ũrĩa ũkũhumbĩka na marĩa ũkũhumbĩka...",luo:"Le jore gi dho-gi maro mar dho-gi kendo mar jopuonjre...",kal:"Le jore gi dho-gi maro mar dho-gi kendo mar jopuonjre...",kam:"Ika kũvũnga vaku kwa iye va kima na vaku va ũteti..."},Description:{en:"Description",sw:"Maelezo",ki:"Hithia",luo:"Le-gi",kal:"Le-gi",kam:"Kũvũnga"},"Discuss the draft":{en:"Discuss the draft",sw:"Jadili rasimu",ki:"Hithia wira",luo:"Wacho gi gi wira",kal:"Wacho gi gi wira",kam:"Kũvũnga wira"},"Discuss with civic groups":{en:"Discuss with civic groups",sw:"Jadili na vikundi vya kiraia",ki:"Gathana na arutha a wendani",luo:"Wacho gi gi jo-moko",kal:"Wacho gi gi jo-moko",kam:"Kũvũnga na mikundwa ye ũkumbi"},Discuss:{en:"Discuss",sw:"Jadili",ki:"Gathana",luo:"Wacho",kal:"Wacho",kam:"Kũvũnga"},Discussion:{en:"Discussion",sw:"Mjadala",ki:"Gathana",luo:"Wacho",kal:"Wacho",kam:"Kũvũnga"},"Draft a formal memorandum for public participation.":{en:"Draft a formal memorandum for public participation.",sw:"Andaa memoranda rasmi kwa ushiriki wa umma.",ki:"Hithia wira wa gĩtho kĩa wendani",luo:"Chak omboko ni mar kony kendo koro jolo jopur",kal:"Chak omboko ni mar kony kendo koro jolo jopur",kam:"Chukia ivati na uelekelee abithi
543ndũũ kũwona"},"Educate others":{en:"Educate others",sw:"Elimisha wengine",ki:"Rĩthĩkia arutha",luo:"Puonj jomoko",kal:"Puonj jomoko",kam:"Kũmanyĩsya aingĩ"},Email:{en:"Email",sw:"Barua pepe",ki:"Email",luo:"Email",kal:"Email",kam:"Email"},"Enable notifications":{en:"Enable notifications",sw:"Wezesha arifa",ki:"Hithia mĩthigi",luo:"Heng'ore email",kal:"Heng'ore email",kam:"Kanyĩsya email"},Engage:{en:"Engage",sw:"Shiriki",ki:"Hithia",luo:"Heng'ore",kal:"Heng'ore",kam:"Kanyĩsya"},"Enter your email first":{en:"Enter your email first",sw:"Weka barua pepe yako kwanza",ki:"Hithia email yaku mbere",luo:"Chak email mari",kal:"Chak email mari",kam:"Kanyĩsya email yaku mbere"},"Enter your new password below.":{en:"Enter your new password below.",sw:"Weka nenosiri lako jipya hapa chini.",ki:"Hithia password yaku nĩĩ.",luo:"Chak paswedi mari opiyo",kal:"Chak paswedi mari opiyo",kam:"Kanyĩsya paswedi yaku nĩĩ."},Error:{en:"Error",sw:"Hitilafu",ki:"Ũhoro",luo:"Gi",kal:"Gi",kam:"Ũhoro"},"Event submitted for review":{en:"Event submitted for review",sw:"Tukio limewasilishwa kwa mapitio",ki:"Ũhoro ũrĩa ũrarĩthĩka na ũhoro ũrĩa ũrarĩthĩka",luo:"Gi koro ochwanyore",kal:"Gi koro ochwanyore",kam:"Ũhoro ũrĩa ũrarĩthĩka na ũhoro ũrĩa ũrarĩthĩka"},"Event submitted!":{en:"Event submitted!",sw:"Tukio limewasilishwa!",ki:"Ũhoro ũrĩa ũrĩthĩka!",luo:"Gi koro ochwanyore!",kal:"Gi koro ochwanyore!",kam:"Ũhoro ũrĩa ũrĩthĩka!"},"Event title or brief description...":{en:"Event title or brief description...",sw:"Jina la tukio au maelezo mafupi...",ki:"Ũhoro wa ũndũ ũrĩa ũkũhumbĩka...",luo:"Gi koro ochwanyore...",kal:"Gi koro ochwanyore...",kam:"Ũhoro wa ũndũ ũrĩa ũkũhumbĩka..."},"Event title":{en:"Event title",sw:"Kichwa cha tukio",ki:"Ũhoro wa ũndũ",luo:"Gi koro ochwanyore",kal:"Gi koro ochwanyore",kam:"Ũhoro wa ũndũ"},"Events & Actions":{en:"Events & Actions",sw:"Matukio na Vitendo",ki:"Ũhoro na mĩhĩkanĩro",luo:"Gi koro ochwanyore",kal:"Gi koro ochwanyore",kam:"Ũhoro na mĩhĩkanĩro"},"Events near you":{en:"Events near you",sw:"Matukio karibu nawe",ki:"Ũhoro ũrĩa ũrĩthĩka karĩ",luo:"Gi koro ochwanyore",kal:"Gi koro ochwanyore",kam:"Ũhoro ũrĩa ũrĩthĩka karĩ"},Events:{en:"Events",sw:"Matukio",ki:"Ũhoro",luo:"Gi",kal:"Gi",kam:"Ũhoro"},"Everything you need to know about using CLICK":{en:"Everything you need to know about using CLICK",sw:"Kila kitu unachohitaji kujua kuhusu kutumia CLICK",ki:"Kĩrĩkĩrĩkia kĩaũ kĩna ũrĩa ũrĩa ũrabata kũrĩthĩka na kĩa CLICK",luo:"Ang'o e gi duto manie yo nyaka ing'e kuom tiyo gi CLICK",kal:"Ang'o e gi duto manie yo nyaka ing'e kuom tiyo gi CLICK",kam:"Kyalo kyonthe kyoseena wĩthĩwa nako kũmanyĩwona na kũvũndũ CLICK"},"Excerpt Highlights":{en:"Excerpt Highlights",sw:"Dondoo Muhimu",ki:"Ũhoro ũrĩa ũrĩthĩka",luo:"Gi gi duto",kal:"Gi gi duto",kam:"Ũhoro ũrĩa ũrĩthĩka"},"Explore Bills":{en:"Explore Bills",sw:"Chunguza Miswada",ki:"Thuthuria Miswada",luo:"Kwano Miswadi",kal:"Konyor Miswada",kam:"Chunguza Miswada"},FAQ:{en:"FAQ",sw:"Maswali",ki:"Ciuria cia Nginya",luo:"Wang'e Penjo",kal:"Tulechi Ng'ulyot",kam:"Mawoni Maingi Methũkũmasya"},"Featured Bills":{en:"Featured Bills",sw:"Miswada Iliyoangaziwa",ki:"Miswada iria Ineimagirio",luo:"Miswadi Motenore",kal:"Miswada Chebo Miot",kam:"Miswada Ilaĩkĩthw'a"},Finish:{en:"Finish",sw:"Maliza",ki:"Thira",luo:"Tie",kal:"Tie",kam:"Ĩkya"},"Follow Categories":{en:"Follow Categories",sw:"Fuatilia Kategoria",ki:"Rũmĩrĩra Mĩthemba",luo:"Luoro Kategori",kal:"Lundo Kategoria",kam:"Lũmĩrĩra Kategori"},"Follow committee reports":{en:"Follow committee reports",sw:"Fuatilia ripoti za kamati",ki:"Rũmĩrĩra ripoti cia kamati",luo:"Luoro ripot mag komiti",kal:"Lundo ribotab komiti",kam:"Lũmĩrĩra malipoti ma kometi"},Follow:{en:"Follow",sw:"Fuatilia",ki:"Rũmĩrĩra",luo:"Luoro",kal:"Lundo",kam:"Lũmĩrĩra"},Following:{en:"Following",sw:"Inafuatiliwa",ki:"Kũrũmĩrĩra",luo:"Kuloro",kal:"Kulundo",kam:"Kũlũmĩlĩla"},"Forgot password?":{en:"Forgot password?",sw:"Umesahau nenosiri?",ki:"Nĩwĩrirwo password?",luo:"Nyingo mara? (Password)",kal:"Ko itenyi ng'ulyot?",kam:"Nĩwawĩĩwa nũũndi?"},Forum:{en:"Forum",sw:"Jukwaa",ki:"Mũcemanio",luo:"Kanyakla",kal:"Kanyakla",kam:"Kĩkundi kya Kũneena"},"Full name":{en:"Full name",sw:"Jina kamili",ki:"Rĩtwa rĩothe",luo:"Nyingo duto",kal:"Kukutab ng'oo",kam:"Mena yonthe"},Generate:{en:"Generate",sw:"Tengeneza",ki:"Cũũrania",luo:"Pieny",kal:"Itab",kam:"Ũtwanthye"},"Get Started":{en:"Get Started",sw:"Anza Sasa",ki:"Amba",luo:"Chak",kal:"Chaki",kam:"Tathooa Kwambĩĩa"},"Get answers to common legal questions":{en:"Get answers to common legal questions",sw:"Pata majibu ya maswali ya kisheria",ki:"Pata macokio ma ciuria cia kĩĩwatho iria nene",luo:"Kaw jibu mar pe
543njo mag chik motero ji mathoth",kal:"Kabit jibu nebo kasarta nebo chik anyiny",kam:"Mana maũndũ ma kĩsiĩsya maingĩ"},"Get help writing":{en:"Get help writing",sw:"Pata msaada wa kuandika",ki:"Pata ũteithio wa kwandīka",luo:"Kaw kony e ndiko",kal:"Kanyor konyyot ne ndiko",kam:"Mana ũndũ wa kwandĩka"},"Get legal help":{en:"Get legal help",sw:"Pata msaada wa kisheria",ki:"Pata ũteithio wa kĩĩwatho",luo:"Kaw kony mar chik",kal:"Kanyor konyyot ne chik",kam:"Mana ũndũ wa kĩsiĩsya"},"Get verified answers to common legal questions about bills and budgets.":{en:"Get verified answers to common legal questions about bills and budgets.",sw:"Pata majibu yaliyothibitishwa kwa maswali ya kawaida ya kisheria kuhusu miswada na bajeti.",ki:"Pata macokio magerekano ma ciũria cia kĩĩwatho iria nene igũrũ rĩa miswada na bajeti.",luo:"Kaw jibu mosetimre ni penjo mag chik motero miswadi kod bajet.",kal:"Kanyor jibu chebo kasarta chebo chik anyiny chebo miswada ak bajet.",kam:"Kwata mĩthaĩsyo ya makũlyo maĩkĩkĩthw'a vamwe na maũndũ ma mĩswaada na bajeti."},"Go to Dashboard":{en:"Go to Dashboard",sw:"Nenda Dashibodi",ki:"Thi Dashboard",luo:"Dhi e Dashboard",kal:"Lak Dashboard",kam:"Vatĩka Kwĩ Dashboard"},"Go to Home":{en:"Go to Home",sw:"Nenda Nyumbani",ki:"Thi Home",luo:"Dhi e Pacho",kal:"Lak Kamban",kam:"Vatĩka Kwĩ Nyũmba"},Guides:{en:"Guides",sw:"Miongozo",ki:"Ngerenwa",luo:"Ranyisi",kal:"Raniisyet",kam:"Mĩelele"},"Guides, contact, and report issues":{en:"Guides, contact, and report issues",sw:"Miongozo, mawasiliano, na ripoti matatizo",ki:"Ngerenwa, wĩkanye naitwe, na ũrĩpoti thĩna",luo:"Ranyisi, lam ka ikere keth",kal:"Raniisyek, lami, ak iwotyi thib",kam:"Mĩelele, twĩkiane, na ĩkya maũndũ ma thĩna"},Handled:{en:"Handled",sw:"Zilizoshughulikiwa",ki:"Nĩyamenyarĩirwo",luo:"Osetim",kal:"Otim",kam:"Nĩyakwata"},"Has summary:":{en:"Has summary:",sw:"Ina muhtasari:",ki:"ĩna ũhoro mũnini:",luo:"En gi sũmmeri:",kal:"En ki suman:",kam:"Yĩna kĩvuũlũlua:"},"Help & Support":{en:"Help & Support",sw:"Msaada na Usaidizi",ki:"Ũteithio na Ũtaarani",luo:"Kony kod Konyruok",kal:"Konyyot ak Konyyot",kam:"Ũteithyo na Ũmanyĩsyo"},"Help spread awareness about the new law.":{en:"Help spread awareness about the new law.",sw:"Saidia kueneza ufahamu kuhusu sheria mpya.",ki:"Teithia gũtheremia ũmenyo wa watho mwerũ",luo:"Kony many ji chik manyien",kal:"Kony many ji chik manyien",kam:"Teithya kũmumya ũmanyi wĩgiĩ mwĩu mweũ."},"Help your community understand the new law.":{en:"Help your community understand the new law.",sw:"Saidia jamii yako kuelewa sheria mpya.",ki:"Teithia andũ a itũũra rĩaku maataũkĩrwo watho mwerũ",luo:"Kony jowadu dhiet chik manyien",kal:"Kony jowadu dhiet chik manyien",kam:"Teithya andũ ma mũsyĩ waku maielewe mwĩu mweũ."},"Hold government accountable":{en:"Hold government accountable",sw:"Uwajibishe serikali",ki:"Hingiria thirikari ĩrĩĩtwo nĩ ciĩko ciayo",luo:"Kaw sirkal mondo odhi anyim",kal:"Kaw sirkal mondo odhi anyim",kam:"Ũsiw'e silika ndĩnaaĩaĩa"},"Host or join a community discussion event.":{en:"Host or join a community discussion event.",sw:"Andaa au jiunge na tukio la mjadala wa jamii.",ki:"Menyeria kana ũgĩe kĩũngano kĩa kũmemerera kĩa gĩthaka.",luo:"Tim kata lamo e kanyakla mar timo kwano",kal:"Tim kata lamo e kanyakla mar timo kwano",kam:"Ĩana kana ũnainie ũndũ wa kũyanzana na andu ma yĩndĩ."},"How It Works":{en:"How It Works",sw:"Jinsi Inavyofanya Kazi",ki:"Ũrĩa Ũrutaga Wira",luo:"Ndawuo oti",kal:"Ndawuo oti",kam:"Ũndũ Weya Ũthũkũma"},"How Public Participation Works":{en:"How Public Participation Works",sw:"Jinsi Ushiriki wa Umma Unavyofanya Kazi",ki:"Ũndũ Ũndũ wa Kũruta Ciĩko Inene Wĩruta",luo:"Ndawuo niti joma duto",kal:"Ndawuo niti joma duto",kam:"Ũndũ Kĩvathũkany'o kya Ũthũkũmi Kĩĩkwata"},"How to Use CLICK":{en:"How to Use CLICK",sw:"Jinsi ya Kutumia CLICK",ki:"Ũrĩa Ũngĩhũthĩra CLICK",luo:"Ndawuo to CLICK",kal:"Ndawuo to CLICK",kam:"Ũndũ wa Kũtũmĩa CLICK"},"I am a...":{en:"I am a...",sw:"Mimi ni...",ki:"Nĩ niĩ ndi...",luo:"An gi...",kal:"An gi...",kam:"No ninyie ndi..."},Inbox:{en:"Inbox",sw:"Kikasha",ki:"Iko ya Ndemwa",luo:"Kenyruok",kal:"Kenyuk",kam:"Kĩkanda kya Nthĩnzĩli"},Inform:{en:"Inform",sw:"Fahamu",ki:"Emenya",luo:"Nyis",kal:"Nyis",kam:"Ĩmanyĩsya"},"Ingest Sources":{en:"Ingest Sources",sw:"Ingiza Vyanzo",ki:"Ingiriria Mĩri",luo:"Chop rute",kal:"Chop rute",kam:"Andĩkĩthya Mbĩtĩkũ"},"Ingesting...":{en:"Ingesting...",sw:"Inaingiza...",ki:"Kũingiriria...",luo:"Kuchop...",kal:"Kuchop...",kam:"Kwambĩĩa kũandĩka..."},"Ingestion complete!":{en:"Ingestion complete!",sw:"Uingizaji umekamilika!",ki:"Kwĩingiriria nĩgĩĩkĩte!",luo:"Kichop otie!",kal:"Kichop otie!",kam:"Kwĩandĩka nĩkũelelie!"},Introduced:{en:"Introduced",sw:"Ilianzishwa",ki:"Nĩyaambĩrĩirio",luo:"Osetim",kal:"Osetim",kam:"Nĩyambĩĩiw'e"},"Invalid Link":{en:"Invalid Link",sw:"Kiungo Batili",ki:"Kiambĩrĩria Kĩtarĩ Kĩa Kĩĩmanyĩsyo",luo:"Lien maricho",kal:"Lien maricho",kam:"Ũla Ũtaĩkĩkĩthw'a"},"Item not found":{en:"Item not found",sw:"Kipengele hakijapatikana",ki:"Kiini gĩtirĩ gĩtukanĩkĩte",luo:"Gikop ok oyud",kal:"Gikop ok oyud",kam:"Ũndũ ndũkũkwatĩka"},Items:{en:"Items",sw:"Vipengele",ki:"Ciugo",luo:"Gikone",kal:"Kindo",kam:"Syĩndũ"}
543,"Join discussion":{en:"Join discussion",sw:"Jiunge na mjadala",ki:"Nyita mbaru mĩororo",luo:"Chakruok mar nono wach",kal:"Chak ng'atyot",kam:"Yĩkya ũneeni"},"Join support or opposition":{en:"Join support or opposition",sw:"Jiunge na kuunga au kupinga",ki:"Nyita mbaru kana ũregane",luo:"Chakruok mar gonyo kata kwedho",kal:"Chak ng'atyot agoi ma ng'atyit",kam:"Yĩkya mũuano kana ũkanani"},"Join the bill forum":{en:"Join the bill forum",sw:"Jiunge na jukwaa la mswada",ki:"Nyita mbaru kĩhee kĩa mĩswada",luo:"Chakruok mar chokruok mar rieko",kal:"Chak ng'atyot",kam:"Yĩkya kĩkundi kya mĩswada"},"Join the forum and share your thoughts.":{en:"Join the forum and share your thoughts.",sw:"Jiunge na jukwaa na ushiriki mawazo yako.",ki:"Nyita mbaru kĩheei na ũhũrie meciria maku.",luo:"Chakruok mar chokruok kendo konyore gi paro mari.",kal:"Chak ng'atyot ak konyech konyek.",kam:"Yĩkya kĩkundi na ũkĩhane maũndũ wĩsĩ."},"Join the forum to share perspectives.":{en:"Join the forum to share perspectives.",sw:"Jiunge na jukwaa kushiriki mitazamo.",ki:"Nyita mbaru kĩheei nĩguo ũhũrie maũgĩ.",luo:"Chakruok mar chokruok kendo konyore gi paro mari.",kal:"Chak ng'atyot ak konyech konyek.",kam:"Yĩkya kĩkundi wĩkĩhane mĩthao."},"Kenya Law Database":{en:"Kenya Law Database",sw:"Hifadhidata ya Sheria ya Kenya",ki:"Kĩheei kĩa watho wa Kenya",luo:"Keny mar chik Kenya",kal:"Kenya Law Database",kam:"Kenya Law Database"},"Key Obligations":{en:"Key Obligations",sw:"Wajibu Muhimu",ki:"Ciathĩ cia bata",luo:"Tich matindo",kal:"Tichik che kiptenge",kam:"Mĩao ya vata"},"Know your new rights":{en:"Know your new rights",sw:"Jua haki zako mpya",ki:"Ũmenye kĩhooto gĩaku kĩerũ",luo:"Ng'eche gi adiera mar kweru",kal:"Ng'etyech konyek",kam:"Manya ũtaũ waku mweũ"},"Lawyer / Advocate":{en:"Lawyer / Advocate",sw:"Wakili / Mtetezi",ki:"Wakili / Mũteteri",luo:"Wakit / Janyaka",kal:"Wakili / Ng'atyot",kam:"Wakili / Mũtavany'a"},"Lawyer Response":{en:"Lawyer Response",sw:"Jibu la Wakili",ki:"Ũgaagĩa wa wakili",luo:"Duoko mar wakit",kal:"Wakili anan kalyet",kam:"Ũsũngĩ wa Wũkĩli"},"Legal Dashboard":{en:"Legal Dashboard",sw:"Dashibodi ya Kisheria",ki:"Dashibodi ya kĩwatho",luo:"Dashibodi mar chik",kal:"Dashibodi mar konyek",kam:"Dashibodi ya Mĩao"},"Legal Professional Dashboard":{en:"Legal Professional Dashboard",sw:"Dashibodi ya Mtaalamu wa Sheria",ki:"Dashibodi ya Mtaalamu wa Sheria",luo:"Dashibodi mar jachik",kal:"Dashibodi mar konyek",kam:"Dashibodi ya Mũmanyĩki wa Mĩao"},"Legal Professional Verification":{en:"Legal Professional Verification",sw:"Uthibitishaji wa Mtaalamu wa Sheria",ki:"Kĩmenyithia kĩa Mtaalamu wa Sheria",luo:"Konyruok mar jachik",kal:"Konyech mar konyek",kam:"Kũthũkũma kwa Mũmanyĩki wa Mĩao"},"Legal Professional":{en:"Legal Professional",sw:"Mtaalamu wa Sheria",ki:"Mtaalamu wa Sheria",luo:"Mnyahoro mar chik",kal:"Konyek",kam:"Mũmanyĩki wa Mĩao"},"Legal Q&A":{en:"Legal Q&A",sw:"Maswali ya Kisheria",ki:"Ciũria na Magegania cia Kĩwatho",luo:"Penjo gi dwoko mag chik",kal:"Penjokchok",kam:"Mĩũli na Masũngĩ ya Mĩao"},"Legal Reference":{en:"Legal Reference",sw:"Marejeleo ya Kisheria",ki:"Kĩmenyereria kĩa Kĩwatho",luo:"Chik mar konyruok",kal:"Konyekyet",kam:"Mĩao ya Kũtĩilya"},"Legal References":{en:"Legal References",sw:"Marejeleo ya Kisheria",ki:"Iramenyo cia Kĩwatho",luo:"Chik mag konyruok",kal:"Konyket",kam:"Mĩao ya Kũtĩilya"},Legal:{en:"Legal",sw:"Kisheria",ki:"Kĩwatho",luo:"Chik",kal:"Konyek",kam:"Mĩao"},"Location details":{en:"Location details",sw:"Maelezo ya eneo",ki:"Ũhoro wa kĩgĩna",luo:"Karombo mar kanyo",kal:"Karombok",kam:"Ũtaũ wa Vaa"},"Make final appeals":{en:"Make final appeals",sw:"Fanya rufaa za mwisho",ki:"Ũkae marufaa ma kũheria",luo:"Timbe moko mar konyruok",kal:"Tikchok konyek",kam:"Ndĩka mĩũlĩso ya mũthya"},"Mobilize community":{en:"Mobilize community",sw:"Hamasisha jamii",ki:"Hũria arĩmi hamwe",luo:"Nyis jonyuol",kal:"Nyiisin",kam:"Tũnganya mũũndanĩ"},"Monitor and report on implementation progress.":{en:"Monitor and report on implementation progress.",sw:"Fuatilia na ripoti maendeleo ya utekelezaji.",ki:"Tua na ũhũrie ũrĩmi wa maũndũ.",luo:"Timbe gi konyruok mag rwodhwe.",kal:"Tikng'etyech gi konyek.",kam:"Keelelesya na ũsimũlie maendeeo ma kũtethya."},"Monitor implementation":{en:"Monitor implementation",sw:"Fuatilia utekelezaji",ki:"Tua ũrĩmi",luo:"Timbe konyruok",kal:"Tikng'etyech",kam:"Keelelesya kũtethya"},"Most Clicked":{en:"Most Clicked",sw:"Kubonyezwa Zaidi",ki:"Kĩraigũo Maita Maingĩ",luo:"Ma Clicked",kal:"Ng'atyot",kam:"Kyaĩtwa muno"},"Most Followed":{en:"Most Followed",sw:"Inayofuatiliwa Zaidi",ki:"Kĩraarũmĩrĩiruo Maita Maingĩ",luo:"Ma Followed",kal:"Ng'atyot",kam:"Kyatĩĩiw'a muno"},"My Feed":{en:"My Feed",sw:"Mlisho Wangu",ki:"Mũrĩo Wakwa",luo:"Mber mar nyaka",kal:"Nyakech",kam:"Mũsoi Wakwa"},"My Questions":{en:"My Questions",sw:"Maswali Yangu",ki:"Ciũri
543a Ciakwa",luo:"An gi jopenjo",kal:"Penjokchok",kam:"Mĩũlĩ yakwa"},"My Responses":{en:"My Responses",sw:"Majibu Yangu",ki:"Magegania makwa",luo:"Kadung'o mar jopenjo",kal:"Konyekyet",kam:"Masũngĩ Makwa"},"New Question":{en:"New Question",sw:"Swali Jipya",ki:"Mũtũrĩria Mwerũ",luo:"Penjo Manyien",kal:"Ng'atyot",kam:"Kiũlĩ Kyeũ"},"New password":{en:"New password",sw:"Nenosiri jipya",ki:"Kiugo kĩa hitho kĩerũ",luo:"Kod mar sirikal manyien",kal:"Kod ng'atyot",kam:"Nthĩna ngeni"},Newest:{en:"Newest",sw:"Mpya",ki:"Kĩerũ",luo:"Mabiro",kal:"Ng'atyot",kam:"Kyathee"},Next:{en:"Next",sw:"Ifuatayo",ki:"Kĩrũmĩrĩire",luo:"Mabirocho",kal:"Ng'atyot",kam:"Ĩkũlũ"},"No bills found":{en:"No bills found",sw:"Hakuna miswada iliyopatikana",ki:"No mĩswada ĩrĩĩtwo",luo:"Onge miswada",kal:"Ng'atyot",kam:"Kaĩ mĩswada yoneka"},"No budget documents found":{en:"No budget documents found",sw:"Hakuna nyaraka za bajeti zilizopatikana",ki:"No marufaa ma bajeti marĩĩtwo",luo:"Onge miswada",kal:"Ng'atyot",kam:"Kaĩ mavuku ma bajeti mayonekwa"},"No date":{en:"No date",sw:"Hakuna tarehe",ki:"No mũthenya",luo:"Onge tarik",kal:"Ng'atyot",kam:"Kaĩ mũthenya ũtaaĩkĩtwe"},"No discussions yet. Be the first to comment!":{en:"No discussions yet. Be the first to comment!",sw:"Hakuna mjadala bado. Kuwa wa kwanza kutoa maoni!",ki:"No mĩororo kĩĩtethia. Ũtuĩke arĩ mũra kĩĩwira!",luo:"Onge nono. Bed mokwongo ka bende iwach!",kal:"Ng'atyot",kam:"Kaĩ ũneeni ũtaaĩkĩtwe. Ũkethĩwe wĩ mũkambi wa mbeere!"},"No events found for this county.":{en:"No events found for this county.",sw:"Hakuna matukio yaliyopatikana kwa kaunti hii.",ki:"No maũndũ maũgwirĩĩtwo kĩgĩna gĩkĩ.",luo:"Onge chokruok mar yore.",kal:"Ng'atyot",kam:"Kaĩ maũndũ mayaĩkĩtwe nĩ mũsyĩ ũũ."},"No forum activity yet":{en:"No forum activity yet",sw:"Hakuna shughuli za jukwaa bado",ki:"No kĩheei gĩĩtethia",luo:"Onge chokruok manyien",kal:"Ng'atyot",kam:"Kaĩ kĩkundi kyeeka maũndũ"},"No guides available yet.":{en:"No guides available yet.",sw:"Hakuna miongozo bado.",ki:"No kĩrũmbi kĩa kũhũthia kirĩĩtwo.",luo:"Onge ratiro kitiyone.",kal:"Ng'atyot",kam:"Kaĩ ndaĩsĩ kĩeleelo ta kĩndawa."},"No items found":{en:"No items found",sw:"Hakuna vitu vilivyopatikana",ki:"Gũticokire kĩndũ o na kĩmwe",luo:"Onge gimoro oyudore",kal:"Maat koyom kityo",kam:"Ethiwaa kĩndũ nakamwe"},"No open grievances":{en:"No open grievances",sw:"Hakuna malalamiko wazi",ki:"Mĩrurumo ĩtarĩ mĩkĩe ndĩko",luo:"Onge kero moro ma'golo",kal:"Onge kero",kam:"Ethiwaa malalamiko meũkĩlĩte"},"No pending events":{en:"No pending events",sw:"Hakuna matukio yanayosubiri",ki:"Mĩcemanio ĩtarĩ ĩĩkĩĩkĩte ndĩko",luo:"Onge gik ma'ruo",kal:"Onge kaimut",kam:"Ethiwaa myanya ĩtasũanĩiw'e"},"No pending guides to publish":{en:"No pending guides to publish",sw:"Hakuna miongozo inayosubiri kuchapishwa",ki:"Mĩcũngĩrĩrio ĩtarĩ ĩĩkĩĩkĩte kũgaywo ndĩko",luo:"Onge ranyisi mang'adi",kal:"Onge ranyisi",kam:"Ethiwaa maũndũ ma kũelekya mataandĩkĩkete"},"No pending requests":{en:"No pending requests",sw:"Hakuna maombi yanayosubiri",ki:"Ciokĩra ĩtarĩ ĩĩkĩĩkĩte ndĩko",luo:"Onge kwayo moro",kal:"Onge kwayo",kam:"Ethiwaa maũndũ meũtanĩĩa ma kũkwata"},"Notifications enabled!":{en:"Notifications enabled!",sw:"Arifa zimewashwa!",ki:"Ndũmĩrĩri nĩ ikũmũthĩkĩrĩria!",luo:"Notifikesheni ojerore!",kal:"Notifikesheni koyom!",kam:"Ũkũsya wa vala watumĩa nĩwonaa!"},"Notifications enabled":{en:"Notifications enabled",sw:"Arifa zimewashwa",ki:"Ndũmĩrĩri nĩ ikũmũthĩkĩrĩria",luo:"Notifikesheni oyie",kal:"Notifikesheni koyom",kam:"Ũkũsya wa vala watumĩa nĩwonaa"},Notifications:{en:"Notifications",sw:"Arifa",ki:"Ndũmĩrĩri",luo:"Notifikesheni",kal:"Notifikeshenyi",kam:"Ũkũsya wa vala watumĩa"},"Open Constitution":{en:"Open Constitution",sw:"Fungua Katiba",ki:"Hingũra Maratathi ma Mũthingi wa Watho",luo:"Yaye Bura maduong'",kal:"Yaye Bunge",kam:"Fungũa Katiba"},"Open Grievances":{en:"Open Grievances",sw:"Malalamiko Wazi",ki:"Mĩrurumo Mĩhingũku",luo:"Kero ma'golo",kal:"Kero",kam:"Malalamiko Meũkĩlĩte"},"Organize community discussion":{en:"Organize community discussion",sw:"Panga mjadala wa jamii",ki:"Thondeka mĩcemanio
543ya mũingĩ",luo:"Chok nyiso mar jowadgi",kal:"Chok nyiso",kam:"Ũtw'ĩsya kũneena na andũ"},"Organizer name":{en:"Organizer name",sw:"Jina la mpangaji",ki:"Rĩĩtwa rĩa mũthondeki",luo:"Nying' mar jochok rwako",kal:"Nying' mar jochok",kam:"Ĩsyoka y'ũla wĩsũananĩsya"},"Our team will review and answer your question.":{en:"Our team will review and answer your question.",sw:"Timu yetu itapitia na kujibu swali lako.",ki:"Kĩama giitũ nĩ gĩkũthuthuria na gĩkũcokia kĩũria gĩaku.",luo:"Ochoko marwa ibiro nono konyis gimoro amora.",kal:"Ochoko marwa ibiro nono miong'o miong'o.",kam:"Ĩkĩtw'a yĩkaivathĩsya na yĩkaũsya ĩkũlyo yaku."},"Our team will review your submission.":{en:"Our team will review your submission.",sw:"Timu yetu itapitia uwasilishaji wako.",ki:"Kĩama giitũ nĩ gĩkũthuthuria ũrĩa ũkũhingũra.",luo:"Ochoko marwa ibiro nono konyis gimoro amora.",kal:"Ochoko marwa ibiro nono miong'o miong'o.",kam:"Ĩkĩtw'a yĩkaivathĩsya ũndũ waku."},"Parliament Bills Tracker":{en:"Parliament Bills Tracker",sw:"Kifuatiliaji cha Miswada",ki:"Gĩcũngĩrĩria Watho wa Bunge",luo:"Jit ma bunge",kal:"Jit ma Bunge",kam:"Yĩla yakuya maũndũ ma Parliament"},"Password Updated!":{en:"Password Updated!",sw:"Nenosiri Limesasishwa!",ki:"Ndaarĩcia ĩĩkĩĩkĩĩte!",luo:"Parot oyiero!",kal:"Parot oyiero!",kam:"Ndavya yũvĩngĩte!"},"Password must be at least 6 characters":{en:"Password must be at least 6 characters",sw:"Nenosiri lazima liwe na herufi 6 au zaidi",ki:"Ndaarĩcia no ĩkorũo na marũa maatana matandatũ",luo:"Parot onego bedo gi ndiko abich",kal:"Parot onego bedo gi ndiko abich",kam:"Ndavya nĩvalyĩkũkua yĩna ndia itandatũ kana kũvĩtũka"},Password:{en:"Password",sw:"Nenosiri",ki:"Ndaarĩcia",luo:"Parot",kal:"Parot",kam:"Ndavya"},"Passwords do not match":{en:"Passwords do not match",sw:"Nenosiri hazifanani",ki:"Ndaaricĩ ciegũtĩanĩra",luo:"Parot ok one",kal:"Parot ok one",kam:"Ndavyas ituĩkĩtwe nĩyĩkũkwatana"},"Pending Events":{en:"Pending Events",sw:"Matukio Yanayosubiri",ki:"Mĩcemanio ĩtarĩ ĩĩkĩĩkĩte",luo:"Gima'ruo ma'golo",kal:"Gima'ruo",kam:"Myanya Ĩtasũanĩiw'e"},"Pending Verification Requests":{en:"Pending Verification Requests",sw:"Maombi ya Uthibitishaji Yanayosubiri",ki:"Ciokĩra cia Ũthuthuria ĩtarĩ ĩĩkĩĩkĩte",luo:"Kwayo ma'golo",kal:"Kwayo",kam:"Maũndũ meũtanĩĩa ma kũkwata"},Pending:{en:"Pending",sw:"Inasubiri",ki:"Gĩtarĩ kĩĩkĩĩkĩte",luo:"Ma'golo",kal:"Ma'golo",kam:"Mãtarĩ maũndũkya"},Post:{en:"Post",sw:"Chapisha",ki:"Chapĩcia",luo:"Choro",kal:"Choro",kam:"Chapĩtha"},"Prepare a memorandum":{en:"Prepare a memorandum",sw:"Andaa memoranda",ki:"Thondeka karani ya kwĩyumĩria",luo:"Yie gitung'o mar nyiso",kal:"Yie gitung'o",kam:"Kũthũkũma kamemo"},"Prepare and testify at committee hearings.":{en:"Prepare and testify at committee hearings.",sw:"Jiandae na ushuhudie katika vikao vya kamati.",ki:"Thondeka na ũreke ũira kĩonjũrĩ kĩa mũingĩ.",luo:"Chikni mondo inyis weche e loe kamiti.",kal:"Chikni mondo inyis weche e loe.",kam:"Yĩthũkũme na ũimĩthe mbella vyũ mbelelũ nĩ komitii."},"Primary Sources":{en:"Primary Sources",sw:"Vyanzo Vikuu",ki:"Mĩũthũthia Mĩrĩa Mĩmũ",luo:"Nyono maguru",kal:"Nyono maguru",kam:"Mũsingi Wa Maũndũ"},"Public Participation Guide":{en:"Public Participation Guide",sw:"Mwongozo wa Ushiriki",ki:"Karanji ya Ũthii wa Mũingĩ",luo:"Ranyisi mar jowadgi",kal:"Ranyisi",kam:"Nthĩnzĩo ya ũvĩngĩsyo wa andũ"},"Public Participation Guides":{en:"Public Participation Guides",sw:"Miongozo ya Ushiriki wa Umma",ki:"Mĩcũngũrĩrio ya Ũthii wa Mũingĩ",luo:"Ranyisi ma jowadgi",kal:"Ranyisi",kam:"Nthĩnzĩo ya ũvĩngĩsyo wa andũ maingĩ"},"Publish All":{en:"Publish All",sw:"Chapisha Zote",ki:"Chapĩcia Yothe",luo:"Choro duto",kal:"Choro",kam:"Chapĩsha yonthe"},"Question submitted!":{en:"Question submitted!",sw:"Swali limewasilishwa!",ki:"Kĩũria nĩ kĩũthathĩrĩrĩtwo!",luo:"Kwayo ojerore!",kal:"Kwayo ojerore!",kam:"Kĩkũlyo kyasyaĩka!"},"Quick plain-language summary (2 mins).":{en:"Quick plain-language summary (2 mins).",sw:"Muhtasari mfupi kwa lugha rahisi (dakika 2).",ki:"Kĩamũria kĩmũthĩrĩria kĩhũũthĩ (minũto 2).",luo:"Nyiso koth gi thieth (dak. 2).",kal:"Nyiso koth (dak. 2).",kam:"Ũsũanĩsya wĩla mũnandĩ (ndatĩka 2)."},"Quick plain-language summary of the draft.":{en:"Quick plain-language summary of the draft.",sw:"Muhtasari mfupi wa rasimu kwa lugha rahisi.",ki:"Kĩamũria kĩmũthĩrĩria kĩhũũthĩ kĩa gĩkĩ kĩarĩ.",luo:"Nyiso koth gi thieth.",kal:"Nyiso koth (dak. 2).",kam:"Ũsũanĩsya wĩla mũnandĩ wa ũvaindu."},"Rally community support or opposition before the vote.":{en:"Rally community support or opposition before the vote.",sw:"Hamasis
543ha msaada au upinzani wa jamii kabla ya kura.",ki:"Kĩara mũingĩ nĩguo ũhote kũgũthii kana kũũgitana kũgũthira kũrĩ kura.",luo:"Chok jowadgi mondo giyie kata ginyis owegi konyiso.",kal:"Chok jowadgi mondo giyie kata ginyis.",kam:"Kũkũngana ũkũlĩlany'a kana kũkatyanĩsya nyuma ya ũthũkũmi."},"Read Full Law Text":{en:"Read Full Law Text",sw:"Soma Sheria Kamili",ki:"Ũthomanga Watho Wothe Wothe warĩĩkĩte",luo:"Som bura duto",kal:"Som bura",kam:"Soma Watho Mũnene"},"Read committee findings and recommendations.":{en:"Read committee findings and recommendations.",sw:"Soma matokeo na mapendekezo ya kamati.",ki:"Ũthomanga maũndũ ma kĩama na ũingatĩki",luo:"Som gima kamiti oyuo konyis",kal:"Som gima kamiti oyuo konyis",kam:"Soma ũndũ komitii yĩsyaĩkĩye na maũndũ ala yĩkwendeasya."},"Read summary":{en:"Read summary",sw:"Soma muhtasari",ki:"Ũthomanga kĩamũria",luo:"Som nyiso",kal:"Som nyiso",kam:"Soma ũsũanĩsya"},"Read the bill as introduced":{en:"Read the bill as introduced",sw:"Soma mswada uliowasilishwa",ki:"Ũthomanga watho ũrĩa ũkũhingũra",luo:"Som bura ma'ruo",kal:"Som bura",kam:"Soma watho ũla waĩveeta"},"Read the draft summary":{en:"Read the draft summary",sw:"Soma muhtasari wa rasimu",ki:"Ũthomanga kĩamũria kĩa gĩkĩ kĩarĩ",luo:"Som nyiso",kal:"Som nyiso",kam:"Soma ũsũanĩsya wa ũũndũ"},"Read the full constitution":{en:"Read the full constitution",sw:"Soma katiba kamili",ki:"Ũthomange maratathi ma Mũthingi wa Watho wothe",luo:"Som bura duto",kal:"Som bura duto",kam:"Soma katiba yonthe"},"Read the one-pager":{en:"Read the one-pager",sw:"Soma muhtasari",ki:"Ũthomanga peji ĩmwe",luo:"Som jat",kal:"Som jat",kam:"Soma ĩpeji yĩmwe"},"Ready to stay informed?":{en:"Ready to stay informed?",sw:"Uko tayari kuwa na taarifa?",ki:"Ũkũrĩĩka nĩ ũkũmenya?",luo:"Isecho bedo ma ing'eyo weche duto?",kal:"Yameet akimuch ole tichin e ng'alech",kam:"Wĩyũmbanĩtye kũimanyĩka?"},"Redirecting you to the app...":{en:"Redirecting you to the app...",sw:"Inakuelekeza kwenye programu...",ki:"Ũkũrũmĩrĩrio kũrĩ programu...",luo:"Idhi manyo programno...",kal:"Imutich inyalu kibaganet...",kam:"Yĩkũkũtw'a kũenda appinĩ..."},"Reference Law":{en:"Reference Law",sw:"Rejelea Sheria",ki:"Watho Ũtaarĩirwo",luo:"Chik Manyok",kal:"Reretiet Nduguto",kam:"Maoo Ma Kũelesya"},Regenerate:{en:"Regenerate",sw:"Tengeneza upya",ki:"Tungata rĩngĩ",luo:"Chiak kendo",kal:"Ulu kogeny",kam:"Ũkĩa Ĩngĩ"},Reject:{en:"Reject",sw:"Kataa",ki:"Ũkaana",luo:"Dagi",kal:"Kany",kam:"Kaa Ngulwa"},Rejected:{en:"Rejected",sw:"Imekataliwa",ki:"Ũkaanĩtwo",luo:"Odagi",kal:"Kanyete",kam:"Yaĩ Kĩaa Ngulwa"},"Related Bills":{en:"Related Bills",sw:"Miswada Husika",ki:"Miswere Mĩkonainie",luo:"Febe Moko Mamegeni",kal:"Murekwetab Beelisyek",kam:"Mbĩũ ila Syonanĩte"},"Related Events":{en:"Related Events",sw:"Matukio Husika",ki:"Ihunjo Ikonainie",luo:"Timbe Mamoko Mang'eneni",kal:"Ing'wetab Tisi",kam:"Mekũndaanio Elonanĩte"},Reply:{en:"Reply",sw:"Jibu",ki:"Cokia",luo:"Dwoko",kal:"Kinyoor",kam:"Cokia"},"Report an Issue":{en:"Report an Issue",sw:"Ripoti Tatizo",ki:"Aragania Thĩna",luo:"Hulo gimoro marach",kal:"Igoch anyiny",kam:"Nenga Thĩna"},"Report progress":{en:"Report progress",sw:"Ripoti maendeleo",ki:"Akania maũndũ marĩa marathiĩ na mbere",luo:"Hulo kaka gie dhi nyime",kal:"Igoch tichnyo",kam:"Nenga ũndũ ũtetheka"},"Report submitted":{en:"Report submitted",sw:"Ripoti imetumwa",ki:"Arangania nĩ ũmĩtĩtwo",luo:"Hulo inyisore",kal:"Igoch inyisis",kam:"Nengo yatumĩĩwe"},Report:{en:"Report",sw:"Ripoti",ki:"Akania",luo:"Hulo",kal:"Igoch",kam:"Nenga"},"Request Verification":{en:"Request Verification",sw:"Omba Uthibitishaji",ki:"Thaithana nĩ ũkorwo ũrĩ wa ma",luo:"Kwayo ni mondo okonyi",kal:"Kosom kotich",kam:"Kũkũlya Ũsiani"},"Request a lawyer review":{en:"Request a lawyer review",sw:"Omba ukaguzi wa wakili",ki:"Thaithana wakĩli athugunde",luo:"Kwayo mondo jal-chik olos gikgi",kal:"Kosom lakitab ng'o",kam:"Kũkũlya wakili asianĩe"},"Request review":{en:"Request review",sw:"Omba ukaguzi",ki:"Thaithana ũthugundwo",luo:"Kwayo mondo olosi",kal:"Kosom ng'o",kam:"Kũkũlya ũsiani"},"Reset Password":{en:"Reset Password",sw:"Weka Upya Nenosiri",ki:"Bangarũra Ndaĩmũ ya Kĩmbĩrĩrĩ",luo:"Bed Piny Kendo Nyamuori Manyien",kal:"Reet Kiwotab Kiwo",kam:"Set Kĩmantha Kĩsyawa Ĩngĩ"},Respond:{en:"Respond",sw:"Jibu",ki:"Cokia",luo:"Dwoko",kal:"Kinyoor",kam:"Cokia"},Responded:{en:"Responded",sw:"Imejibiwa",ki:"Ũracokĩtio",luo:"Isechwoko",kal:"Kinyoorete",kam:"Yacokiwe"},"Response sent":{en:"Response sent",sw:"Jibu limetumwa",ki:"Ũracokĩtio nĩ ũmĩtĩtwo",luo:"Ichwoko inyiso",kal:"Kinyoor inyisis",kam:"Ũcokia watũmwa"},"Review proposed amendments":{en:"Review proposed amendments",sw:"Pitia marekebisho yanayopendekezwa",ki:"Thugunda marĩkĩrĩria marĩa marathugunwo",luo:"Los e kaka ibiro chopo e bunge",kal:"Acham ng'o tisi teta",kam:"Asianĩsya malevũlyo ala mayeeiwe"},"Review the final version before the vote.":{en:"Review the final version before the vote.",sw:"Pitia toleo la mwisho kabla ya kura.",ki:"Thugunda njĩkĩrĩro ya mũico mbere ya kũhũrwo kura.",luo:"Los e bunge mothe moti",kal:"Acham ng'o tisi teta",kam:"Asianĩsya ũndũ ũla wa mũthya yambee kũkũnwa kura."},"Review the passed version":{en:"Review the passed version",sw:"Pitia toleo lililopitishwa",ki:"Thugunda njĩkĩrĩro ĩrĩa ĩratabanio",luo:"Los e bunge ma inyalo",kal:"Acham ng'o tisi teta",kam:"Asianĩsya ũndũ ũla wa mũthya ũla waminie"},"Save Preferences":{en:"Save Preferences",sw:"Hifadhi Mapendekezo",ki:"Hĩtĩrĩra Maũndũ marĩa ũkwenda",luo:"Keti e kaka inyalo",kal:"Sab Ekaang'wan",kam:"Tenya Mĩelelo Yaku"},"Search bills, budgets...":{en:"Search bills, budgets...",sw:"Tafuta miswada, bajeti...",ki:"Caria miswere, mĩhaka ya mbeca...",luo:"Meny febe, pesa...",kal:"Yameet beelisyek, bochotet...",kam:"Manya mbĩũ, bajeti..."},"Search questions...":{en:"Search questions...",sw:"Tafuta maswali...",ki:"Caria ciũria...",luo:"Meny penjgi...",kal:"Yameet kestesionek...",kam:"Manya makũlyo..."},"Select county...":{en:"Select county...",sw:"Chagua kaunti...",ki:"Thuuria kaunti...",luo:"Chak county...",kal:"Cheeg kaanti...",kam:"Thaũ county..."},"Send Response":{en:"Send Response",sw:"Tuma Jibu",ki:"Tũma Cokio",luo:"Chwoko dwoko",kal:"Tuma Kinyoor",kam:"Tũma Ũcokia"},"Send a formal letter to your MP with your position.":{en:"Send a formal letter to your MP with your position.",sw:"Tuma barua rasmi kwa mbunge wako na msimamo wako.",ki:"Tũma marũa ma thitabu kũrĩ Mbunge waku na kĩĩra kĩa ũndũ ũrĩa ũkwenda.",luo:"Chwoko barupe e bunge ni mondo okonyi gi weche moko.",kal:"Tuma surat nyo konyit MP nyalnyo tisis.",kam:"Tũma Valũa ya wona mbungenĩ yaku na kĩanda kyaku."},Send:{en:"Send",sw:"Tuma",ki:"Tũma",luo:"Chwoko",kal:"Tuma",kam:"Tũma"},"Set New Password":{en:"Set New Password",sw:"Weka Nenosiri Jipya",ki:"Weka Ndaĩmũ ya Kĩmbĩrĩrĩ Ĩkũũ",luo:"Bed Piny Kendo Nyamuori Manyien",kal:"Wek Kiwotab Kiwo Keny",kam:"Set Kĩmantha Kĩsyawa Kyeũ"},"Set up your preferences!":{en:"Set up your preferences!",sw:"Weka mapendekezo yako!",ki:"Weka maũndũ marĩa ũkwenda!",luo:"Los e kaka inyalo!",kal:"Set up your preferences!",kam:"Set up mĩelelo yaku!"},"Settings saved!":{en:"Settings saved!",sw:"Mipangilio imehifadhiwa!",ki:"Thaithana nĩ ũmenye!",luo:"Gima osebedi!",kal:"Ing'o tisis!",kam:"Settings yatenyiwe!"},Settings:{en:"Settings",sw:"Mipangilio",ki:"Mĩhũmũ",luo:"Keti",kal:"Ing'o",kam:"Settings"},"Share & mobilize":{en:"Share & mobilize",sw:"Shiriki na hamasisha",ki:"Gayana na ũmenyithie",luo:"Ket kony gi wanam",kal:"Share & mobilize",kam:"Mana na ũtethye"},"Share a short summary with your community.":{en:"Share a short summary with your community.",sw:"Shiriki muhtasari mfupi na jamii yako.",ki:"Gayana ũhoro mũceke na andũ a ndini yaku.",luo:"Ket kony gi wanam e weche mo",kal:"Share a short summary with your community.",kam:"Mana isummary ĩnini na andũ maku."},"Share a short summary":{en:"Share a short summary",sw:"Shiriki muhtasari mfupi",ki:"Gayana ũhoro mũceke",luo:"Ket kony gi wanam e weche mo",kal:"Share a short summary",kam:"Mana ĩsummary ĩnini"},"Share event":{en:"Share event",sw:"Shiriki tukio",ki:"Gayana ihunjo",luo:"Ket kony gi wanam e weche mo",kal:"Share event",kam:"Mana iventĩ"},"Share for early awareness":{en:"Share for early awareness",sw:"Shiriki kwa ufahamu wa mapema",ki:"Gayana nĩ ũmenyithie wan",luo:"Ket kony gi wanam e weche mo",kal:"Share for early awareness",kam:"Mana nĩ ũmanyĩke mbee"},"Share via WhatsApp, Twitter or other platforms.":{en:"Share via WhatsApp, Twitter or other platforms.",sw:"Shiriki kupitia WhatsApp, Twitter au majukwaa mengine.",ki:"Gayana kũgerera WhatsApp, Twitter kana mĩhũmũ ĩngĩ.",luo:"Ket kony gi wanam e WhatsApp, Twitter amua e weche moko.",kal:"Share via WhatsApp, Twitter or other platforms.",kam:"Mana kũtũmĩa WhatsApp, Twitter kana platforms ingĩ."},"Share what the new law means":{en:"Share what the new law means",sw:"Shiriki sheri
543a mpya inamaanisha nini",ki:"Gayana uria watho mweru ucio ugiuga",luo:"Nyis gima chike manyien tiende",kal:"Sichotin age en kotugul ak tetaat ne lelu",kam:"Wonia nesa ya watho mweu uwau"},"Share your thoughts on this bill...":{en:"Share your thoughts on this bill...",sw:"Shiriki mawazo yako kuhusu mswada huu...",ki:"Gayania meciria maku iguru ria watho uyu...",luo:"Nyis paro mari e wi sikh bil motelo...",kal:"Sichotin ng'atutik amu ak lelu...",kam:"Wonia mawoni maku aa wasu uwau..."},Share:{en:"Share",sw:"Shiriki",ki:"Gayania",luo:"Nyis",kal:"Sichotin",kam:"Wonia"},"Sign In":{en:"Sign In",sw:"Ingia",ki:"Ingia",luo:"Donj e",kal:"Ibar",kam:"Ingia"},"Sign Out":{en:"Sign Out",sw:"Ondoka",ki:"Uma",luo:"Wuog oko",kal:"Ewo",kam:"Uma"},"Sign Up":{en:"Sign Up",sw:"Jisajili",ki:"Andikithia",luo:"Register",kal:"Ibar ak yune",kam:"AndikÄ©sya"},"Sign in to access":{en:"Sign in to access",sw:"Ingia ili kupata ufikiaji",ki:"Ingira ni uria uguo",luo:"Donj e mondo inyal yudo",kal:"Ibar ak tetaat ne ki amnyek",kam:"Ingia nÄ© kana Å©kwate"},"Sign in to join the discussion":{en:"Sign in to join the discussion",sw:"Ingia ili kushiriki mjadala",ki:"Ingira niguo wikinyia kigocorero",luo:"Donj e mondo ikaw ranyisi e mbaka",kal:"Ibar ak tetaat ne ki amnyek",kam:"Ingia nÄ© kana Å©katetheesye Å©kana"},"Sign in to submit your question":{en:"Sign in to submit your question",sw:"Ingia ili kutuma swali lako",ki:"Ingira niguo utume ciuria ciaku",luo:"Donj e mondo iyale penjo mari",kal:"Ibar ak tetaat ne ki amnyek",kam:"Ingia nÄ© kana Å©tÅ©mÄ©e kĩũli kyaku"},"Sign in with Google":{en:"Sign in with Google",sw:"Ingia na Google",ki:"Ingira na Google",luo:"Donj e gi Google",kal:"Ibar ak Google",kam:"Ingia na Google"},"Sign in with an admin account":{en:"Sign in with an admin account",sw:"Ingia kwa akaunti ya msimamizi",ki:"Ingira na account ya ndongi",luo:"Donj e gi akaunt mar jatelo",kal:"Ibar ak account ne ki amnyek",kam:"Ingia na akaunti ya mÅ©nene"},Skip:{en:"Skip",sw:"Ruka",ki:"Twarania",luo:"Lek",kal:"Tor",kam:"Ĩtia"},"Source:":{en:"Source:",sw:"Chanzo:",ki:"Muhirigo:",luo:"Kae:",kal:"Taa:",kam:"Kuma:"},"Sources & References":{en:"Sources & References",sw:"Vyanzo na Marejeleo",ki:"Mihirigo na mareferensi",luo:"Kar kanyakla & Kanyach",kal:"Taa ak ng'o: keme",kam:"MaÅ©ndÅ© Kuma & MaÅ©ndÅ© KÅ©vetia"},Sources:{en:"Sources",sw:"Vyanzo",ki:"Mihirigo",luo:"Mande",kal:"Taa",kam:"MaÅ©ndÅ© Kuma"},"Start Exploring":{en:"Start Exploring",sw:"Anza Kuchunguza",ki:"Ambira kuhukuma",luo:"Chak nono",kal:"Teel ak tetaat",kam:"TanÄ©sya KÅ©kÅ©nya"},"Start a petition (draft)":{en:"Start a petition (draft)",sw:"Anza ombi (rasimu)",ki:"Ambira gukinyukia marua ma kurega (draft)",luo:"Chak kwayo (sirni)",kal:"Teel ak petition (draft)",kam:"TanÄ©sya kÄ©thÄ©mba (Å©losi)"},"Start petition":{en:"Start petition",sw:"Anza ombi",ki:"Ambira kinyukia marua ma kurega",luo:"Chak kwayo",kal:"Teel ak petition",kam:"TanÄ©sya kÄ©thÄ©mba"},"Subject...":{en:"Subject...",sw:"Mada...",ki:"Watho...",luo:"Wije...",kal:"Ng'atutik...",kam:"MÅ©soaÄ©..."},"Submit Event":{en:"Submit Event",sw:"Wasilisha Tukio",ki:"Tuma Urigirire",luo:"Walo gikmaranyiny",kal:"Toro",kam:"TÅ©ma KÄ©elele"},"Submit Question":{en:"Submit Question",sw:"Wasilisha Swali",ki:"Tuma ciuria",luo:"Walo penjo",kal:"Toro",kam:"TÅ©ma Kĩũli"},"Submit Report":{en:"Submit Report",sw:"Tuma Ripoti",ki:"Tuma riboti",luo:"Walo ripoti",kal:"Toro",kam:"TÅ©ma LÄ©poti"},"Submit Request":{en:"Submit Request",sw:"Wasilisha Ombi",ki:"Tuma uhooi",luo:"Walo kwayo",kal:"Toro",kam:"TÅ©ma MÅ©kÅ©mbi"},"Submit a private request for legal guidance (optional anonymity).":{en:"Submit a private request for legal guidance (optional anonymity).",sw:"Tuma ombi la faragha la mwongozo wa kisheria (utambulisho fiche wa hiari).",ki:"Tuma uhooi wa ciacara ni uria ungiuga watho (uthingania wa kirigiriro).",luo:"Yal kwayo mari mochung'ni kaka rieko mar chik (nyal jaluoro e wi ng'ato).",kal:"Toro ak kanyek ne ki amnyek",kam:"TÅ©ma mÅ©kÅ©mbi wa kũĩsa kwa Å©taÄ© wa kÄ©ambÄ© (Å©nini wa Å©nyanya)."},"Submit an Event":{en:"Submit an Event",sw:"Wasilisha Tukio",ki:"Tuma urigirire",luo:"Walo gikmaranyiny",kal:"Toro",kam:"TÅ©ma KÄ©elele"},"Submit for Review":{en:"Submit for Review",sw:"Wasilisha kwa Ukaguzi",ki:"Tuma niguo uciirithio",luo:"Wale mondo ononi",kal:"Toro",kam:"TÅ©ma kwa KÅ©kÅ©nya"},"Submit views":{en:"Submit views",sw:"Wasilisha maoni",ki:"Tuma meciria",luo:"Walo paro",kal:"Toro ak lelu",kam:"TÅ©ma mawoni"},"Submit written memoranda":{en:"Submit written memoranda",sw:"Wasilisha memoranda",ki:"Tuma memoranda cienyiruo na ruandiko",luo:"Wale memoranda mwandike",kal:"Toro ak memoranda ne ki amnyek",kam:"TÅ©ma memo maandÄ©ke"},"Submit your views formally to the committee.":{en:"Submit your views formally to the committee.",sw:"Wasilisha maoni yako rasmi kwa kamati.",ki:"Tuma meciria maku kuri kamiti na njira ya kiugo kiongo.",luo:"Wale parowi e komiti kaka owinjore.",kal:"Toro ak lelu ne ki amnyek",kam:"TÅ©mÄ©a mawoni maku kwa kamiti Å©kÅ©tÅ©mÄ©a Å©kÅ©lÅ©ngo."},Submit:{en:"Submit",sw:"Wasilisha",ki:"Tuma",luo:"Walo",kal:"Toro",kam:"TÅ©ma"},"Submitted! A lawyer will respond soon.":{en:"Submitted! A lawyer will respond soon.",sw:"Imetumwa! Wakili atajibu hivi karibuni.",ki:"Noma! Mweri wa watho aigana kuuria.",luo:"Oruogoni! Jachik bi dweyo piny mapiyo.",kal:"Toro! Ak ng'ony",kam:"MÅ©andÄ©ke! Wakili akÅ©kũũlÄ©la Ä©vinda Ä©nini."},"Take the Tour":{en:"Take the Tour",sw:"Chukua Ziara",ki:"Ria ng'ania uria urigirire",luo:"Kaw wuodho mar nono",kal:"Teel ak tetaat ne ki amnyek",kam:"Kaa ŨsÅ©vÄ©o"},"The bill is now law â understand your rights and obligations.":{en:"The bill is now law â understand your rights and obligations.",sw:"Mswada sasa ni sheria â elewa haki na wajibu wako.",ki:"Watho ucio ni wathana -- umanyire migunda yaku na kithiiro.",luo:"Sikh bil sani oselokore chik â ng'e ratiroka kod keti manti.",kal:"Lelu ne ki amnyek ak tetaat ne ki amnyek",kam:"Watho Å©su Å©komana na Å©thÅ©kÅ©mi â ĩĩkuvÄ©sye masila maku na maÅ©ndÅ© ma kÅ©kwata."},"This dashboard is for verified legal professionals.":{en:"This dashboard is for verified legal professionals.",sw:"Dashibodi hii ni kwa wataalamu wa sheria walioidhinishwa.",ki:"Dashboard iyi ni ya andu a watho aria mamanirithirio.",luo:"Dashboardi ni mar jochik moti gi adiera.",kal:"Dashboard ne ki amnyek ak tetaat ne ki amnyek",kam:"Dashboard yii nÄ© ya akÅ©nzi ma kÄ©ambÄ© ala maÄ©siwe."}
543,"This password reset link is invalid or expired.":{en:"This password reset link is invalid or expired.",sw:"Kiungo hiki cha kuweka upya nenosiri ni batili au kimekwisha muda wake.",ki:"Kiambati giki gia gucunguria password githitho ti kihagaga kana nikihiruka.",luo:"Nambara mar rito manono otuora kata osekony.",kal:"Password ne ki amnyek ak tetaat ne ki amnyek",kam:"Kiunga kya kÅ©lunge nÅ©ingo wa Å©sindÄ©ki nÄ© kÄ©vÄ©tu kana kÄ©iamba kÄ©sindÄ©kÄ©wa."},"Track bill progress officially":{en:"Track bill progress officially",sw:"Fuatilia maendeleo ya mswada rasmi",ki:"Rora maendeleo ya watho ucio na njira ya kiugo kiongo.",luo:"Lony nyime e wi bil motelo mochuong'ga.",kal:"Lelu ne ki amnyek ak tetaat ne ki amnyek",kam:"Twaa Å©enda wa watho Å©su vala waÄ©le."},"Track if the government implements the law properly.":{en:"Track if the government implements the law properly.",sw:"Fuatilia kama serikali inatekeleza sheria ipasavyo.",ki:"Rora kana serikali irikitia watho ucio wega.",luo:"Lony kaka sirkal chiwo chik maber.",kal:"Lelu ne ki amnyek ak tetaat ne ki amnyek",kam:"Twaa kana silikali Ä©kÅ©lÅ©nga watho Å©su nesa."},Trending:{en:"Trending",sw:"Vuma",ki:"Ikigana",luo:"Mabayo",kal:"Ng'atutik",kam:"Oenda"},"Trust & Safety":{en:"Trust & Safety",sw:"Uaminifu na Usalama",ki:"Wira na uthaka",luo:"Luoro & Nyonye",kal:"Ng'atutik",kam:"ŨsÅ©vÄ©o & ŨsindÅ©"},"Trusted Sources":{en:"Trusted Sources",sw:"Vyanzo Vinavyoaminika",ki:"Mihirigo ya Kiriho",luo:"Mande modhier",kal:"Taa ak ng'o: keme",kam:"MaÅ©ndÅ© Kuma MeÄ©iwe"},"Type your legal question here...":{en:"Type your legal question here...",sw:"Andika swali lako la kisheria hapa...",ki:"AndÄ©ka kĩũria gÄ©aku kÄ©a watho haha...",luo:"Ndik niwuora mar chik e piny ka...",kal:"Tule nit ne tilianet neming'o negei...",kam:"AndÄ©ka kĩũmĩĩsya kyaku kya watho vau..."},"Understand the bill text presented to parliament.":{en:"Understand the bill text presented to parliament.",sw:"Elewa maandishi ya mswada uliowasilishwa bungeni.",ki:"Ũmenye mÅ©swada Å©rÄ©a waÄ©anÄ©irÅ©o palamande.",luo:"Winj tiend msumeno ma ochiw ne bunge.",kal:"Ing'ing'e kaimutiet ne miisiet ne koiyo bunge.",kam:"Ũelewe mÅ©swaa Å©la waatwaa bÅ©nge."},"Understand the final version":{en:"Understand the final version",sw:"Elewa toleo la mwisho",ki:"Ũmenye watho Å©rÄ©a Å©koretwo Å©thiÄ©te mÅ©thia.",luo:"Winj kido mokadho moter.",kal:"Ing'ing'e kaimutiet ne betut ne konyit.",kam:"Ũelewe kÄ©elele kÄ©la kyamÄ©lÄ©ka."},"Understand the law as passed by parliament.":{en:"Understand the law as passed by parliament.",sw:"Elewa sheria iliyopitishwa na bunge.",ki:"Ũmenye watho Å©rÄ©a palamande yarÄ©kirie.",luo:"Winj chik ma bunge osetiyo.",kal:"Ing'ing'e kiamutiet negei lopo ne miisiet ne koiyo bunge.",kam:"Ũelewe watho Å©la waatwaa bÅ©nge."},"Understand what changes are being proposed.":{en:"Understand what changes are being proposed.",sw:"Elewa mabadiliko yanayopendekezwa.",ki:"Ũmenye marÄ©gÅ©rÅ©rÅ©ko maÅ©kÄ©rÄ©kanÄ©two.",luo:"Winj kanyiso mage ma luwo manyisore kanyo.",kal:"Ing'ing'e kaimutiet ne kanyiso nee mising kanyiso.",kam:"Ũelewe mambÄ©lÄ©lyo ala makwĩĩkĩĩthya."},"Upcoming Events":{en:"Upcoming Events",sw:"Matukio Yajayo",ki:"Mĩĩra Ä©raÅ©ka",luo:"Timbe Mabiro",kal:"Aunet Ne Bitot",kam:"MÄ©vomo YÅ©kÄ©te"},"Verification request submitted!":{en:"Verification request submitted!",sw:"Ombi la uthibitishaji limewasilishwa!",ki:"MÅ©kanda wa Å©thikÄ©rÄ©ria nÄ©waigÄ©two!",luo:"Kwayo mar nonro oseor!",kal:"Somunyet ne taptit ne koisto!",kam:"Keelelyo kya Å©kÅ©nÄ©kyo kyatÅ©mwa!"},"Verified Answers":{en:"Verified Answers",sw:"Majibu Yaliyothibitishwa",ki:"Cokera Cia ŨthikÄ©rÄ©ria",luo:"Dhi Kaka Monori",kal:"Kaimutiet Ne Kokisto",kam:"Myanzo YÄ©lÅ©lÅ©kiw'e"},Verified:{en:"Verified",sw:"Imethibitishwa",ki:"ŨthikÄ©rÄ©ria",luo:"Monori",kal:"Kokisto",kam:"YÄ©lÅ©lÅ©kiw'e"},Verify:{en:"Verify",sw:"Thibitisha",ki:"ThikÄ©rÄ©ria",luo:"Monor",kal:"Koisto",kam:"LÅ©lÅ©ka"},"View All Bills":{en:"View All Bills",sw:"Tazama Miswada Yote",ki:"Wona Miswada Yothe",luo:"Ne Misumbeno Duto",kal:"Tar Misundek Somiik",kam:"Soma Miswada Yonthe"},"View Official Bill":{en:"View Official Bill",sw:"Tazama Mswada Rasmi",ki:"Wona MÅ©swada wa Nyamathira",luo:"Ne Msumeno Moting'ore",kal:"Tar Msumeno Ne Koisiet",kam:"Soma MÅ©swaa wa Vata"},"View Official Document":{en:"View Official Document",sw:"Tazama Hati Rasmi",ki:"Wona KÄ©mÅ©mbiro KÄ©a Nyamathira",luo:"Ne Waraka Moting'ore",kal:"Tar Kaimutiet Ne Koisiet",kam:"Soma Wathi wa Vata"},"View Official":{en:"View Official",sw:"Rasmi",ki:"Wona Nyamathira",luo:"Ne Moting'ore",kal:"Tar Koisiet",kam:"Vata"},"View Treasury Source":{en:"View Treasury Source",sw:"Tazama Chanzo cha Hazina",ki:"Wona Gatiba ka Igitio",luo:"Ne Kanyo Mar Pesa",kal:"Tar Kapisiet Ne Kapisiet",kam:"Soma KÄ©ndÅ© kya TalamÅ©"},"View all events â":{en:"View all events â",sw:"Tazama matukio yote â",ki:"Wona mĩĩra yothe â",luo:"Ne timbe duto â",kal:"Tar aunet somiik â",kam:"Soma mÄ©vomo yonthe â"},"View official source":{en:"View official source",sw:"Tazama chanzo rasmi",ki:"Wona gatiba kÄ©a nyamathira",luo:"Ne kanyo moting'ore",kal:"Tar kanyisiet ne koisiet",kam:"Soma kÄ©ndÅ© kya vata"},"View the intro & onboarding guide":{en:"View the intro & onboarding guide",sw:"Tazama utangulizi na mwongozo",ki:"Wona mÅ©thukuma na Å©rÅ©gamÄ©rÄ©ri wa kwambÄ©rÄ©ria",luo:"Ne chakruok kod ranyisi mar chopo",kal:"Tar kaimutiet ne kanyisiet ne kanyiso",kam:"Soma wathÅ©ndÅ©lÄ©lo na wathi wa kÅ©kwata na kÅ©manya"},"What You Can Do Now":{en:"What You Can Do Now",sw:"Unachoweza Kufanya Sasa",ki:"ŨrÄ©a ŨngÄ©ka RÄ©u",luo:"Mano Ma Inyalo Timony",kal:"Kaimutiet Ne Inye Kiny",kam:"ŨndÅ© Ũtonya KwÄ©kĩĩa Ĩndĩĩ"},"What You Can Do":{en:"What You Can Do",sw:"Unachoweza Kufanya",ki:"ŨrÄ©a ŨngÄ©ka",luo:"Mano Ma Inyalo Timony",kal:"Kaimutiet Ne Inye",kam:"ŨndÅ© Ũtonya KwÄ©ka"},"What changes":{en:"What changes",sw:"Kinachobadilika",ki:"MarÄ©gÅ©rÅ©rÅ©ko marÄ©kÅ©",luo:"Kanyiso mage",kal:"Kanyiso nee",kam:"MambÄ©lÄ©lyo meva"},"What happens next":{en:"What happens next",sw:"Kinachofuata",ki:"NÄ© kĩĩ gÄ©gathire Å©go",luo:"Ang'o manyikire bang'e",kal:"Kainet ne kaimutiet",kam:"KyatÅ©mÄ©ka ata Ä©ndĩĩ"},"What it is":{en:"What it is",sw:"Ni nini",ki:"NÄ©atÄ©a",luo:"Ang'o en",kal:"Kainet nege",kam:"NÄ© kyaÅ©"},"Who is affected":{en:"Who is affected",sw:"Nani anaathirika",ki:"Nũũ Å©hÅ©thagÄ©rÄ©irÅ©o",luo:"Ng'a maol",kal:"Ng'a nege",kam:"Nũũ Å©kwatie taÅ©"},"Why CLICK?":{en:"Why CLICK?",sw:"Kwa Nini CLICK?",ki:"NÄ©kÄ© CLICK?",luo:"Nga CLICK?",kal:"Nga CLICK?",kam:"NÄ©kÄ© CLICK?"},"Write Response":{en:"Write Response",sw:"Andika Jibu",ki:"AndÄ©ka Cokera",luo:"Ndiko Dwaro",kal:"Tule Kaimutiet",kam:"AndÄ©ka KÅ©sÅ©nga"},"Write a reply...":{en:"Write a reply...",sw:"Andika jibu...",ki:"AndÄ©ka cokera...",luo:"Ndiko dware...",kal:"Tule kaimutiet...",kam:"AndÄ©ka kÅ©sÅ©nga..."},"Write to your representative":{en:"Write to your representative",sw:"Andikia mwakilishi wako",ki:"AndÄ©ka kÅ©rÄ© mÅ©kÄ©rÅ©kÄ©ria waku",luo:"Ndiko ne jakonyeu",kal:"Tule nit ne tiliat ne konyit",kam:"AndÄ©ka kwa mÅ©sumbÄ©li waku"},"Write your legal guidance...":{en:"Write your legal guidance...",sw:"Andika ushauri wako wa kisheria...",ki:"AndÄ©ka Å©tongoria waku wa watho...",luo:"Ndiko ranyisi mari chiendni...",kal:"Tule kaimutiet ne lopo negei ne konyit...",kam:"AndÄ©ka Å©taana waku wa watho..."},"Your County":{en:"Your County",sw:"Kaunti Yako",ki:"BÅ©rÅ©ri Waku",luo:"Gweng' Mari",kal:"Tugunet Nenyin",kam:"KaÅ©nÄ© Yaku"},"Your Items":{en:"Your Items",sw:"Vipengele Vyako",ki:"MÄ©hÄ©rÄ©ga Yaku",luo:"Gikoneu",kal:"Kaimutiet Nenyin",kam:"MÄ©thÄ©kÄ© Yaku"},"Your account does not have admin privileges.":{en:"Your account does not have admin privileges.",sw:"Akaunti yako haina mamlaka ya msimamizi.",ki:"AkaÅ©ntÄ© yaku nÄ©ndÄ©na Å©hoti wa Å©thigithania.",luo:"Akaunti mari onge teko mar riwo.",kal:"Akauntiet nenyin neget ne koisto.",kam:"AkaÅ©ndi yaku yinaa na Å©kombo wa kÅ©tw'Ä©ka mÅ©tavany'a."},"Your event will be reviewed by our moderators.":{en:"Your event will be reviewed by our moderators.",sw:"Tukio lako litakaguliwa na wasimamizi wetu.",ki:"Mũĩra waku nĩũgÅ©thikÄ©rÄ©rio nÄ© atongoria eitÅ©.",luo:"Timbeni ibiro noni gi jori wadu mag kony.",kal:"Aunet nenyin neget ne kaimutiet ne konyit.",kam:"MÅ©vomo waku Å©kalÅ©lÅ©ka nÄ© atw'aa maÅ©ndÅ© maitÅ©."},"Your preferences have been updated.":{en:"Your preferences have been updated.",sw:"Mapendekezo yako yameboreshwa.",ki:"MarÄ©gÅ©rÅ©rÅ©ko maku nÄ©mathire kÅ©hÅ©thagÄ©rÄ©rÅ©o.",luo:"Gima idwaro osetim.",kal:"Kaimutiet nenyin neget ne konyit.",kam:"ŨndÅ© wa kwenda nÅ©kÅ©vathe."},"Youth Impact Tags":{en:"Youth Impact Tags",sw:"Alama za Athari kwa Vijana",ki:"IthathÄ© cia MarÄ©gÅ©rÅ©rÅ©ko KÅ©rÄ© AndÅ© Anini",luo:"Ndiko Mar Konyu Mar Nyathi",kal:"Kaimutiet Ne Kokisto Mar Konyu",kam:"MaÄ©ka Ma Ũkwatyo wa AndÅ© MaÅ©nini"},"Youth Impacts":{en:"Youth Impacts",sw:"Athari kwa Vijana",ki:"MarÄ©gÅ©rÅ©rÅ©ko kÅ©rÄ© AndÅ© Anini",luo:"Mar Konyu Mar Nyathi",kal:"Kaimutiet Ne Kokisto Mar Konyu",kam:"Myaka Ya AndÅ© MaÅ©nini"},clicks:{en:"clicks",sw:"mibofyo",ki:"mÄ©cungÅ©ko",luo:"mienge",kal:"koyo",kam:"mÄ©cungÅ©ko"},obligations:{en:"obligations",sw:"wajibu",ki:"matumÄ©ngÄ©rÄ©ko",luo:"kaka nyaka gitim",kal:"kaimutietit",kam:"mako makwata"},or:{en:"or",sw:"au",ki:"kana",luo:"kata",kal:"nee",kam:"kana"},steps:{en:"steps",sw:"hatua",ki:"makoro",luo:"manyalo",kal:"kibo",kam:"mÄ©tÅ©lÅ©lo"},"ð One-Page Briefing":{en:"ð One-Page Briefing",sw:"ð Muhtasari wa Ukurasa Mmoja",ki:"ð MÅ«rÄi Å«mwe wa rÄ©thathi",luo:"ð Koro mar Ngero Achiel",kal:"ð Kiboisiek Abich",kam:"ð Ĩweta ya Ĩthangwe YÄ©mwe"},"MANIFESTO MATCH":{en:"PICK & VOTE",sw:"LINGANISHA ILANI",ki:"KŨGEREKANIA ILANI",luo:"PIMO MANIFESTO",kal:"TILIL MANIFESTO",kam:"KŨLIKANYA ILANI"},"Compare manifesto promises blindly":{en:"Compare manifesto promises blindly",sw:"Linganisha ahadi za ilani bila kujua mwenye",ki:"Gerekania mĩĩranÄ©ro ya ilani Å©tekÅ©menya mwene",luo:"Pim singruok mag manifesto ka ok ing'eyo ng'a",kal:"Tilil ng'alekab manifesto ma magenge",kam:"Likanya mathokoa ma ilani Å©taÄ©si mwene"},"Failed to load manifesto cards":{en:"Failed to load manifesto cards",sw:"Imeshindwa kupakia kadi za ilani",ki:"KÅ©rema gÅ©cokia kadi cia ilani",luo:"Ok onyalore yudo kadi mag manifesto",kal:"Mokichomchi kadi che manifesto",kam:"YÄ©semie kÅ©ete makati ma ilani"},"Could not save your result":{en:"Could not save your result",sw:"Imeshindikana kuhifadhi matokeo yako",ki:"NdingÄ©hota kÅ©iga macookio maku",luo:"Ok nyal kano gima oyudo",kal:"Maituyo kosob koitabuk",kam:"NdÄ©tonya kÅ©vitha matunyo maku"},"Result saved to your account":{en:"Result saved to your account",sw:"Matokeo yamehifadhiwa kwenye akaunti yako",ki:"Macookio nÄ©maigÄ©two akaÅ©nti-inÄ© yaku",luo:"Gik moyudi okan e akaunt mari",kal:"Koitabuk kotabugotin akaunt nengung",kam:"Matunyo nÄ©mavithÄ©twe akaÅ©ntinÄ© yaku"},"Choose Election Level":{en:"Choose Election Level",sw:"Chagua Aina ya Uchaguzi",ki:"Thuura MÅ©thia wa Ũthuuri",luo:"Yier Okang' mar Yiero",kal:"Lewen Tabanutiet ne Tilet",kam:"SakÅ©a KÄ©thengo kya ŨsakÅ©o"},"Select Your Priority Issues":{en:"Select Your Priority Issues",sw:"Chagua Masuala Yako ya Kip
543aumbele",ki:"Thuura Maũndũ Maku ma Mbere",luo:"Yier Weche Madongo Ne In",kal:"Lewen Ng'alekuk che Itononitos",kam:"Sakũa Maũndũ Maku ma Mbee"},"Ready to begin?":{en:"Ready to begin?",sw:"Uko tayari kuanza?",ki:"Wĩhaarĩirie kwambĩrĩria?",luo:"Iikori chako?",kal:"Iyanat itoboi?",kam:"Wĩ tayari kwambĩĩa?"},"You will compare anonymous manifesto flashcards and choose the ones that align most with your needs and values.":{en:"You will compare anonymous manifesto flashcards and choose the ones that align most with your needs and values.",sw:"Utalinganisha kadi za ilani zisizojulikana mwenye na kuchagua zile zinazolingana na mahitaji na maadili yako.",ki:"Nĩũkũgerekania kadi cia ilani itarĩ na marĩĩtwa na ũthuure iria ihaanaine na mabataro na mĩthiĩre yaku.",luo:"Ibiro pimo kadi mag manifesto ma ok ong'ere ng'at ma owacho kendo iyiero mago momako gi dwarogi gi timni.",kal:"Itilil kadi che manifesto che ma magenge ak ilewen che yetu ak chebakitos ak boishekuk.",kam:"Ũkalikanya makati ma ilani matekũĩsĩka mwene na ũsakũa ala maĩlyaa na mavata na woni waku."},"Start Manifesto Match":{en:"Start Pick & Vote",sw:"Anza Linganisha Ilani",ki:"Ambĩrĩria Kũgerekania Ilani",luo:"Chak Pimo Manifesto",kal:"Toboi Tilil Manifesto",kam:"Ambĩĩa Kũlikanya Ilani"},"No manifesto pairs found for this office and issue selection yet. Add more manifesto data to expand the game.":{en:"No manifesto pairs found for this office and issue selection yet. Add more manifesto data to expand the game.",sw:"Hakuna jozi za ilani zilizopatikana kwa ofisi hii na uchaguzi wa masuala bado. Ongeza data zaidi ya ilani.",ki:"Gũtirĩ jozi cia ilani ciumĩte nĩ ũndũ wa ofisi ĩno na maũndũ ũthuurĩte. Ongerera data nyingĩ cia ilani.",luo:"Onge jozi mag manifesto moyud ne ofis kod weche miseyiero. Med data mag manifesto.",kal:"Mami jozi che manifesto che kiyumi ofis ne ak ng'alek che ileweni. Mat data alak che manifesto.",kam:"Vai jozi sya ilani ila syũmĩte kwondũ wa ofisi ĩĩ na maũndũ ũsakwĩte. Ongela data mbingĩ ya ilani."},Round:{en:"Round",sw:"Raundi",ki:"Raũndi",luo:"Lwedo",kal:"Raundi",kam:"Raundi"},"Choose the manifesto promises that align more with your priorities.":{en:"Choose the manifesto promises that align more with your priorities.",sw:"Chagua ahadi za ilani zinazolingana zaidi na vipaumbele vyako.",ki:"Thuura mĩĩranĩro ya ilani ĩrĩa ĩhaanaine na maũndũ maku ma mbere.",luo:"Yier singruok mag manifesto momako gi weche madongo ne in.",kal:"Lewen ng'alekab manifesto che yetu ak ng'alekuk che itononitos.",kam:"Sakũa mathokoa ma ilani ala maĩlyaa na maũndũ maku ma mbee."},"Exit Game":{en:"Exit Game",sw:"Toka Mchezoni",ki:"Uma Mathakonĩ",luo:"Wuog e Tugo",kal:"Mengu Tugul",kam:"Uma Mathakonĩ"},"Anonymous Manifesto Card":{en:"Anonymous Manifesto Card",sw:"Kadi ya Ilani Isiyojulikana Mwenye",ki:"Kadi ya Ilani Ĩtarĩ na Rĩĩtwa",luo:"Kadi mar Manifesto Ma Ok Ong'ere Ng'at",kal:"Kadi ne Manifesto ne Magenge",kam:"Kati ya Ilani Ĩtekũĩsĩka Mwene"},"Card A":{en:"Card A",sw:"Kadi A",ki:"Kadi A",luo:"Kadi A",kal:"Kadi A",kam:"Kati A"},"Card B":{en:"Card B",sw:"Kadi B",ki:"Kadi B",luo:"Kadi B",kal:"Kadi B",kam:"Kati B"},"Your choice":{en:"Your choice",sw:"Chaguo lako",ki:"Ũthuuri waku",luo:"Yiero mari",kal:"Leweniegung",kam:"Ũsakũo waku"},"Choose Card A":{en:"Choose Card A",sw:"Chagua Kadi A",ki:"Thuura Kadi A",luo:"Yier Kadi A",kal:"Lewen Kadi A",kam:"Sakũa Kati A"},"Choose Card B":{en:"Choose Card B",sw:"Chagua Kadi B",ki:"Thuura Kadi B",luo:"Yier Kadi B",kal:"Lewen Kadi B",kam:"Sakũa Kati B"},Both:{en:"Both",sw:"Zote Mbili",ki:"Cierĩ",luo:"Giduto Ariyo",kal:"Tugul Aeng'",kam:"Syonthe Ilĩ"},Neither:{en:"Neither",sw:"Hakuna",ki:"Gũtirĩ",luo:"Onge",kal:"Mami",kam:"Vai"},"YOUR ALIGNMENT RESULTS":{en:"YOUR ALIGNMENT RESULTS",sw:"MATOKEO YAKO YA ULINGANIFU",ki:"MACOOKIO MAKU MA ŨHAANAINE",luo:"GIK MOYUDI MAG WINJRUOK",kal:"KOITABUK CHEBO TILIL",kam:"MATUNYO MAKU MA ŨLINGANI"},"Your choices aligned most with these published proposals":{en:"Your choices aligned most with these published proposals",sw:"Chaguo zako zililingana zaidi na mapendekezo haya yaliyochapishwa",ki:"Ũthuuri waku nĩwahaanainire na mataaro maya marutĩtwo",luo:"Yiero magi ne owinjore ahinya gi paro mago moseketi e lela",kal:"Leweniegung kotililchi ng'alek chu
543che kibet",kam:"ŨsakÅ©o waku nÄ©walingana na mathokoa aya mavyitwe"},"Saving your resultâ¦":{en:"Saving your resultâ¦",sw:"Inahifadhi matokeo yakoâ¦",ki:"NÄ©kÅ©iga macookio makuâ¦",luo:"Kano gima oyudiâ¦",kal:"Kosob koitabukâ¦",kam:"KÅ©vitha matunyo makuâ¦"},"Sign in to save your alignment results to your account.":{en:"Sign in to save your alignment results to your account.",sw:"Ingia ili kuhifadhi matokeo yako ya ulinganifu kwenye akaunti yako.",ki:"Toonya nÄ©guo wÄ©ge macookio maku ma Å©haanaine akaÅ©nti-inÄ© yaku.",luo:"Donji mondo ikan gik moyudi mag winjruok e akaunt mari.",kal:"Chut konyit koitabuk chebo tilil akaunt nengung.",kam:"Tonya nÄ©kana wÄ©vithÄ©e matunyo maku akaÅ©ntinÄ© yaku."},"Top alignment":{en:"Top alignment",sw:"Ulinganifu wa juu",ki:"Ũhaanaine wa Mbere",luo:"Winjruok Maduong' Moloyo",kal:"Tilil ne O",kam:"Ũlingani wa Iulu"},"Alignment result":{en:"Alignment result",sw:"Matokeo ya ulinganifu",ki:"Macookio ma Å©haanaine",luo:"Gima oyudi mar winjruok",kal:"Koitabuk chebo tilil",kam:"Matunyo ma Å©lingani"},Alignment:{en:"Alignment",sw:"Ulinganifu",ki:"Ũhaanaine",luo:"Winjruok",kal:"Tilil",kam:"Ũlingani"},"Top matched issues":{en:"Top matched issues",sw:"Masuala yaliyolingana zaidi",ki:"MaÅ©ndÅ© marÄ©a mahaanainire mÅ©no",luo:"Weche mowinjore moloyo",kal:"Ng'alek che kotililchi missing",kam:"MaÅ©ndÅ© ala malinganire mbingÄ©"},"No strong issue match recorded":{en:"No strong issue match recorded",sw:"Hakuna ulinganifu wa nguvu uliorekodiwa",ki:"GÅ©tirÄ© Å©haanaine mÅ©rÅ©mu wandÄ©kÄ©two",luo:"Onge winjruok motegno mondiki",kal:"Mami tilil ne kimnatet ne kisirteni",kam:"Vai Å©lingani wa vinya wandÄ©kÄ©twe"},"What this means":{en:"What this means",sw:"Hii inamaanisha nini",ki:"Ũũ nÄ© kuuga atÄ©a",luo:"Ma tiende en ang'o",kal:"Ne nyolilen ne",kam:"Ũũ nÄ© kwasya ata"},"These results reflect the proposals you selected during the blind manifesto comparison.":{en:"These results reflect the proposals you selected during the blind manifesto comparison.",sw:"Matokeo haya yanaonyesha mapendekezo uliyochagua wakati wa kulinganisha ilani bila kujua mwenye.",ki:"Macookio maya nÄ©monanagia mataaro marÄ©a wathuurire hÄ©ndÄ© ya kÅ©gerekania ilani Å©tekÅ©menya mwene.",luo:"Gik moyudgi nyiso paro mane iyiero kane ipimo manifesto ka ok ing'eyo ng'a.",kal:"Koitabuk chu kobwatu ng'alek che ileweni anyun ne kotilili manifesto magenge.",kam:"Matunyo aya nÄ©monanaa mathokoa ala wasakÅ©ie Ä©vinda ya kÅ©likanya ilani Å©taÄ©si mwene."},"They do not tell you who to vote for.":{en:"They do not tell you who to vote for.",sw:"Hayakuambii ni nani wa kumpigia kura.",ki:"MatikwÄ©raga nÅ© wa gÅ©torera.",luo:"Ok onyisi ng'at monego ichwo.",kal:"Matwen ng'o ne imuche.",kam:"MateekwÄ©aa nũũ wa kÅ©kÅ©nÄ©a kÅ©la."},"Use them as a starting point to explore candidate plans more carefully.":{en:"Use them as a starting point to explore candidate plans more carefully.",sw:"Yatumie kama mwanzo wa kuchunguza mipango ya wagombea kwa makini zaidi.",ki:"MahÅ©thÄ©re ta kÄ©ambÄ©rÄ©ria gÄ©a gÅ©tuÄ©ria mÄ©bango ya athuurani na Å©menyereri.",luo:"Tigi kaka chakruok mar nono chenro mag joma ochung' gi paro maber.",kal:"Boishen kosich toboet ne kogerge plan chebo kandiidet kogeer.",kam:"MatumÄ©e ta wambĩĩo wa kÅ©kunÄ©kÄ©lya mÄ©vango ya asakÅ©i vinya mÅ©no."},"Play Again":{en:"Play Again",sw:"Cheza Tena",ki:"Thaaka RÄ©ngÄ©",luo:"Tug Kendo",kal:"Tugen Ake",kam:"ThaÅ©ka ĨngÄ©"},"Revisit Choices":{en:"Revisit Choices",sw:"Pitia Tena Chaguo",ki:"Cookerera Ũthuuri",luo:"Dog Ine Yiero",kal:"Wendi Lewenisiek",kam:"SÅ©vÄ©a ŨsakÅ©o"},"Vote by issues, not pressure":{en:"Vote by issues, not pressure",sw:"Piga kura kwa masuala, si shinikizo",ki:"Tora nÄ© Å©ndÅ© wa maÅ©ndÅ©, ti Å©hinyanio",luo:"Chwo kuom weche, ok kuom achuna",kal:"Mut bo ng'alek, ma bo kotomet",kam:"KÅ©nÄ©a nÅ©ndÅ© wa maÅ©ndÅ©, ti nÅ©ndÅ© wa Å©kÅ©mu"},"Always verify against official manifesto sources.":{en:"Always verify against official manifesto sources.",sw:"Daima thibitisha dhidi ya vyanzo rasmi vya ilani.",ki:"Hingo ciothe Ä©kÄ©ra hinya na ithimi cia ilani cia Å©thamaki.",luo:"Kinde duto nyis adieri kuom kuonde manifesto mag adier.",kal:"Tugul kasit en kaboishonik chebo manifesto chebo bisiek.",kam:"Mavinda onthe sÄ©sya na mbau sya ilani sya kÄ©seo."},"Failed to load past results":{en:"Failed to load past results",sw:"Imeshindwa kupakia matokeo ya zamani",ki:"KÅ©rema gÅ©cokia macookio ma tene",luo:"Ok onyalore yudo gik mane oyudi mokalo",kal:"Mokichomchi koitabuk che kowo",kam:"YÄ©semie kÅ©ete matunyo ma tene"},"Could not delete result":{en:"Could not delete result",sw:"Imeshindikana kufuta matokeo",ki:"NdingÄ©hota kÅ©niina macookio",luo:"Ok nyal golo gima oyudi",kal:"Maituyo koyaisto koitabuk",kam:"NdÄ©tonya kÅ©vanga matunyo"},"Result deleted":{en:"Result deleted",sw:"Matokeo yamefutwa",ki:"Macookio nÄ©maniinÄ©two",luo:"Gima oyudi osegol",kal:"Koitabuk koyaiston",kam:"Matunyo nÄ©mavangÄ©twe"},"Your past Manifesto Match results":{en:"Your past Pick & Vote results",sw:"Matokeo yako ya zamani ya Linganisha Ilani",ki:"Macookio maku ma tene ma KÅ©gerekania Ilani",luo:"Gik moyudi mokalo mag Pimo Manifesto",kal:"Koitabuk chebo kowo che Tilil Manifesto",kam:"Matunyo maku ma tene ma KÅ©likanya Ilani"},"No saved results yet. Play a round to save your first alignment.":{en:"No saved results yet. Play a round to save your first alignment.",sw:"Hakuna matokeo yaliyohifadhiwa bado. Cheza raundi ili kuhifadhi ulinganifu wako wa kwanza.",ki:"GÅ©tirÄ© macookio maigÄ©two. Thaaka raÅ©ndi nÄ©guo wÄ©ge Å©haanaine waku wa mbere.",luo:"Onge gik mane okan. Tug lwedo mondo ikan winjruok mari mokwongo.",kal:"Mami koitabuk che kosobitos. Tugen raundi konyit koitabuk nengung netai.",kam:"Vai matunyo mavithÄ©twe. ThaÅ©ka raundi nÄ©kana wÄ©vithÄ©e Å©lingani waku wa mbee."},"Top:":{en:"Top:",sw:"Juu:",ki:"Mbere:",luo:"Maduong':",kal:"Ne O:",kam:"Iulu:"},"No result":{en:"No result",sw:"Hakuna matokeo",ki:"GÅ©tirÄ© macookio",luo:"Onge gima oyudi",kal:"Mami koitabuk",kam:"Vai matunyo"},"Delete result":{en:"Delete result",sw:"Futa matokeo",ki:"Niina macookio",luo:"Gol gima oyudi",kal:"Yaisto koitabuk",kam:"Vanga matunyo"},Delete:{en:"Delete",sw:"Futa",ki:"Niina",luo:"Gol",kal:"Yaisto",kam:"Vanga"},"Pick the promises. Skip the noise.":{en:"Pick the promises. Skip the noise.",sw:"Chagua ahadi. Acha kelele.",ki:"Thuura mĩĩranÄ©ro. Tiga inegene.",luo:"Yier singruok. We koko.",kal:"Lewen ng'alek. Bakach koros.",kam:"SakÅ©a mathokoa. Eka kelele."},"A blind tournament of manifesto promises. No names, no parties â just ideas. You decide who wins your vote.":{en:"A blind tournament of manifesto promises. No names, no parties â just ideas. You decide who wins your vote.",sw:"Mashindano ya ahadi za ilani bila kujua mwenye. Hakuna majina, hakuna vyama â mawazo tu. Wewe unaamua mshindi.",ki:"Mathako ma mĩĩranÄ©ro ya ilani Å©tekÅ©menya mwene. GÅ©tirÄ© marĩĩtwa, gÅ©tirÄ© macama â meciiria tu. NÄ©we Å©tua wa atoorane.",luo:"Tugo mar singruok mag manifesto ka ok ing'eyo ng'a. Onge nyinge, onge parties â paro kende. In ema ineno ng'a moloyo.",kal:"Tugik che ng'alekab manifesto ma magenge. Mami kainetab, mami parties â ng'alek kityo. Iyni ko ile ng'o ne lewen.",kam:"Mathako ma mathokoa ma ilani Å©taÄ©si mwene. Vai masyÄ©twa, vai macama â kÄ©lio kyoka. We nÄ©we wÄ©kalya Å©la wÄ©sa."},"How many rounds?":{en:"How many rounds?",sw:"Mizunguko mingapi?",ki:"Mathondeka maigana?",luo:"Tugo adi?",kal:"Tugik tuu?",kam:"Mathako maana?"},"Pick your match length. Short and sweet, or a deep dive â totally up to you.":{en:"Pick your match length. Short and sweet, or a deep dive â totally up to you.",sw:"Chagua urefu wa mchezo. Mfupi au mrefu â ni juu yako.",ki:"Thuura Å©raihu wa mathako. Manini kana maingÄ© â nÄ©we.",luo:"Yier rom mar tugo. Machuok kata maduong' â en mari.",kal:"Lewen koror ne tuget. Ngeny anan koretab â ngung.",kam:"SakÅ©a Å©asa wa mathako. Manini kana mailu â nÄ©we."},rounds:{en:"rounds",sw:"mizunguko",ki:"mathondeka",luo:"tugo",kal:"tugik",kam:"mathako"},round:{en:"round",sw:"mzunguko",ki:"mÅ©thondeka",luo:"tugo",kal:"tuget",kam:"mÅ©thako"},"Quick (2)":{en:"Quick (2)",sw:"Haraka (2)",ki:"Narua (2)",luo:"Mapiyo (2)",kal:"Pesie (2)",kam:"MÄ©tÅ©kÄ© (2)"},"Standard (5)":{en:"Standard (5)",sw:"Kawaida (5)",ki:"MÅ©tugo (5)",luo:"Pile (5)",kal:"Boisietab (5)",kam:"Kawaida (5)"},"Deep (10)":{en:"Deep (10)",sw:"Kina (10)",ki:"KÅ©rika (10)",luo:"Matut (10)",kal:"Loo (10)",kam:"KÄ©na (10)"},"Marathon (All)":{en:"Marathon (All)",sw:"Marathon (Yote)",ki:"Marathon (Mothe)",luo:"Marathon (Duto)",kal:"Marathon (Tugul)",kam:"Marathon (Yonthe)"},"Anthem music":{en:"Anthem music",sw:"Muziki wa wimbo",ki:"MÅ©gambo wa rwÄ©mbo",luo:"Wer mar piny",kal:"Tienywet ne emet",kam:"Mbathi ya wÄ©mbo"},Play:{en:"Play",sw:"Cheza",ki:"Thakia",luo:"Tug",kal:"Tuget",kam:"ThaÅ©ka"},Pause:{en:"Pause",sw:"Sitisha",ki:"RÅ©gama",luo:"Chung",kal:"Tinye",kam:"Tũũa"},Mute:{en:"Mute",sw:"Nyamazisha",ki:"Kira",luo:"Ling'",kal:"Tinyei",kam:"Kira"},Unmute:{en:"Unmute",sw:"Rejesha sauti",ki:"Cookia mÅ©gambo",luo:"Duogo dwol",kal:"Cherchin tienywet",kam:"Cookya mÅ©gambo"},"Let's play!":{en:"Let's play!",sw:"Tucheze!",ki:"Reke tÅ©thakie!",luo:"Wee watug!",kal:"Kingatugen!",kam:"TÅ©thaÅ©ke!"},"A vs B":{en:"A vs B",sw:"A dhidi ya B",ki:"A dhidi ya B",luo:"A vs B",kal:"A vs B",kam:"A vs B"},"On June 25th, 2024, Kenyan Gen Z took to the streets to protest the Finance Bill. But this wasn't because they were uninformed â in fact, it was the opposite. Young people across the country discovered the bill early, broke it down online, translated it into local languages, and mobilised themselves across TikTok, Twitter and WhatsApp.":{en:"On June 25th, 2024, Kenyan Gen Z took to the streets to protest the Finance Bill. But this wasn't because they were uninformed â in fact, it was the opposite. Young people across the country discovered the bill early, broke it down online, translated it into local languages, and mobilised themselves across TikTok, Twitter and WhatsApp.",sw:"Tarehe 25 Juni 2024, vijana w
543a Kenya (Gen Z) waliingia mitaani kupinga Mswada wa Fedha. Lakini haikuwa kwa sababu hawakuwa na taarifa â kinyume chake kabisa. Vijana kote nchini waligundua mswada mapema, wakauchambua mtandaoni, wakautafsiri kwa lugha za kienyeji, na wakajipanga TikTok, Twitter na WhatsApp.",ki:"Mweri wa 25 MÅ©gwanja 2024, andÅ© ethÄ© a Kenya (Gen Z) nÄ©moimire njÄ©ra-inÄ© kÅ©regana na MÅ©swada wa Mbeca. No ti tondÅ© matiarÄ© na Å©menyo â nÄ© Å©rÄ©a kwarÄ©. AndÅ© ethÄ© kÅ©rÄ©a guothe bÅ©rÅ©ri-inÄ© nÄ©moonire mÅ©swada o tene, makĩũtaÅ©ra mÅ©tandao-inÄ©, makĩũgarÅ©ra na thiomi cia gÅ©kÅ©, na makĩĩhaarÄ©ria TikTok, Twitter na WhatsApp.",luo:"E June 25, 2024, jorieny mag Kenya (Gen Z) nodonjo e yore mondo gikwed Chik mar Pesa (Finance Bill). To mani ne ok timore nikech ne gionge gi ngeyo â to kuom adier, ne en ma opogore. Jomatindo e piny ngima nofwenyo chikno motelo, gimanyo tiende e mtandao, gilokore e dhok mag gweng', kendo gichanore kuom TikTok, Twitter gi WhatsApp.",kal:"En arawanit ne 25 ne Juni, 2024, lagok che Kenya (Gen Z) kobwa kogol kotek Finance Bill. Lakini mami amun ma kimite ng'omnatet â kotugul ko kotyech. Lagok che mengech en emet komuche bill ne kong'aliny, kotinyei en internet, kowechi e ng'aleg'che maini, ak kobwa keny TikTok, Twitter ak WhatsApp.",kam:"Mwei wa 25 wa Mwei wa ThanthatÅ©, mwaka wa 2024, anake ma Kenya (Gen Z) nÄ©maaumÄ©ie nzÄ©a-inÄ© kÅ©kanÄ©a MwambÄ©lÄ©lyo wa Mbesa. ĨndÄ© ti nÅ©ndÅ© matayÄ©sÄ© â kÅ©mũũma kwakwa, nÄ©kwaÄ© kÄ©ndÅ© kÄ©ngÄ©. Anake nthÄ©nÄ© wa nthÄ© yonthe nÄ©mamanyie mwambÄ©lÄ©lyo Å©su mbee, mamÅ©taÅ©a mÅ©tandao-inÄ©, mamÅ©taÅ©a kwa ndeto sya kÄ©sio, na mekw'Ä©thÄ©wÄ©a TikTok, Twitter na WhatsApp."},"So if awareness was so high, why did it still escalate into mass protest? Because awareness alone wasn't enough. The action wasn't structured â people knew what was happening, but not when to intervene, which stage of the policy process mattered most, or what actions would actually influence outcomes. There was no direct channel between citizens and decision-makers. Information was fragmented across platforms â some accurate, some exaggerated, none centralised. And there was no continuity after the protests.":{en:"So if awareness was so high, why did it still escalate into mass protest? Because awareness alone wasn't enough. The action wasn't structured â people knew what was happening, but not when to intervene, which stage of the policy process mattered most, or what actions would actually influence outcomes. There was no direct channel between citizens and decision-makers. Information was fragmented across platforms â some accurate, some exaggerated, none centralised. And there was no continuity after the protests.",sw:"Basi ikiwa uelewa ulikuwa juu kiasi hicho, kwa nini bado uliibuka kuwa maandamano makubwa? Kwa sababu uelewa pekee haukutosha. Hatua hazikuwa zimepangwa â watu walijua kinachoendelea, lakini hawakujua wakati wa kuingilia, hatua ipi ya sera ilikuwa muhimu zaidi, au ni vitendo vipi vingebadilisha matokeo. Hakukuwa na njia ya moja kwa moja kati ya raia na watoa-maamuzi. Taarifa zilikuwa zimetawanyika â baadhi sahihi, baadhi za kutia chumvi, hakuna iliyokusanywa pamoja. Na hakukuwa na mwendelezo baada ya maandamano.",ki:"NÄ© kĩĩ gÄ©atÅ©mire, o na Å©menyo warÄ© mÅ©nene Å©guo, Å©ndÅ© Å©cio Å©kÄ©neneha Å©gÄ©tuÄ©ka ngũĩ nene? NÄ© tondÅ© Å©menyo wiki ndwaiganire. CiÄ©ko itiarÄ© na mÅ©bango â andÅ© nÄ©mamenyaga Å©rÄ©a kwarÄ©, no matiamenyaga rÄ©rÄ©a rÄ©a kÅ©ingÄ©ra, hatua Ä©rÄ©kÅ© ya mÅ©taratara wa mawatho yarÄ© ya bata mÅ©no, kana nÄ© ciÄ©ko irÄ©kÅ© ingÄ©agarÅ©rire maÅ©ndÅ©. GÅ©tiarÄ© njÄ©ra ya nyita ya raia na arÄ©a matuaga matua. Ũhoro warÄ© mÅ©tarÅ©rane mÄ©tandao-inÄ© â Å©mwe wa ma, Å©mwe wa kÅ©ongerera, na gÅ©tirÄ© Å©rutÄ©irwo handÅ© hamwe. Na gÅ©tiarÄ© na mÅ©thia thuutha wa ngũĩ.",luo:"Omiyo kapo ni ngeyo ne ngima ahinya, ang'o nomiyo pod owuok kobedo akeyo maduong'? Nikech ngeyo kende ne ok oromo. Tim ne ok ochan â ji nong'eyo gima timore, to ne ok ging'eyo kinde madwarore donjo, kar ang'o e yor chik momako moloyo, kata gin tim mage manyalo loko gik moko. Ne onge yor mar wuoyo achiel kachiel e kind oganda gi jotelo. Weche nopogore e platforms â moko ne adier, moko ne ng'eny moloyo, kendo onge mago manochan e kar achiel. Kendo onge nyime mar tich bang' akey
543o.",kal:"Komie ng'omnatet ko kararan, amun ne kibwa kotugul akoek akeyo neo? Amun ng'omnatet ake mami amii. Tugul mami kibchei â bik kong'eny ne timten, lakini mami kong'eny en saa ne kimoche kobwany, koristo ne en chiknat ne kararan, anan ko tugul che kibwa koystoi anyune. Mami yoo ne kararan en bik ak chuget. Ng'omnatet kosobe en platforms â alak iman, alak kogonon, mami che kotugek en bo agenge. Ak mami nyime ne kibwa keny akeyo.",kam:"KwasÅ© ethÄ©wa wÄ©si waÄ© wa ngÅ©mu Å©u, nÄ©kyaÅ© kyatumie kÄ©ndÅ© kÄ©su kyathiÄ© na mbee na kÄ©tuÄ©ka mwathaano mÅ©nene? NÄ© nÅ©ndÅ© wÄ©si wonzene ndwaiganie. MÄ©thwi ndyaÄ© na mbango â andÅ© nÄ©maÄ©sÄ© kÄ©la kyaÄ© kyaendeka, Ä©ndÄ© matayÄ©sÄ© Ä©vinda ya kũĩngÄ©a, mwathÄ©lÄ©syo wÄ©va wa mwathani waÄ© wa vata mÅ©no, kana mÄ©thwi yÄ©va ngÄ©alyÅ©le maÅ©ndÅ©. VaÄ© nzÄ©a ya kÅ©taÅ©ka katÄ© wa andÅ© na ala matuaa matua. Ũvoo waÄ© mũĩthanÄ©we mÄ©tandao-inÄ© â Å©ngÄ© wa w'o, Å©ngÄ© wa kÅ©ongela, vaÄ© Å©mwe waÄ© Å©kÅ©ngÄ©twe vamwe. Na vaÄ© kÅ©endeea Ä©tina wa mwathaano."},"CLICK was built to fix exactly that â to turn raw civic energy into structured, informed, continuous action. Discover bills early. Understand them in your language. Simulate how they hit your wallet. Match candidates to your real priorities. And take action at the stage that actually matters â before they decide.":{en:"CLICK was built to fix exactly that â to turn raw civic energy into structured, informed, continuous action. Discover bills early. Understand them in your language. Simulate how they hit your wallet. Match candidates to your real priorities. And take action at the stage that actually matters â before they decide.",sw:"CLICK ilijengwa kutatua hili haswa â kubadilisha nguvu ya kiraia kuwa hatua iliyopangwa, yenye taarifa, na inayoendelea. Gundua miswada mapema. Ielewe kwa lugha yako. Iga jinsi inavyogusa mfuko wako. Linganisha wagombea na vipaumbele vyako halisi. Na chukua hatua katika hatua inayohesabika â kabla hawajaamua.",ki:"CLICK nÄ© yaakirwo kÅ©rÅ©nga Å©ndÅ© Å©cio kĩũmbe â kÅ©garÅ©ra hinya wa raia Å©tuÄ©ke ciÄ©ko irÄ© na mÅ©bango, Å©menyo na gÅ©thiÄ© na mbere. Mona miswada o tene. MÄ©taÅ©kÄ©rwo na rÅ©thiomi rwaku. Ona Å©rÄ©a Ä©gÅ©tÅ©ma mbeca ciaku. Ringithania andÅ© a wÄ©ra na maÅ©ndÅ© marÄ©a marÄ© na bata harÄ©we. Na oya itemi hatua-inÄ© Ä©rÄ©a ya bata kÅ©na â mbere matanatua.",luo:"CLICK nochan mondo olos mano kendo â mondo olok teko mar oganda obed tim mochan, man-gi ngeyo, kendo madhi nyime. Yud chike motelo. Wing'gi e dhok mari. Tem kaka gimulo ofuk-pesa mari. Rwak jokwong' kuom gik miketo malo. Kendo tim tich e okang' ma adier dwarore â kapod pok gingiyo.",kal:"CLICK kibchei kotum mano â kogeer kimnatetab bik komuch kotum tugul che kibchei, che ng'omnotin, ak che madhi nyime. Yud chike en kong'aliny. Ng'omnoti en ng'aleg'ng'ung'. Tem kaka itoreti pesa-ng'ung'. Ribiri jokwo en gik che kararan en akwekuk. Ak tom tugul en hatua ne kararan ko iman â kong'aliny mata kobwa keny.",kam:"CLICK nÄ©yaakiwe kÅ©seÅ©vya Å©ndÅ© Å©su w'o â kÅ©alyÅ©la vinya wa andÅ© Å©twÄ©ke mÄ©thwi Ä©lÄ© na mbango, na Å©manyi, na Ä©thi na mbee. Mona miswada mbee. MÄ©elewe na ndeto yaku. Iga Å©ndÅ© yÄ©ka mbesa syaku. RinganÄ©a ala makwendaa na maÅ©ndÅ© ala maÄ© na vata kwaku. Na osa kÄ©thimo hatua-inÄ© Ä©la yÄ© na vata mÅ©nene â matanaa Å©tua."},"Built in 2026 by":{en:"Built in 2026 by",sw:"Imejengwa mwaka 2026 na",ki:"NÄ© yaakirwo mwaka wa 2026 nÄ©",luo:"Noger e higa mar 2026 gi",kal:"Kibchei en kenyit ne 2026 ko",kam:"NÄ©yaakiwe mwaka wa 2026 nÄ©"},", a Kenyan from Kiambu County, while at Smith College.":{en:", a Kenyan from Kiambu County, while at Smith College.",sw:", Mkenya kutoka Kaunti ya Kiambu, akiwa Smith College.",ki:", MÅ©kenya kuuma KaÅ©nti ya Kiambu, arÄ© Smith College.",luo:", Ja-Kenya moa e County mar Kiambu, kane en Smith College.",kal:", Chi Kenya en Kaunti ne Kiambu, en Smith College.",kam:", MÅ©kenya kuma KaÅ©nti ya Kiambu, aÄ© Smith College."},"From the streets to the system â civic power, structured.":{en:"From the streets to the system â civic power, structured.",sw:"Kutoka mitaani hadi mfumoni â nguvu ya kiraia, iliyopangwa.",ki:"Kuuma njÄ©ra-inÄ© nginya mÅ©taratara-inÄ© â hinya wa raia, Å©rÄ© na mÅ©bango.",luo:"A e yore nyaka e chenro â teko mar oganda, mochan maber.",kal:"Kong'eet en oratiet agoi en chenronik â kimnatetab bik, kibchei.",kam:"Kuma nzÄ©a-inÄ© kÅ©vika mÅ©vango-inÄ© â vinya wa andÅ©, Å©lÄ© na mbango."}}
vendor: 4,660 bytes, line 543
543,_K={en:"English",sw:"Kiswahili",ki:"Gĩkũyũ",luo:"Dholuo",kal:"Kalenjin",kam:"Kĩkamba"},MT=p.createContext({lang:"en",setLang:()=>{},toggle:()=>{},t:e=>e}),Re=()=>p.useContext(MT),_p=["en","sw","ki","luo","kal","kam"],SK=({children:e})=>{const[t,n]=p.useState(()=>localStorage.getItem("click-lang")||"en"),a=p.useCallback(s=>{localStorage.setItem("click-lang",s),n(s)},[]),i=p.useCallback(()=>{n(s=>{const l=_p.indexOf(s),u=_p[(l+1)%_p.length];return localStorage.setItem("click-lang",u),u})},[]),r=p.useCallback((s,l)=>{const u=jK[s];return u&&u[t]?u[t]:t==="sw"&&l?l:s},[t]);return o.jsx(MT.Provider,{value:{lang:t,setLang:a,toggle:i,t:r},children:e})};var NK=p.createContext(void 0);function Sl(e){const t=p.useContext(NK);return e||t||"ltr"}var Sp=0;function _k(){p.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??r1()),document.body.insertAdjacentElement("beforeend",e[1]??r1()),Sp++,()=>{Sp===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Sp--}},[])}function r1(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Np="focusScope.autoFocusOnMount",Cp="focusScope.autoFocusOnUnmount",s1={bubbles:!1,cancelable:!0},CK="FocusScope",lf=p.forwardRef((e,t)=>{const{loop:n=!1,trapped:a=!1,onMountAutoFocus:i,onUnmountAutoFocus:r,...s}=e,[l,u]=p.useState(null),c=fn(i),h=fn(r),d=p.useRef(null),m=Pe(t,g=>u(g)),f=p.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;p.useEffect(()=>{if(a){let g=function(k){if(f.paused||!l)return;const j=k.target;l.contains(j)?d.current=j:Wi(d.current,{select:!0})},x=function(k){if(f.paused||!l)return;const j=k.relatedTarget;j!==null&&(l.contains(j)||Wi(d.current,{select:!0}))},w=function(k){if(document.activeElement===document.body)for(const S of k)S.removedNodes.length>0&&Wi(l)};document.addEventListener("focusin",g),document.addEventListener("focusout",x);const v=new MutationObserver(w);return l&&v.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",x),v.disconnect()}}},[a,l,f.paused]),p.useEffect(()=>{if(l){l1.add(f);const g=document.activeElement;if(!l.contains(g)){const w=new CustomEvent(Np,s1);l.addEventListener(Np,c),l.dispatchEvent(w),w.defaultPrevented||(TK(RK(RT(l)),{select:!0}),document.activeElement===g&&Wi(l))}return()=>{l.removeEventListener(Np,c),setTimeout(()=>{const w=new CustomEvent(Cp,s1);l.addEventListener(Cp,h),l.dispatchEvent(w),w.defaultPrevented||Wi(g??document.body,{select:!0}),l.removeEventListener(Cp,h),l1.remove(f)},0)}}},[l,c,h,f]);const y=p.useCallback(g=>{if(!n&&!a||f.paused)return;const x=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,w=document.activeElement;if(x&&w){const v=g.currentTarget,[k,j]=EK(v);k&&j?!g.shiftKey&&w===j?(g.preventDefault(),n&&Wi(k,{select:!0})):g.shiftKey&&w===k&&(g.preventDefault(),n&&Wi(j,{select:!0})):w===v&&g.preventDefault()}},[n,a,f.paused]);return o.jsx(we.div,{tabIndex:-1,...s,ref:m,onKeyDown:y})});lf.displayName=CK;function TK(e,{select:t=!1}={}){const n=document.activeElement;for(const a of e)if(Wi(a,{select:t}),document.activeElement!==n)return}function EK(e){const t=RT(e),n=o1(t,e),a=o1(t.reverse(),e);return[n,a]}function RT(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:a=>{const i=a.tagName==="INPUT"&&a.type==="hidden";return a.disabled||a.hidden||i?NodeFilter.FILTER_SKIP:a.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function o1(e,t){for(const n of e)if(!AK(n,{upTo:t}))return n}function AK(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function PK(e){return e instanceof HTMLInputElement&&"select"in e}function Wi(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&PK(e)&&t&&e.select()}}var l1=MK();function MK(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=u1(e,t),e.unshift(t)},remove(t){var n;e=u1(e,t),(n=e[0])==null||n.resume()}}}function u1(e,t){const n=[...e],a=n.indexOf(t);return a!==-1&&n.splice(a,1),n}function RK(e){return e.filter(t=>t.tagName!=="A")}var Tp="rovingFocusGroup.onEntryFocus",IK={bubbles:!1,cancelable:!0},Lc="RovingFocusGroup",[By,IT,OK]=pl(Lc),[LK,uf]=Yt(Lc,[OK]),[DK,zK]=LK(Lc),OT=p.forwardRef((e,t)=>
vendor: 4,189 bytes, line 543
543o.jsx(By.Provider,{scope:e.__scopeRovingFocusGroup,children:o.jsx(By.Slot,{scope:e.__scopeRovingFocusGroup,children:o.jsx(FK,{...e,ref:t})})}));OT.displayName=Lc;var FK=p.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:a,loop:i=!1,dir:r,currentTabStopId:s,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:u,onEntryFocus:c,preventScrollOnEntryFocus:h=!1,...d}=e,m=p.useRef(null),f=Pe(t,m),y=Sl(r),[g,x]=ma({prop:s,defaultProp:l??null,onChange:u,caller:Lc}),[w,v]=p.useState(!1),k=fn(c),j=IT(n),S=p.useRef(!1),[_,T]=p.useState(0);return p.useEffect(()=>{const E=m.current;if(E)return E.addEventListener(Tp,k),()=>E.removeEventListener(Tp,k)},[k]),o.jsx(DK,{scope:n,orientation:a,dir:y,loop:i,currentTabStopId:g,onItemFocus:p.useCallback(E=>x(E),[x]),onItemShiftTab:p.useCallback(()=>v(!0),[]),onFocusableItemAdd:p.useCallback(()=>T(E=>E+1),[]),onFocusableItemRemove:p.useCallback(()=>T(E=>E-1),[]),children:o.jsx(we.div,{tabIndex:w||_===0?-1:0,"data-orientation":a,...d,ref:f,style:{outline:"none",...e.style},onMouseDown:ue(e.onMouseDown,()=>{S.current=!0}),onFocus:ue(e.onFocus,E=>{const O=!S.current;if(E.target===E.currentTarget&&O&&!w){const A=new CustomEvent(Tp,IK);if(E.currentTarget.dispatchEvent(A),!A.defaultPrevented){const R=j().filter(W=>W.focusable),F=R.find(W=>W.active),Y=R.find(W=>W.id===g),z=[F,Y,...R].filter(Boolean).map(W=>W.ref.current);zT(z,h)}}S.current=!1}),onBlur:ue(e.onBlur,()=>v(!1))})})}),LT="RovingFocusGroupItem",DT=p.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:a=!0,active:i=!1,tabStopId:r,children:s,...l}=e,u=la(),c=r||u,h=zK(LT,n),d=h.currentTabStopId===c,m=IT(n),{onFocusableItemAdd:f,onFocusableItemRemove:y,currentTabStopId:g}=h;return p.useEffect(()=>{if(a)return f(),()=>y()},[a,f,y]),o.jsx(By.ItemSlot,{scope:n,id:c,focusable:a,active:i,children:o.jsx(we.span,{tabIndex:d?0:-1,"data-orientation":h.orientation,...l,ref:t,onMouseDown:ue(e.onMouseDown,x=>{a?h.onItemFocus(c):x.preventDefault()}),onFocus:ue(e.onFocus,()=>h.onItemFocus(c)),onKeyDown:ue(e.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){h.onItemShiftTab();return}if(x.target!==x.currentTarget)return;const w=$K(x,h.orientation,h.dir);if(w!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.preventDefault();let k=m().filter(j=>j.focusable).map(j=>j.ref.current);if(w==="last")k.reverse();else if(w==="prev"||w==="next"){w==="prev"&&k.reverse();const j=k.indexOf(x.currentTarget);k=h.loop?UK(k,j+1):k.slice(j+1)}setTimeout(()=>zT(k))}}),children:typeof s=="function"?s({isCurrentTabStop:d,hasTabStop:g!=null}):s})})});DT.displayName=LT;var BK={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function KK(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function $K(e,t,n){const a=KK(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(a))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(a)))return BK[a]}function zT(e,t=!1){const n=document.activeElement;for(const a of e)if(a===n||(a.focus({preventScroll:t}),document.activeElement!==n))return}function UK(e,t){return e.map((n,a)=>e[(t+a)%e.length])}var FT=OT,BT=DT,VK=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},$s=new WeakMap,jd=new WeakMap,_d={},Ep=0,KT=function(e){return e&&(e.host||KT(e.parentNode))},HK=function(e,t){return t.map(function(n){if(e.contains(n))return n;var a=KT(n);return a&&e.contains(a)?a:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},WK=function(e,t,n,a){var i=HK(t,Array.isArray(e)?e:[e]);_d[n]||(_d[n]=new WeakMap);var r=_d[n],s=[],l=new Set,u=new Set(i),c=function(d){!d||l.has(d)||(l.add(d),c(d.parentNode))};i.forEach(c);var h=function(d){!d||u.has(d)||Array.prototype.forEach.call(d.children,function(m){if(l.has(m))h(m);else try{var f=m.getAttribute(a),y=f!==null&&f!=="false",g=($s.get(m)||0)+1,x=(r.get(m)||0)+1;$s.set(m,g),r.set(m,x),s.push(m),g===1&&y&&jd.set(m,!0),x===1&&m.setAttribute(n,"true"),y||m.setAttribute(a,"true")}catch(w){console.error("aria-hidden: cannot operate on ",m,w)}})};
vendor: 6,376 bytes, lines 543-558
543return h(t),l.clear(),Ep++,function(){s.forEach(function(d){var m=$s.get(d)-1,f=r.get(d)-1;$s.set(d,m),r.set(d,f),m||(jd.has(d)||d.removeAttribute(a),jd.delete(d)),f||d.removeAttribute(n)}),Ep--,Ep||($s=new WeakMap,$s=new WeakMap,jd=new WeakMap,_d={})}},Sk=function(e,t,n){n===void 0&&(n="data-aria-hidden");var a=Array.from(Array.isArray(e)?e:[e]),i=VK(e);return i?(a.push.apply(a,Array.from(i.querySelectorAll("[aria-live]"))),WK(a,i,n,"aria-hidden")):function(){return null}},ei=function(){return ei=Object.assign||function(t){for(var n,a=1,i=arguments.length;a<i;a++){n=arguments[a];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},ei.apply(this,arguments)};function Nl(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,a=Object.getOwnPropertySymbols(e);i<a.length;i++)t.indexOf(a[i])<0&&Object.prototype.propertyIsEnumerable.call(e,a[i])&&(n[a[i]]=e[a[i]]);return n}function qK(e,t,n,a){function i(r){return r instanceof n?r:new n(function(s){s(r)})}return new(n||(n=Promise))(function(r,s){function l(h){try{c(a.next(h))}catch(d){s(d)}}function u(h){try{c(a.throw(h))}catch(d){s(d)}}function c(h){h.done?r(h.value):i(h.value).then(l,u)}c((a=a.apply(e,t||[])).next())})}function GK(e,t,n){if(n||arguments.length===2)for(var a=0,i=t.length,r;a<i;a++)(r||!(a in t))&&(r||(r=Array.prototype.slice.call(t,0,a)),r[a]=t[a]);return e.concat(r||Array.prototype.slice.call(t))}var dh="right-scroll-bar-position",hh="width-before-scroll-bar",YK="with-scroll-bars-hidden",JK="--removed-body-scroll-bar-size";function Ap(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function QK(e,t){var n=p.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(a){var i=n.value;i!==a&&(n.value=a,n.callback(a,i))}}}})[0];return n.callback=t,n.facade}var XK=typeof window<"u"?p.useLayoutEffect:p.useEffect,c1=new WeakMap;function ZK(e,t){var n=QK(null,function(a){return e.forEach(function(i){return Ap(i,a)})});return XK(function(){var a=c1.get(n);if(a){var i=new Set(a),r=new Set(e),s=n.current;i.forEach(function(l){r.has(l)||Ap(l,null)}),r.forEach(function(l){i.has(l)||Ap(l,s)})}c1.set(n,e)},[e]),n}function e$(e){return e}function t$(e,t){t===void 0&&(t=e$);var n=[],a=!1,i={read:function(){if(a)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(r){var s=t(r,a);return n.push(s),function(){n=n.filter(function(l){return l!==s})}},assignSyncMedium:function(r){for(a=!0;n.length;){var s=n;n=[],s.forEach(r)}n={push:function(l){return r(l)},filter:function(){return n}}},assignMedium:function(r){a=!0;var s=[];if(n.length){var l=n;n=[],l.forEach(r),s=n}var u=function(){var h=s;s=[],h.forEach(r)},c=function(){return Promise.resolve().then(u)};c(),n={push:function(h){s.push(h),c()},filter:function(h){return s=s.filter(h),n}}}};return i}function n$(e){e===void 0&&(e={});var t=t$(null);return t.options=ei({async:!0,ssr:!1},e),t}var $T=function(e){var t=e.sideCar,n=Nl(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var a=t.read();if(!a)throw new Error("Sidecar medium not found");return p.createElement(a,ei({},n))};$T.isSideCarExport=!0;function a$(e,t){return e.useMedium(t),$T}var UT=n$(),Pp=function(){},cf=p.forwardRef(function(e,t){var n=p.useRef(null),a=p.useState({onScrollCapture:Pp,onWheelCapture:Pp,onTouchMoveCapture:Pp}),i=a[0],r=a[1],s=e.forwardProps,l=e.children,u=e.className,c=e.removeScrollBar,h=e.enabled,d=e.shards,m=e.sideCar,f=e.noRelative,y=e.noIsolation,g=e.inert,x=e.allowPinchZoom,w=e.as,v=w===void 0?"div":w,k=e.gapMode,j=Nl(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=m,_=ZK([n,t]),T=ei(ei({},j),i);return p.createElement(p.Fragment,null,h&&p.createElement(S,{sideCar:UT,removeScrollBar:c,shards:d,noRelative:f,noIsolation:y,inert:g,setCallbacks:r,allowPinchZoom:!!x,lockRef:n,gapMode:k}),s?p.cloneElement(p.Children.only(l),ei(ei({},T),{ref:_})):p.createElement(v,ei({},T,{className:u,ref:_}),l))});cf.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};cf.classNames={fullWidth:hh,zeroRight:dh};var i$=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function r$(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=i$();return t&&e.setAttribute("nonce",t),e}function s$(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function o$(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var l$=function(){var e=0,t=null;return{add:function(n){e==0&&(t=r$())&&(s$(t,n),o$(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},u$=function(){var e=l$();return function(t,n){p.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},VT=function(){var e=u$(),t=function(n){var a=n.styles,i=n.dynamic;return e(a,i),null};return t},c$={left:0,top:0,right:0,gap:0},Mp=function(e){return parseInt(e||"",10)||0},d$=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],a=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[Mp(n),Mp(a),Mp(i)]},h$=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return c$;var t=d$(e),n=document.documentElement.clientWidth,a=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,a-n+t[2]-t[0])}},m$=VT(),Po="data-scroll-locked",f$=function(e,t,n,a){var i=e.left,r=e.top,s=e.right,l=e.gap;return n===void 0&&(n="margin"),` 544 .`.concat(YK,` { 545 overflow: hidden `).concat(a,`; 546 padding-right: `).concat(l,"px ").concat(a,`; 547 } 548 body[`).concat(Po,`] { 549 overflow: hidden `).concat(a,`; 550 overscroll-behavior: contain; 551 `).concat([t&&"position: relative ".concat(a,";"),n==="margin"&&` 552 padding-left: `.concat(i,`px; 553 padding-top: `).concat(r,`px; 554 padding-right: `).concat(s,`px; 555 margin-left:0; 556 margin-top:0; 557 margin-right: `).concat(l,"px ").concat(a,`; 558 `),n==="padding"&&"padding-right: ".concat(l,"px ").concat(a,";
558")].filter(Boolean).join(""),` 559 } 560 561 .`).concat(dh,` { 562 right: `).concat(l,"px ").concat(a,`; 563 } 564 565 .`).concat(hh,` { 566 margin-right: `).concat(l,"px ").concat(a,`; 567 } 568 569 .`).concat(dh," .").concat(dh,` { 570 right: 0 `).concat(a,`; 571 } 572 573 .`).concat(hh," .").concat(hh,` { 574 margin-right: 0 `).concat(a,`; 575 } 576 577 body[`).concat(Po,`] { 578 `).concat(JK,": ").concat(l,`px; 579 } 580`)},d1=function(){var e=parseInt(document.body.getAttribute(Po)||"0",10);return isFinite(e)?e:0},p$=function(){p.useEffect(function(){return document.body.setAttribute(Po,(d1()+1).toString()),function(){var e=d1()-1;e<=0?document.body.removeAttribute(Po):document.body.setAttribute(Po,e.toString())}},[])},g$=function(e){var t=e.noRelative,n=e.noImportant,a=e.gapMode,i=a===void 0?"margin":a;p$();var r=p.useMemo(function(){return h$(i)},[i]);return p.createElement(m$,{styles:f$(r,!t,i,n?"":"!important")})},Ky=!1;if(typeof window<"u")try{var Sd=Object.defineProperty({},"passive",{get:function(){return Ky=!0,!0}});window.addEventListener("test",Sd,Sd),window.removeEventListener("test",Sd,Sd)}catch{Ky=!1}var Us=Ky?{passive:!1}:!1,y$=function(e){return e.tagName==="TEXTAREA"},HT=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!y$(e)&&n[t]==="visible")},w$=function(e){return HT(e,"overflowY")},x$=function(e){return HT(e,"overflowX")},h1=function(e,t){var n=t.ownerDocument,a=t;do{typeof ShadowRoot<"u"&&a instanceof ShadowRoot&&(a=a.host);var i=WT(e,a);if(i){var r=qT(e,a),s=r[1],l=r[2];if(s>l)return!0}a=a.parentNode}while(a&&a!==n.body);return!1},k$=function(e){var t=e.scrollTop,n=e.scrollHeight,a=e.clientHeight;return[t,n,a]},v$=function(e){var t=e.scrollLeft,n=e.scrollWidth,a=e.clientWidth;return[t,n,a]},WT=function(e,t){return e==="v"?w$(t):x$(t)},qT=function(e,t){return e==="v"?k$(t):v$(t)},b$=function(e,t){return e==="h"&&t==="rtl"?-1:1},j$=function(e,t,n,a,i){var r=b$(e,window.getComputedStyle(t).direction),s=r*a,l=n.target,u=t.contains(l),c=!1,h=s>0,d=0,m=0;do{if(!l)break;var f=qT(e,l),y=f[0],g=f[1],x=f[2],w=g-x-r*y;(y||w)&&WT(e,l)&&(d+=w,m+=y);var v=l.parentNode;l=v&&v.nodeType===Node.DOCUMENT_FRAGMENT_NODE?v.host:v}while(!u&&l!==document.body||u&&(t.contains(l)||t===l));return(h&&(Math.abs(d)<1||!i)||!h&&(Math.abs(m)<1||!i))&&(c=!0),c},Nd=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},m1=function(e){return[e.deltaX,e.deltaY]},f1=function(e){return e&&"current"in e?e.current:e},_$=function(e,t){return e[0]===t[0]&&e[1]===t[1]},S$=function(e){return` 581 .block-interactivity-`.concat(e,` {pointer-events: none;} 582 .allow-interactivity-`).concat(e,` {pointer-events: all;} 583`)},N$=0,Vs=[];function C$(e){var t=p.useRef([]),n=p.useRef([0,0]),a=p.useRef(),i=p.useState(N$++)[0],r=p.useState(VT)[0],s=p.useRef(e);p.useEffect(function(){s.current=e},[e]),p.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var g=GK([e.lockRef.current],(e.shards||[]).map(f1),!0).filter(Boolean);return g.forEach(function(x){return x.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),g.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var l=p.useCallback(function(g,x){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!s.current.allowPinchZoom;var w=Nd(g),v=n.current,k="deltaX"in g?g.deltaX:v[0]-w[0],j="deltaY"in g?g.deltaY:v[1]-w[1],S,_=g.target,T=Math.abs(k)>Math.abs(j)?"h":"v";if("touches"in g&&T==="h"&&_.type==="range")return!1;var E=h1(T,_);if(!E)return!0;if(E?S=T:(S=T==="v"?"h":"v",E=h1(T,_)),!E)return!1;if(!a.current&&"changedTouches"in g&&(k||j)&&(a.current=S),!S)return!0;var O=a.current||S;return j$(O,x,g,O==="h"?k:j,!0)},[]),u=p.useCallback(function(g){var x=g;if(!(!Vs.length||Vs[Vs.length-1]!==r)){var w="deltaY"in x?m1(x):Nd(x),v=t.current.filter(function(S){return S.name===x.type&&(S.target===x.target||x.target===S.shadowParent)&&_$(S.delta,w)})[0];if(v&&v.should){x.cancelable&&x.preventDefault();return}
vendor: 19,426 bytes, line 583
583if(!v){var k=(s.current.shards||[]).map(f1).filter(Boolean).filter(function(S){return S.contains(x.target)}),j=k.length>0?l(x,k[0]):!s.current.noIsolation;j&&x.cancelable&&x.preventDefault()}}},[]),c=p.useCallback(function(g,x,w,v){var k={name:g,delta:x,target:w,should:v,shadowParent:T$(w)};t.current.push(k),setTimeout(function(){t.current=t.current.filter(function(j){return j!==k})},1)},[]),h=p.useCallback(function(g){n.current=Nd(g),a.current=void 0},[]),d=p.useCallback(function(g){c(g.type,m1(g),g.target,l(g,e.lockRef.current))},[]),m=p.useCallback(function(g){c(g.type,Nd(g),g.target,l(g,e.lockRef.current))},[]);p.useEffect(function(){return Vs.push(r),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:m}),document.addEventListener("wheel",u,Us),document.addEventListener("touchmove",u,Us),document.addEventListener("touchstart",h,Us),function(){Vs=Vs.filter(function(g){return g!==r}),document.removeEventListener("wheel",u,Us),document.removeEventListener("touchmove",u,Us),document.removeEventListener("touchstart",h,Us)}},[]);var f=e.removeScrollBar,y=e.inert;return p.createElement(p.Fragment,null,y?p.createElement(r,{styles:S$(i)}):null,f?p.createElement(g$,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function T$(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const E$=a$(UT,C$);var df=p.forwardRef(function(e,t){return p.createElement(cf,ei({},e,{ref:t,sideCar:E$}))});df.classNames=cf.classNames;var $y=["Enter"," "],A$=["ArrowDown","PageUp","Home"],GT=["ArrowUp","PageDown","End"],P$=[...A$,...GT],M$={ltr:[...$y,"ArrowRight"],rtl:[...$y,"ArrowLeft"]},R$={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Dc="Menu",[ic,I$,O$]=pl(Dc),[Ls,YT]=Yt(Dc,[O$,vl,uf]),hf=vl(),JT=uf(),[L$,Ds]=Ls(Dc),[D$,zc]=Ls(Dc),QT=e=>{const{__scopeMenu:t,open:n=!1,children:a,dir:i,onOpenChange:r,modal:s=!0}=e,l=hf(t),[u,c]=p.useState(null),h=p.useRef(!1),d=fn(r),m=Sl(i);return p.useEffect(()=>{const f=()=>{h.current=!0,document.addEventListener("pointerdown",y,{capture:!0,once:!0}),document.addEventListener("pointermove",y,{capture:!0,once:!0})},y=()=>h.current=!1;return document.addEventListener("keydown",f,{capture:!0}),()=>{document.removeEventListener("keydown",f,{capture:!0}),document.removeEventListener("pointerdown",y,{capture:!0}),document.removeEventListener("pointermove",y,{capture:!0})}},[]),o.jsx(nT,{...l,children:o.jsx(L$,{scope:t,open:n,onOpenChange:d,content:u,onContentChange:c,children:o.jsx(D$,{scope:t,onClose:p.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:h,dir:m,modal:s,children:a})})})};QT.displayName=Dc;var z$="MenuAnchor",Nk=p.forwardRef((e,t)=>{const{__scopeMenu:n,...a}=e,i=hf(n);return o.jsx(hk,{...i,...a,ref:t})});Nk.displayName=z$;var Ck="MenuPortal",[F$,XT]=Ls(Ck,{forceMount:void 0}),ZT=e=>{const{__scopeMenu:t,forceMount:n,children:a,container:i}=e,r=Ds(Ck,t);return o.jsx(F$,{scope:t,forceMount:n,children:o.jsx(fa,{present:n||r.open,children:o.jsx(Cc,{asChild:!0,container:i,children:a})})})};ZT.displayName=Ck;var ua="MenuContent",[B$,Tk]=Ls(ua),eE=p.forwardRef((e,t)=>{const n=XT(ua,e.__scopeMenu),{forceMount:a=n.forceMount,...i}=e,r=Ds(ua,e.__scopeMenu),s=zc(ua,e.__scopeMenu);return o.jsx(ic.Provider,{scope:e.__scopeMenu,children:o.jsx(fa,{present:a||r.open,children:o.jsx(ic.Slot,{scope:e.__scopeMenu,children:s.modal?o.jsx(K$,{...i,ref:t}):o.jsx($$,{...i,ref:t})})})})}),K$=p.forwardRef((e,t)=>{const n=Ds(ua,e.__scopeMenu),a=p.useRef(null),i=Pe(t,a);return p.useEffect(()=>{const r=a.current;if(r)return Sk(r)},[]),o.jsx(Ek,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:ue(e.onFocusOutside,r=>r.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),$$=p.forwardRef((e,t)=>{const n=Ds(ua,e.__scopeMenu);return o.jsx(Ek,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),U$=_s("MenuContent.ScrollLock"),Ek=p.forwardRef((e,t)=>{const{__scopeMenu:n,loop:a=!1,trapFocus:i,onOpenAutoFocus:r,onCloseAutoFocus:s,disableOutsidePointerEvents:l,onEntryFocus:u,onEscapeKeyDown:c,onPointerDownOutside:h,onFocusOutside:d,onInteractOutside:m,onDismiss:f,disableOutsideScroll:y,...g}=e,x=Ds(ua,n),w=zc(ua,n),v=hf(n),k=JT(n),j=I$(n),[S,_]=p.useState(null),T=p.useRef(null),E=Pe(t,T,x.onContentChange),O=p.useRef(0),A=p.useRef(""),R=p.useRef(0),F=p.useRef(null),Y=p.useRef("right"),V=p.useRef(0),z=y?df:p.Fragment,W=y?{as:U$,allowPinchZoom:!0}:void 0,B=I=>{var G,ie;const b=A.current+I,C=j().filter(q=>!q.disabled),D=document.activeElement,N=(G=C.find(q=>q.ref.current===D))==null?void 0:G.textValue,J=C.map(q=>q.textValue),re=tU(J,b,N),ee=(ie=C.find(q=>q.textValue===re))==null?void 0:ie.ref.current;(function q(ae){A.current=ae,window.clearTimeout(O.current),ae!==""&&(O.current=window.setTimeout(()=>q(""),1e3))})(b),ee&&setTimeout(()=>ee.focus())};p.useEffect(()=>()=>window.clearTimeout(O.current),[]),_k();const M=p.useCallback(I=>{var C,D;return Y.current===((C=F.current)==null?void 0:C.side)&&aU(I,(D=F.current)==null?void 0:D.area)},[]);return o.jsx(B$,{scope:n,searchRef:A,onItemEnter:p.useCallback(I=>{M(I)&&I.preventDefault()},[M]),onItemLeave:p.useCallback(I=>{var b;M(I)||((b=T.current)==null||b.focus(),_(null))},[M]),onTriggerLeave:p.useCallback(I=>{M(I)&&I.preventDefault()},[M]),pointerGraceTimerRef:R,onPointerGraceIntentChange:p.useCallback(I=>{F.current=I},[]),children:o.jsx(z,{...W,children:o.jsx(lf,{asChild:!0,trapped:i,onMountAutoFocus:ue(r,I=>{var b;I.preventDefault(),(b=T.current)==null||b.focus({preventScroll:!0})}),onUnmountAutoFocus:s,children:o.jsx(gl,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:c,onPointerDownOutside:h,onFocusOutside:d,onInteractOutside:m,onDismiss:f,children:o.jsx(FT,{asChild:!0,...k,dir:w.dir,orientation:"vertical",loop:a,currentTabStopId:S,onCurrentTabStopIdChange:_,onEntryFocus:ue(u,I=>{w.isUsingKeyboardRef.current||I.preventDefault()}),preventScrollOnEntryFocus:!0,children:o.jsx(mk,{role:"menu","aria-orientation":"vertical","data-state":gE(x.open),"data-radix-menu-content":"",dir:w.dir,...v,...g,ref:E,style:{outline:"none",...g.style},onKeyDown:ue(g.onKeyDown,I=>{const C=I.target.closest("[data-radix-menu-content]")===I.currentTarget,D=I.ctrlKey||I.altKey||I.metaKey,N=I.key.length===1;C&&(I.key==="Tab"&&I.preventDefault(),!D&&N&&B(I.key));const J=T.current;if(I.target!==J||!P$.includes(I.key))return;I.preventDefault();const ee=j().filter(G=>!G.disabled).map(G=>G.ref.current);GT.includes(I.key)&&ee.reverse(),Z$(ee)}),onBlur:ue(e.onBlur,I=>{I.currentTarget.contains(I.target)||(window.clearTimeout(O.current),A.current="")}),onPointerMove:ue(e.onPointerMove,rc(I=>{const b=I.target,C=V.current!==I.clientX;if(I.currentTarget.contains(b)&&C){const D=I.clientX>V.current?"right":"left";Y.current=D,V.current=I.clientX}}))})})})})})})});eE.displayName=ua;var V$="MenuGroup",Ak=p.forwardRef((e,t)=>{const{__scopeMenu:n,...a}=e;return o.jsx(we.div,{role:"group",...a,ref:t})});Ak.displayName=V$;var H$="MenuLabel",tE=p.forwardRef((e,t)=>{const{__scopeMenu:n,...a}=e;return o.jsx(we.div,{...a,ref:t})});tE.displayName=H$;var im="MenuItem",p1="menu.itemSelect",mf=p.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:a,...i}=e,r=p.useRef(null),s=zc(im,e.__scopeMenu),l=Tk(im,e.__scopeMenu),u=Pe(t,r),c=p.useRef(!1),h=()=>{const d=r.current;if(!n&&d){const m=new CustomEvent(p1,{bubbles:!0,cancelable:!0});d.addEventListener(p1,f=>a==null?void 0:a(f),{once:!0}),Wx(d,m),m.defaultPrevented?c.current=!1:s.onClose()}};return o.jsx(nE,{...i,ref:u,disabled:n,onClick:ue(e.onClick,h),onPointerDown:d=>{var m;(m=e.onPointerDown)==null||m.call(e,d),c.current=!0},onPointerUp:ue(e.onPointerUp,d=>{var m;c.current||(m=d.currentTarget)==null||m.click()}),onKeyDown:ue(e.onKeyDown,d=>{const m=l.searchRef.current!=="";n||m&&d.key===" "||$y.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});mf.displayName=im;var nE=p.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:a=!1,textValue:i,...r}=e,s=Tk(im,n),l=JT(n),u=p.useRef(null),c=Pe(t,u),[h,d]=p.useState(!1),[m,f]=p.useState("");return p.useEffect(()=>{const y=u.current;y&&f((y.textContent??"").trim())},[r.children]),o.jsx(ic.ItemSlot,{scope:n,disabled:a,textValue:i??m,children:o.jsx(BT,{asChild:!0,...l,focusable:!a,children:o.jsx(we.div,{role:"menuitem","data-highlighted":h?"":void 0,"aria-disabled":a||void 0,"data-disabled":a?"":void 0,...r,ref:c,onPointerMove:ue(e.onPointerMove,rc(y=>{a?s.onItemLeave(y):(s.onItemEnter(y),y.defaultPrevented||y.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:ue(e.onPointerLeave,rc(y=>s.onItemLeave(y))),onFocus:ue(e.onFocus,()=>d(!0)),onBlur:ue(e.onBlur,()=>d(!1))})})})}),W$="MenuCheckboxItem",aE=p.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:a,...i}=e;return o.jsx(lE,{scope:e.__scopeMenu,checked:n,children:o.jsx(mf,{role:"menuitemcheckbox","aria-checked":rm(n)?"mixed":n,...i,ref:t,"data-state":Mk(n),onSelect:ue(i.onSelect,()=>a==null?void 0:a(rm(n)?!0:!n),{checkForDefaultPrevented:!1})})})});aE.displayName=W$;var iE="MenuRadioGroup",[q$,G$]=Ls(iE,{value:void 0,onValueChange:()=>{}}),rE=p.forwardRef((e,t)=>{const{value:n,onValueChange:a,...i}=e,r=fn(a);return o.jsx(q$,{scope:e.__scopeMenu,value:n,onValueChange:r,children:o.jsx(Ak,{...i,ref:t})})});rE.displayName=iE;var sE="MenuRadioItem",oE=p.forwardRef((e,t)=>{const{value:n,...a}=e,i=G$(sE,e.__scopeMenu),r=n===i.value;return o.jsx(lE,{scope:e.__scopeMenu,checked:r,children:o.jsx(mf,{role:"menuitemradio","aria-checked":r,...a,ref:t,"data-state":Mk(r),onSelect:ue(a.onSelect,()=>{var s;return(s=i.onValueChange)==null?void 0:s.call(i,n)},{checkForDefaultPrevented:!1})})})});oE.displayName=sE;var Pk="MenuItemIndicator",[lE,Y$]=Ls(Pk,{checked:!1}),uE=p.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:a,...i}=e,r=Y$(Pk,n);return o.jsx(fa,{present:a||rm(r.checked)||r.checked===!0,children:o.jsx(we.span,{...i,ref:t,"data-state":Mk(r.checked)})})});uE.displayName=Pk;var J$="MenuSeparator",cE=p.forwardRef((e,t)=>{const{__scopeMenu:n,...a}=e;return o.jsx(we.div,{role:"separator","aria-orientation":"horizontal",...a,ref:t})});cE.displayName=J$;var Q$="MenuArrow",dE=p.forwardRef((e,t)=>{const{__scopeMenu:n,...a}=e,i=hf(n);return o.jsx(fk,{...i,...a,ref:t})});dE.displayName=Q$;var X$="MenuSub",[hie,hE]=Ls(X$),su="MenuSubTrigger",mE=p.forwardRef((e,t)=>{const n=Ds(su,e.__scopeMenu),a=zc(su,e.__scopeMenu),i=hE(su,e.__scopeMenu),r=Tk(su,e.__scopeMenu),s=p.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:u}=r,c={__scopeMenu:e.__scopeMenu},h=p.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return p.useEffect(()=>h,[h]),p.useEffect(()=>{const d=l.current;return()=>{window.clearTimeout(d),u(null)}},[l,u]),o.jsx(Nk,{asChild:!0,...c,children:o.jsx(nE,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":gE(n.open),...e,ref:Gm(t,i.onTriggerChange),onClick:d=>{var m;(m=e.onClick)==null||m.call(e,d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:ue(e.onPointerMove,rc(d=>{r.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!n.open&&!s.current&&(r.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{n.onOpenChange(!0),h()},100))})),onPointerLeave:ue(e.onPointerLeave,rc(d=>{var f,y;h();const m=(f=n.content)==null?void 0:f.getBoundingClientRect();if(m){const g=(y=n.content)==null?void 0:y.dataset.side,x=g==="right",w=x?-5:5,v=m[x?"left":"right"],k=m[x?"right":"left"];r.onPointerGraceIntentChange({area:[{x:d.clientX+w,y:d.clientY},{x:v,y:m.top},{x:k,y:m.top},{x:k,y:m.bottom},{x:v,y:m.bottom}],side:g}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>r.onPointerGraceIntentChange(null),300)}else{if(r.onTriggerLeave(d),d.defaultPrevented)return;r.onPointerGraceIntentChange(null)}})),onKeyDown:ue(e.onKeyDown,d=>{var f;const m=r.searchRef.current!=="";e.disabled||m&&d.key===" "||M$[a.dir].includes(d.key)&&(n.onOpenChange(!0),(f=n.content)==null||f.focus(),d.preventDefault())})})})});mE.displayName=su;var fE="MenuSubContent",pE=p.forwardRef((e,t)=>{const n=XT(ua,e.__scopeMenu),{forceMount:a=n.forceMount,...i}=e,r=Ds(ua,e.__scopeMenu),s=zc(ua,e.__scopeMenu),l=hE(fE,e.__scopeMenu),u=p.useRef(null),c=Pe(t,u);return o.jsx(ic.Provider,{scope:e.__scopeMenu,children:o.jsx(fa,{present:a||r.open,children:o.jsx(ic.Slot,{scope:e.__scopeMenu,children:o.jsx(Ek,{id:l.contentId,"aria-labelledby":l.triggerId,...i,ref:c,align:"start",side:s.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:h=>{var d;s.isUsingKeyboardRef.current&&((d=u.current)==null||d.focus()),h.preventDefault()},onCloseAutoFocus:h=>h.preventDefault(),onFocusOutside:ue(e.onFocusOutside,h=>{h.target!==l.trigger&&r.onOpenChange(!1)}),onEscapeKeyDown:ue(e.onEscapeKeyDown,h=>{s.onClose(),h.preventDefault()}),onKeyDown:ue(e.onKeyDown,h=>{var f;const d=h.currentTarget.contains(h.target),m=R$[s.dir].includes(h.key);d&&m&&(r.onOpenChange(!1),(f=l.trigger)==null||f.focus(),h.preventDefault())})})})})})});pE.displayName=fE;function gE(e){return e?"open":"closed"}function rm(e){return e==="indeterminate"}function Mk(e){return rm(e)?"indeterminate":e?"checked":"unchecked"}function Z$(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function eU(e,t){return e.map((n,a)=>e[(t+a)%e.length])}function tU(e,t,n){const i=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,r=n?e.indexOf(n):-1;let s=eU(e,Math.max(r,0));i.length===1&&(s=s.filter(c=>c!==n));const u=s.find(c=>c.toLowerCase().startsWith(i.toLowerCase()));return u!==n?u:void 0}function nU(e,t){const{x:n,y:a}=e;let i=!1;for(let r=0,s=t.length-1;r<t.length;s=r++){const l=t[r],u=t[s],c=l.x,h=l.y,d=u.x,m=u.y;h>a!=m>a&&n<(d-c)*(a-h)/(m-h)+c&&(i=!i)}return i}function aU(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return nU(n,t)}function rc(e){return t=>t.pointerType==="mouse"?e(t):void 0}var iU=QT,rU=Nk,sU=ZT,oU=eE,lU=Ak,uU=tE,cU=mf,dU=aE,hU=rE,mU=oE,fU=uE,pU=cE,gU=dE,yU=mE,wU=pE,ff="DropdownMenu",[xU,mie]=Yt(ff,[YT]),yn=YT(),[kU,yE]=xU(ff),wE=e=>{const{__scopeDropdownMenu:t,children:n,dir:a,open:i,defaultOpen:r,onOpenChange:s,modal:l=!0}=e,u=yn(t),c=p.useRef(null),[h,d]=ma({prop:i,defaultProp:r??!1,onChange:s,caller:ff});return o.jsx(kU,{scope:t,triggerId:la(),triggerRef:c,contentId:la(),open:h,onOpenChange:d,onOpenToggle:p.useCallback(()=>d(m=>!m),[d]),modal:l,children:o.jsx(iU,{...u,open:h,onOpenChange:d,dir:a,modal:l,children:n})})};wE.displayName=ff;var xE="DropdownMenuTrigger",kE=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:a=!1,...i}=e,r=yE(xE,n),s=yn(n);return o.jsx(rU,{asChild:!0,...s,children:o.jsx(we.button,{type:"button",id:r.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":r.open?r.contentId:void 0,"data-state":r.open?"open":"closed","data-disabled":a?"":void 0,disabled:a,...i,ref:Gm(t,r.triggerRef),onPointerDown:ue(e.onPointerDown,l=>{!a&&l.button===0&&l.ctrlKey===!1&&(r.onOpenToggle(),r.open||l.preventDefault())}),onKeyDown:ue(e.onKeyDown,l=>{a||(["Enter"," "].includes(l.key)&&r.onOpenToggle(),l.key==="ArrowDown"&&r.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(l.key)&&l.preventDefault())})})})});kE.displayName=xE;var vU="DropdownMenuPortal",vE=e=>{const{__scopeDropdownMenu:t,...n}=e,a=yn(t);return o.jsx(sU,{...a,...n})};vE.displayName=vU;var bE="DropdownMenuContent",jE=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,i=yE(bE,n),r=yn(n),s=p.useRef(!1);return o.jsx(oU,{id:i.contentId,"aria-labelledby":i.triggerId,...r,...a,ref:t,onCloseAutoFocus:ue(e.onCloseAutoFocus,l=>{var u;s.current||(u=i.triggerRef.current)==null||u.focus(),s.current=!1,l.preventDefault()}),onInteractOutside:ue(e.onInteractOutside,l=>{const u=l.detail.originalEvent,c=u.button===0&&u.ctrlKey===!0,h=u.button===2||c;(!i.modal||h)&&(s.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});jE.displayName=bE;var bU="DropdownMenuGroup",jU=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,i=yn(n);return o.jsx(lU,{...i,...a,ref:t})});jU.displayName=bU;var _U="DropdownMenuLabel",_E=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,i=yn(n);return o.jsx(uU,{...i,...a,ref:t})});_E.displayName=_U;var SU="DropdownMenuItem",SE=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,i=yn(n);return o.jsx(cU,{...i,...a,ref:t})});SE.displayName=SU;var NU="DropdownMenuCheckboxItem",NE=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,i=yn(n);return o.jsx(dU,{...i,...a,ref:t})});NE.displayName=NU;var CU="DropdownMenuRadioGroup",TU=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,i=yn(n);return o.jsx(hU,{...i,...a,ref:t})});TU.displayName=CU;var EU="DropdownMenuRadioItem",CE=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,i=yn(n);return o.jsx(mU,{...i,...a,ref:t})});CE.displayName=EU;var AU="DropdownMenuItemIndicator",TE=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,i=yn(n);return o.jsx(fU,{...i,...a,ref:t})});TE.displayName=AU;var PU="DropdownMenuSeparator",EE=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,i=yn(n);return o.jsx(pU,{...i,...a,ref:t})});EE.displayName=PU;var MU="DropdownMenuArrow",RU=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,i=yn(n);return o.jsx(gU,{...i,...a,ref:t})});RU.displayName=MU;var IU="DropdownMenuSubTrigger",AE=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,i=yn(n);return o.jsx(yU,{...i,...a,ref:t})});AE.displayName=IU;var OU="DropdownMenuSubContent",PE=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,i=yn(n);return o.jsx(wU,{...i,...a,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});PE.displayName=OU;var LU=wE,DU=kE,zU=vE,ME=jE,RE=_E,IE=SE,OE=NE,LE=CE,DE=TE,zE=EE,FE=AE,BE=PE;const KE=LU,$E=DU,FU=p.forwardRef(({className:e,inset:t,children:n,...a},i)=>o.jsxs(FE,{ref:i,className:ce("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[state=open]:bg-accent focus:bg-accent",t&&"pl-8",e),...a,children:[n,o.jsx(ts,{className:"ml-auto h-4 w-4"})]}));FU.displayName=FE.displayName;const BU=p.forwardRef(({className:e,...t},n)=>o.jsx(BE,{ref:n,className:ce("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:sli
583de-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));BU.displayName=BE.displayName;const Rk=p.forwardRef(({className:e,sideOffset:t=4,...n},a)=>o.jsx(zU,{children:o.jsx(ME,{ref:a,sideOffset:t,className:ce("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));Rk.displayName=ME.displayName;const Ik=p.forwardRef(({className:e,inset:t,...n},a)=>o.jsx(IE,{ref:a,className:ce("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",t&&"pl-8",e),...n}));Ik.displayName=IE.displayName;const KU=p.forwardRef(({className:e,children:t,checked:n,...a},i)=>o.jsxs(OE,{ref:i,className:ce("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e),checked:n,...a,children:[o.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(DE,{children:o.jsx(Jx,{className:"h-4 w-4"})})}),t]}));KU.displayName=OE.displayName;const $U=p.forwardRef(({className:e,children:t,...n},a)=>o.jsxs(LE,{ref:a,className:ce("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e),...n,children:[o.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(DE,{children:o.jsx(hD,{className:"h-2 w-2 fill-current"})})}),t]}));$U.displayName=LE.displayName;const UU=p.forwardRef(({className:e,inset:t,...n},a)=>o.jsx(RE,{ref:a,className:ce("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));UU.displayName=RE.displayName;const UE=p.forwardRef(({className:e,...t},n)=>o.jsx(zE,{ref:n,className:ce("-mx-1 my-1 h-px bg-muted",e),...t}));UE.displayName=zE.displayName;const VU=e=>e?(...t)=>e(...t):(...t)=>fetch(...t);class Ok extends Error{constructor(t,n="FunctionsError",a){super(t),this.name=n,this.context=a}toJSON(){return{name:this.name,message:this.message,context:this.context}}}class HU extends Ok{constructor(t){super("Failed to send a request to the Edge Function","FunctionsFetchError",t)}}class g1 extends Ok{constructor(t){super("Relay Error invoking the Edge Function","FunctionsRelayError",t)}}class y1 extends Ok{constructor(t){super("Edge Function returned a non-2xx status code","FunctionsHttpError",t)}}var Uy;(function(e){e.Any="any",e.ApNortheast1="ap-northeast-1",e.ApNortheast2="ap-northeast-2",e.ApSouth1="ap-south-1",e.ApSoutheast1="ap-southeast-1",e.ApSoutheast2="ap-southeast-2",e.CaCentral1="ca-central-1",e.EuCentral1="eu-central-1",e.EuWest1="eu-west-1",e.EuWest2="eu-west-2",e.EuWest3="eu-west-3",e.SaEast1="sa-east-1",e.UsEast1="us-east-1",e.UsWest1="us-west-1",e.UsWest2="us-west-2"})(Uy||(Uy={}));class WU{constructor(t,{headers:n={},customFetch:a,region:i=Uy.Any}={}){this.url=t,this.headers=n,this.region=i,this.fetch=VU(a)}setAuth(t){this.headers.Authorization=`Bearer ${t}`}invoke(t){return qK(this,arguments,void 0,function*(n,a={}){var i;let r,s;try{const{headers:l,method:u,body:c,signal:h,timeout:d}=a;let m={},{region:f}=a;f||(f=this.region);const y=new URL(`${this.url}/${n}`);f&&f!=="any"&&(m["x-region"]=f,y.searchParams.set("forceFunctionRegion",f));let g;c&&(l&&!Object.prototype.hasOwnProperty.call(l,"Content-Type")||!l)?typeof Blob<"u"&&c instanceof Blob||c instanceof ArrayBuffer?(m["Content-Type"]="application/octet-stream",g=c):typeof c=="string"?(m["Content-Type"]="text/plain",g=c):typeof FormData<"u"&&c instanceof FormData?g=c:(m["Content-Type"]="application/json",g=JSON.stringify(c)):c&&typeof c!="string"&&!(typeof Blob<"u"&&c instanceof Blob)&&!(c instanceof ArrayBuffer)&&!(typeof FormData<"u"&&c instanceof FormData)?g=JSON.stringify(c):g=c;let x=h;d&&(s=new AbortController,r=setTimeout(()=>s.abort(),d),h?(x=s.signal,h.addEventListener("abort",()=>s.abort())):x=s.signal);const w=yield this.fetch(y.toString(),{method:u||"POST",headers:Object.assign(Object.assign(Object.assign({},m),this.headers),l),body:g,signal:x}).catch(S=>{throw new HU(S)}),v=w.headers.get("x-relay-error");
583if(v&&v==="true")throw new g1(w);if(!w.ok)throw new y1(w);let k=((i=w.headers.get("Content-Type"))!==null&&i!==void 0?i:"text/plain").split(";")[0].trim(),j;return k==="application/json"?j=yield w.json():k==="application/octet-stream"||k==="application/pdf"?j=yield w.blob():k==="text/event-stream"?j=w:k==="multipart/form-data"?j=yield w.formData():j=yield w.text(),{data:j,error:null,response:w}}catch(l){return{data:null,error:l,response:l instanceof y1||l instanceof g1?l.context:void 0}}finally{r&&clearTimeout(r)}})}}const VE=3,w1=e=>Math.min(1e3*2**e,3e4),qU=[520,503],HE=["GET","HEAD","OPTIONS"];var GU=class extends Error{constructor(e){super(e.message),this.name="PostgrestError",this.details=e.details,this.hint=e.hint,this.code=e.code}toJSON(){return{name:this.name,message:this.message,details:this.details,hint:this.hint,code:this.code}}};function x1(e,t){return new Promise(n=>{if(t!=null&&t.aborted){n();return}const a=setTimeout(()=>{t==null||t.removeEventListener("abort",i),n()},e);function i(){clearTimeout(a),n()}t==null||t.addEventListener("abort",i)})}function YU(e,t,n,a){return!(!a||n>=VE||!HE.includes(e)||!qU.includes(t))}var JU=class{constructor(e){var t,n,a,i,r;this.shouldThrowOnError=!1,this.retryEnabled=!0,this.method=e.method,this.url=e.url,this.headers=new Headers(e.headers),this.schema=e.schema,this.body=e.body,this.shouldThrowOnError=(t=e.shouldThrowOnError)!==null&&t!==void 0?t:!1,this.signal=e.signal,this.isMaybeSingle=(n=e.isMaybeSingle)!==null&&n!==void 0?n:!1,this.shouldStripNulls=(a=e.shouldStripNulls)!==null&&a!==void 0?a:!1,this.urlLengthLimit=(i=e.urlLengthLimit)!==null&&i!==void 0?i:8e3,this.retryEnabled=(r=e.retry)!==null&&r!==void 0?r:!0,e.fetch?this.fetch=e.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}stripNulls(){if(this.headers.get("Accept")==="text/csv")throw new Error("stripNulls() cannot be used with csv()");return this.shouldStripNulls=!0,this}setHeader(e,t){return this.headers=new Headers(this.headers),this.headers.set(e,t),this}retry(e){return this.retryEnabled=e,this}then(e,t){var n=this;if(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"),this.shouldStripNulls){const s=this.headers.get("Accept");s==="application/vnd.pgrst.object+json"?this.headers.set("Accept","application/vnd.pgrst.object+json;nulls=stripped"):(!s||s==="application/json")&&this.headers.set("Accept","application/vnd.pgrst.array+json;nulls=stripped")}const a=this.fetch;let r=(async()=>{let s=0;for(;;){const c=new Headers(n.headers);s>0&&c.set("X-Retry-Count",String(s));let h;try{h=await a(n.url.toString(),{method:n.method,headers:c,body:JSON.stringify(n.body),signal:n.signal})}catch(d){if((d==null?void 0:d.name)==="AbortError"||(d==null?void 0:d.code)==="ABORT_ERR"||!HE.includes(n.method))throw d;if(n.retryEnabled&&s<VE){const m=w1(s);s++,await x1(m,n.signal);continue}throw d}if(YU(n.method,h.status,s,n.retryEnabled)){var l,u;const d=(l=(u=h.headers)===null||u===void 0?void 0:u.get("Retry-After"))!==null&&l!==void 0?l:null,m=d!==null?Math.max(0,parseInt(d,10)||0)*1e3:w1(s);await h.text(),s++,await x1(m,n.signal);continue}return await n.processResponse(h)}})();return this.shouldThrowOnError||(r=r.catch(s=>{var l;let u="",c="",h="";const d=s==null?void 0:s.cause;if(d){var m,f,y,g;const v=(m=d==null?void 0:d.message)!==null&&m!==void 0?m:"",k=(f=d==null?void 0:d.code)!==null&&f!==void 0?f:"";u=`${(y=s==null?void 0:s.name)!==null&&y!==void 0?y:"FetchError"}: ${s==null?void 0:s.message}`,u+=` 584 585Caused by: ${(g=d==null?void 0:d.name)!==null&&g!==void 0?g:"Error"}: ${v}`,k&&(u+=` (${k})`),d!=null&&d.stack&&(u+=` 586${d.stack}`)}else{var x;u=(x=s==null?void 0:s.stack)!==null&&x!==void 0?x:""}const w=this.url.toString().length;return(s==null?void 0:s.name)==="AbortError"||(s==null?void 0:s.code)==="ABORT_ERR"?(h="",c="Request was aborted (timeout or manual cancellation)",w>this.urlLengthLimit&&(c+=`. Note: Your request URL is ${w} characters, which may exceed server limits. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [many IDs])), consider using an RPC function to pass values server-side.`)):((d==null?void 0:d.name)==="HeadersOverflowError"||(d==null?void 0:d.code)==="UND_ERR_HEADERS_OVERFLOW")&&(h="",c="HTTP headers exceeded server limits (typically 16KB)",w>this.urlLengthLimit&&(c+=`. Your request URL is ${w} characters. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [200+ IDs])), consider using an RPC function instead.`)),{success:!1,error:{message:`${(l=s==null?void 0:s.name)!==null&&l!==void 0?l:"FetchError"}: ${s==null?void 0:s.message}`,details:u,hint:c,code:h},data:null,count:null,status:0,statusText:""}}
586)),r.then(e,t)}async processResponse(e){var t=this;let n=null,a=null,i=null,r=e.status,s=e.statusText;if(e.ok){var l,u;if(t.method!=="HEAD"){var c;const m=await e.text();m===""||(t.headers.get("Accept")==="text/csv"||t.headers.get("Accept")&&(!((c=t.headers.get("Accept"))===null||c===void 0)&&c.includes("application/vnd.pgrst.plan+text"))?a=m:a=JSON.parse(m))}const h=(l=t.headers.get("Prefer"))===null||l===void 0?void 0:l.match(/count=(exact|planned|estimated)/),d=(u=e.headers.get("content-range"))===null||u===void 0?void 0:u.split("/");h&&d&&d.length>1&&(i=parseInt(d[1])),t.isMaybeSingle&&Array.isArray(a)&&(a.length>1?(n={code:"PGRST116",details:`Results contain ${a.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},a=null,i=null,r=406,s="Not Acceptable"):a.length===1?a=a[0]:a=null)}else{const h=await e.text();try{n=JSON.parse(h),Array.isArray(n)&&e.status===404&&(a=[],n=null,r=200,s="OK")}catch{e.status===404&&h===""?(r=204,s="No Content"):n={message:h}}if(n&&t.shouldThrowOnError)throw new GU(n)}return{success:n===null,error:n,data:a,count:i,status:r,statusText:s}}returns(){return this}overrideTypes(){return this}},QU=class extends JU{select(e){let t=!1;const n=(e??"*").split("").map(a=>/\s/.test(a)&&!t?"":(a==='"'&&(t=!t),a)).join("");return this.url.searchParams.set("select",n),this.headers.append("Prefer","return=representation"),this}order(e,{ascending:t=!0,nullsFirst:n,foreignTable:a,referencedTable:i=a}={}){const r=i?`${i}.order`:"order",s=this.url.searchParams.get(r);return this.url.searchParams.set(r,`${s?`${s},`:""}${e}.${t?"asc":"desc"}${n===void 0?"":n?".nullsfirst":".nullslast"}`),this}limit(e,{foreignTable:t,referencedTable:n=t}={}){const a=typeof n>"u"?"limit":`${n}.limit`;return this.url.searchParams.set(a,`${e}`),this}range(e,t,{foreignTable:n,referencedTable:a=n}={}){const i=typeof a>"u"?"offset":`${a}.offset`,r=typeof a>"u"?"limit":`${a}.limit`;return this.url.searchParams.set(i,`${e}`),this.url.searchParams.set(r,`${t-e+1}`),this}abortSignal(e){return this.signal=e,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return 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:e=!1,verbose:t=!1,settings:n=!1,buffers:a=!1,wal:i=!1,format:r="text"}={}){var s;const l=[e?"analyze":null,t?"verbose":null,n?"settings":null,a?"buffers":null,i?"wal":null].filter(Boolean).join("|"),u=(s=this.headers.get("Accept"))!==null&&s!==void 0?s:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${r}; for="${u}"; options=${l};`),r==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(e){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${e}`),this}};const k1=new RegExp("[,()]");var to=class extends QU{eq(e,t){return this.url.searchParams.append(e,`eq.${t}`),this}neq(e,t){return this.url.searchParams.append(e,`neq.${t}`),this}gt(e,t){return this.url.searchParams.append(e,`gt.${t}`),this}gte(e,t){return this.url.searchParams.append(e,`gte.${t}`),this}lt(e,t){return this.url.searchParams.append(e,`lt.${t}`),this}lte(e,t){return this.url.searchParams.append(e,`lte.${t}`),this}like(e,t){return this.url.searchParams.append(e,`like.${t}`),this}likeAllOf(e,t){return this.url.searchParams.append(e,`like(all).{${t.join(",")}}`),this}likeAnyOf(e,t){return this.url.searchParams.append(e,`like(any).{${t.join(",")}}`),this}ilike(e,t){return this.url.searchParams.append(e,`ilike.${t}`),this}ilikeAllOf(e,t){return this.url.searchParams.append(e,`ilike(all).{${t.join(",")}}`),this}ilikeAnyOf(e,t){return this.url.searchParams.append(e,`ilike(any).{${t.join(",")}}`),this}regexMatch(e,t){return this.url.searchParams.append(e,`match.${t}`),this}regexIMatch(e,t){return this.url.searchParams.append(e,`imatch.${t}`),this}is(e,t){return this.url.searchParams.append(e,`is.${t}`),this}isDistinct(e,t){return this.url.searchParams.append(e,`isdistinct.${t}`),this}in(e,t){const n=Array.from(new Set(t)).map(a=>
586typeof a=="string"&&k1.test(a)?`"${a}"`:`${a}`).join(",");return this.url.searchParams.append(e,`in.(${n})`),this}notIn(e,t){const n=Array.from(new Set(t)).map(a=>typeof a=="string"&&k1.test(a)?`"${a}"`:`${a}`).join(",");return this.url.searchParams.append(e,`not.in.(${n})`),this}contains(e,t){return typeof t=="string"?this.url.searchParams.append(e,`cs.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cs.{${t.join(",")}}`):this.url.searchParams.append(e,`cs.${JSON.stringify(t)}`),this}containedBy(e,t){return typeof t=="string"?this.url.searchParams.append(e,`cd.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cd.{${t.join(",")}}`):this.url.searchParams.append(e,`cd.${JSON.stringify(t)}`),this}rangeGt(e,t){return this.url.searchParams.append(e,`sr.${t}`),this}rangeGte(e,t){return this.url.searchParams.append(e,`nxl.${t}`),this}rangeLt(e,t){return this.url.searchParams.append(e,`sl.${t}`),this}rangeLte(e,t){return this.url.searchParams.append(e,`nxr.${t}`),this}rangeAdjacent(e,t){return this.url.searchParams.append(e,`adj.${t}`),this}overlaps(e,t){return typeof t=="string"?this.url.searchParams.append(e,`ov.${t}`):this.url.searchParams.append(e,`ov.{${t.join(",")}}`),this}textSearch(e,t,{config:n,type:a}={}){let i="";a==="plain"?i="pl":a==="phrase"?i="ph":a==="websearch"&&(i="w");const r=n===void 0?"":`(${n})`;return this.url.searchParams.append(e,`${i}fts${r}.${t}`),this}match(e){return Object.entries(e).filter(([t,n])=>n!==void 0).forEach(([t,n])=>{this.url.searchParams.append(t,`eq.${n}`)}),this}not(e,t,n){return this.url.searchParams.append(e,`not.${t}.${n}`),this}or(e,{foreignTable:t,referencedTable:n=t}={}){const a=n?`${n}.or`:"or";return this.url.searchParams.append(a,`(${e})`),this}filter(e,t,n){return this.url.searchParams.append(e,`${t}.${n}`),this}},XU=class{constructor(e,{headers:t={},schema:n,fetch:a,urlLengthLimit:i=8e3,retry:r}){this.url=e,this.headers=new Headers(t),this.schema=n,this.fetch=a,this.urlLengthLimit=i,this.retry=r}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(e,t){const{head:n=!1,count:a}=t??{},i=n?"HEAD":"GET";let r=!1;const s=(e??"*").split("").map(c=>/\s/.test(c)&&!r?"":(c==='"'&&(r=!r),c)).join(""),{url:l,headers:u}=this.cloneRequestState();return l.searchParams.set("select",s),a&&u.append("Prefer",`count=${a}`),new to({method:i,url:l,headers:u,schema:this.schema,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}insert(e,{count:t,defaultToNull:n=!0}={}){var a;const i="POST",{url:r,headers:s}=this.cloneRequestState();if(t&&s.append("Prefer",`count=${t}`),n||s.append("Prefer","missing=default"),Array.isArray(e)){const l=e.reduce((u,c)=>u.concat(Object.keys(c)),[]);if(l.length>0){const u=[...new Set(l)].map(c=>`"${c}"`);r.searchParams.set("columns",u.join(","))}}return new to({method:i,url:r,headers:s,schema:this.schema,body:e,fetch:(a=this.fetch)!==null&&a!==void 0?a:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}upsert(e,{onConflict:t,ignoreDuplicates:n=!1,count:a,defaultToNull:i=!0}={}){var r;const s="POST",{url:l,headers:u}=this.cloneRequestState();if(u.append("Prefer",`resolution=${n?"ignore":"merge"}-duplicates`),t!==void 0&&l.searchParams.set("on_conflict",t),a&&u.append("Prefer",`count=${a}`),i||u.append("Prefer","missing=default"),Array.isArray(e)){const c=e.reduce((h,d)=>h.concat(Object.keys(d)),[]);if(c.length>0){const h=[...new Set(c)].map(d=>`"${d}"`);l.searchParams.set("columns",h.join(","))}}return new to({method:s,url:l,headers:u,schema:this.schema,body:e,fetch:(r=this.fetch)!==null&&r!==void 0?r:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}update(e,{count:t}={}){var n;const a="PATCH",{url:i,headers:r}=this.cloneRequestState();return t&&r.append("Prefer",`count=${t}`),new to({method:a,url:i,headers:r,schema:this.schema,body:e,fetch:(n=this.fetch)!==null&&n!==void 0?n:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}delete({count:e}={}){var t;const n="DELETE",{url:a,headers:i}=this.cloneRequestState();return e&&i.append("Prefer",`count=${e}`),new to({method:n,url:a,headers:i,schema:this.schema,fetch:(t=this.fetch)!==null&&t!==void 0?t:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};function sc(e){"@babel/helpers - typeof";return sc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},sc(e)}function ZU(e,t){if(sc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var a=n.call(e,t||"default");if(sc(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function eV(e){var t=ZU(e,"string");return sc(t)=="symbol"?t:t+""}
586function tV(e,t,n){return(t=eV(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function v1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,a)}return n}function Cd(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?v1(Object(n),!0).forEach(function(a){tV(e,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v1(Object(n)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(n,a))})}return e}var nV=class WE{constructor(t,{headers:n={},schema:a,fetch:i,timeout:r,urlLengthLimit:s=8e3,retry:l}={}){this.url=t,this.headers=new Headers(n),this.schemaName=a,this.urlLengthLimit=s;const u=i??globalThis.fetch;r!==void 0&&r>0?this.fetch=(c,h)=>{const d=new AbortController,m=setTimeout(()=>d.abort(),r),f=h==null?void 0:h.signal;if(f){if(f.aborted)return clearTimeout(m),u(c,h);const y=()=>{clearTimeout(m),d.abort()};return f.addEventListener("abort",y,{once:!0}),u(c,Cd(Cd({},h),{},{signal:d.signal})).finally(()=>{clearTimeout(m),f.removeEventListener("abort",y)})}return u(c,Cd(Cd({},h),{},{signal:d.signal})).finally(()=>clearTimeout(m))}:this.fetch=u,this.retry=l}from(t){if(!t||typeof t!="string"||t.trim()==="")throw new Error("Invalid relation name: relation must be a non-empty string.");return new XU(new URL(`${this.url}/${t}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}schema(t){return new WE(this.url,{headers:this.headers,schema:t,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}rpc(t,n={},{head:a=!1,get:i=!1,count:r}={}){var s;let l;const u=new URL(`${this.url}/rpc/${t}`);let c;const h=f=>f!==null&&typeof f=="object"&&(!Array.isArray(f)||f.some(h)),d=a&&Object.values(n).some(h);d?(l="POST",c=n):a||i?(l=a?"HEAD":"GET",Object.entries(n).filter(([f,y])=>y!==void 0).map(([f,y])=>[f,Array.isArray(y)?`{${y.join(",")}}`:`${y}`]).forEach(([f,y])=>{u.searchParams.append(f,y)})):(l="POST",c=n);const m=new Headers(this.headers);return d?m.set("Prefer",r?`count=${r},return=minimal`:"return=minimal"):r&&m.set("Prefer",`count=${r}`),new to({method:l,url:u,headers:m,schema:this.schemaName,body:c,fetch:(s=this.fetch)!==null&&s!==void 0?s:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};class aV{constructor(){}static detectEnvironment(){var t;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"&&(!((t=navigator.userAgent)===null||t===void 0)&&t.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 a=n.versions;if(a&&a.node){const i=a.node,r=parseInt(i.replace(/^v/,"").split(".")[0]);return r>=22?typeof globalThis.WebSocket<"u"?{type:"native",constructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${r} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${r} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option: 587import ws from "ws" 588new 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 t=this.detectEnvironment();if(t.constructor)return t.constructor;let n=t.error||"WebSocket not supported in this environment.";throw t.workaround&&(n+=` 589 590Suggested solution: ${t.workaround}`),new Error(n)}static isWebSocketSupported(){try{const t=this.detectEnvironment();return t.type==="native"||t.type==="ws"}catch{return!1}}}const iV="2.103.0",rV=`realtime-js/${iV}`,sV="1.0.0",qE="2.0.0",oV=qE,lV=1e4,uV=100,Zi={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},GE={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave",access_token:"access_token"},Vy={connecting:"connecting",open:"open",closing:"closing",closed:"closed"};class cV{constructor(t){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=t??[]}encode(t,n){if(t.event===this.BROADCAST_EVENT&&!(t.payload instanceof ArrayBuffer)&&typeof t.payload.event=="string")return n(this._binaryEncodeUserBroadcastPush(t));let a=[t.join_ref,t.ref,t.topic,t.event,t.payload];return n(JSON.stringify(a))}_binaryEncodeUserBroadcastPush(t){var n;return this._isArrayBuffer((n=t.payload)===null||n===void 0?void 0:n.payload)?this._encodeBinaryUserBroadcastPush(t):this._encodeJsonUserBroadcastPush(t)}_encodeBinaryUserBroadcastPush(t){var n,a;const i=(a=(n=t.payload)===null||n===void 0?void 0:n.payload)!==null&&a!==void 0?a:new ArrayBuffer(0);return this._encodeUserBroadcastPush(t,this.BINARY_ENCODING,i)}_encodeJsonUserBroadcastPush(t){var n,a;const i=(a=(n=t.payload)===null||n===void 0?void 0:n.payload)!==null&&a!==void 0?a:{},s=new TextEncoder().encode(JSON.stringify(i)).buffer;return this._encodeUserBroadcastPush(t,this.JSON_ENCODING,s)}_encodeUserBroadcastPush(t,n,a){var i,r;const s=t.topic,l=(i=t.ref)!==null&&i!==void 0?i:"",u=(r=t.join_ref)!==null&&r!==void 0?r:"",c=t.payload.event,h=this.allowedMetadataKeys?this._pick(t.payload,this.allowedMetadataKeys):{},d=Object.keys(h).length===0?"":JSON.stringify(h);if(u.length>255)throw new Error(`joinRef length ${u.length} exceeds maximum of 255`);if(l.length>255)throw new Error(`ref length ${l.length} exceeds maximum of 255`);if(s.length>255)throw new Error(`topic length ${s.length} exceeds maximum of 255`);if(c.length>255)throw new Error(`userEvent length ${c.length} exceeds maximum of 255`);if(d.length>255)throw new Error(`metadata length ${d.length} exceeds maximum of 255`);const m=this.USER_BROADCAST_PUSH_META_LENGTH+u.length+l.length+s.length+c.length+d.length,f=new ArrayBuffer(this.HEADER_LENGTH+m);let y=new DataView(f),g=0;y.setUint8(g++,this.KINDS.userBroadcastPush),y.setUint8(g++,u.length),y.setUint8(g++,l.length),y.setUint8(g++,s.length),y.setUint8(g++,c.length),y.setUint8(g++,d.length),y.setUint8(g++,n),Array.from(u,w=>
590y.setUint8(g++,w.charCodeAt(0))),Array.from(l,w=>y.setUint8(g++,w.charCodeAt(0))),Array.from(s,w=>y.setUint8(g++,w.charCodeAt(0))),Array.from(c,w=>y.setUint8(g++,w.charCodeAt(0))),Array.from(d,w=>y.setUint8(g++,w.charCodeAt(0)));var x=new Uint8Array(f.byteLength+a.byteLength);return x.set(new Uint8Array(f),0),x.set(new Uint8Array(a),f.byteLength),x.buffer}decode(t,n){if(this._isArrayBuffer(t)){let a=this._binaryDecode(t);return n(a)}if(typeof t=="string"){const a=JSON.parse(t),[i,r,s,l,u]=a;return n({join_ref:i,ref:r,topic:s,event:l,payload:u})}return n({})}_binaryDecode(t){const n=new DataView(t),a=n.getUint8(0),i=new TextDecoder;switch(a){case this.KINDS.userBroadcast:return this._decodeUserBroadcast(t,n,i)}}_decodeUserBroadcast(t,n,a){const i=n.getUint8(1),r=n.getUint8(2),s=n.getUint8(3),l=n.getUint8(4);let u=this.HEADER_LENGTH+4;const c=a.decode(t.slice(u,u+i));u=u+i;const h=a.decode(t.slice(u,u+r));u=u+r;const d=a.decode(t.slice(u,u+s));u=u+s;const m=t.slice(u,t.byteLength),f=l===this.JSON_ENCODING?JSON.parse(a.decode(m)):m,y={type:this.BROADCAST_EVENT,event:h,payload:f};return s>0&&(y.meta=JSON.parse(d)),{join_ref:null,ref:null,topic:c,event:this.BROADCAST_EVENT,payload:y}}_isArrayBuffer(t){var n;return t instanceof ArrayBuffer||((n=t==null?void 0:t.constructor)===null||n===void 0?void 0:n.name)==="ArrayBuffer"}_pick(t,n){return!t||typeof t!="object"?{}:Object.fromEntries(Object.entries(t).filter(([a])=>n.includes(a)))}}var nt;(function(e){e.abstime="abstime",e.bool="bool",e.date="date",e.daterange="daterange",e.float4="float4",e.float8="float8",e.int2="int2",e.int4="int4",e.int4range="int4range",e.int8="int8",e.int8range="int8range",e.json="json",e.jsonb="jsonb",e.money="money",e.numeric="numeric",e.oid="oid",e.reltime="reltime",e.text="text",e.time="time",e.timestamp="timestamp",e.timestamptz="timestamptz",e.timetz="timetz",e.tsrange="tsrange",e.tstzrange="tstzrange"})(nt||(nt={}));const b1=(e,t,n={})=>{var a;const i=(a=n.skipTypes)!==null&&a!==void 0?a:[];return t?Object.keys(t).reduce((r,s)=>(r[s]=dV(s,e,t,i),r),{}):{}},dV=(e,t,n,a)=>{const i=t.find(l=>
vendor: 5,523 bytes, line 590
590l.name===e),r=i==null?void 0:i.type,s=n[e];return r&&!a.includes(r)?YE(r,s):Hy(s)},YE=(e,t)=>{if(e.charAt(0)==="_"){const n=e.slice(1,e.length);return pV(t,n)}switch(e){case nt.bool:return hV(t);case nt.float4:case nt.float8:case nt.int2:case nt.int4:case nt.int8:case nt.numeric:case nt.oid:return mV(t);case nt.json:case nt.jsonb:return fV(t);case nt.timestamp:return gV(t);case nt.abstime:case nt.date:case nt.daterange:case nt.int4range:case nt.int8range:case nt.money:case nt.reltime:case nt.text:case nt.time:case nt.timestamptz:case nt.timetz:case nt.tsrange:case nt.tstzrange:return Hy(t);default:return Hy(t)}},Hy=e=>e,hV=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},mV=e=>{if(typeof e=="string"){const t=parseFloat(e);if(!Number.isNaN(t))return t}return e},fV=e=>{if(typeof e=="string")try{return JSON.parse(e)}catch{return e}return e},pV=(e,t)=>{if(typeof e!="string")return e;const n=e.length-1,a=e[n];if(e[0]==="{"&&a==="}"){let r;const s=e.slice(1,n);try{r=JSON.parse("["+s+"]")}catch{r=s?s.split(","):[]}return r.map(l=>YE(t,l))}return e},gV=e=>typeof e=="string"?e.replace(" ","T"):e,JE=e=>{const t=new URL(e);return t.protocol=t.protocol.replace(/^ws/i,"http"),t.pathname=t.pathname.replace(/\/+$/,"").replace(/\/socket\/websocket$/i,"").replace(/\/socket$/i,"").replace(/\/websocket$/i,""),t.pathname===""||t.pathname==="/"?t.pathname="/api/broadcast":t.pathname=t.pathname+"/api/broadcast",t.href};var ju=e=>typeof e=="function"?e:function(){return e},yV=typeof self<"u"?self:null,no=typeof window<"u"?window:null,qa=yV||no||globalThis,wV="2.0.0",xV=1e4,kV=1e3,Qa={connecting:0,open:1,closing:2,closed:3},xn={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},wi={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave"},Wy={longpoll:"longpoll",websocket:"websocket"},vV={complete:4},qy="base64url.bearer.phx.",Td=class{constructor(e,t,n,a){this.channel=e,this.event=t,this.payload=n||function(){return{}},this.receivedResp=null,this.timeout=a,this.timeoutTimer=null,this.recHooks=[],this.sent=!1,this.ref=void 0}resend(e){this.timeout=e,this.reset(),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()}))}receive(e,t){return this.hasReceived(e)&&t(this.receivedResp.response),this.recHooks.push({status:e,callback:t}),this}reset(){this.cancelRefEvent(),this.ref=null,this.refEvent=null,this.receivedResp=null,this.sent=!1}destroy(){this.cancelRefEvent(),this.cancelTimeout()}matchReceive({status:e,response:t,_ref:n}){this.recHooks.filter(a=>a.status===e).forEach(a=>a.callback(t))}cancelRefEvent(){this.refEvent&&this.channel.off(this.refEvent)}cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=null}startTimeout(){this.timeoutTimer&&this.cancelTimeout(),this.ref=this.channel.socket.makeRef(),this.refEvent=this.channel.replyEventName(this.ref),this.channel.on(this.refEvent,e=>{this.cancelRefEvent(),this.cancelTimeout(),this.receivedResp=e,this.matchReceive(e)}),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}trigger(e,t){this.channel.trigger(this.refEvent,{status:e,response:t})}},QE=class{constructor(e,t){this.callback=e,this.timerCalc=t,this.timer=void 0,this.tries=0}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}},bV=class{constructor(e,t,n){this.state=xn.closed,this.topic=e,this.params=ju(t||{}),this.socket=n,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new Td(this,wi.join,this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new QE(()=>{this.socket.isConnected()&&this.rejoin()},this.socket.rejoinAfterMs),this.stateChangeRefs.push(this.socket.onError(()=>this.rejoinTimer.reset())),this.stateChangeRefs.push(this.socket.onOpen(()=>{this.rejoinTimer.reset(),this.isErrored()&&this.rejoin()})),this.joinPush.receive("ok",()=>{this.state=xn.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(a=>a.send()),this.pushBuffer=[]}),this.joinPush.receive("error",a=>{this.state=xn.errored,this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,a),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.onClose(()=>{this.rejoinTimer.reset(),this.socket.hasLogger()&&this.socket.log("channel",`close ${this.topic}`),this.state=xn.closed,this.socket.remove(this)}),this.onError(a=>{this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,a),this.isJoining()&&this.joinPush.reset(),this.state=xn.errored,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.joinPush.receive("timeout",()=>{this.socket.hasLogger()&&this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),new Td(this,wi.leave,ju({}),this.timeout).send(),this.state=xn.errored,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.on(wi.reply,(a,i)=>{this.trigger(this.replyEventName(i),a)})}join(e=this.timeout){if(this.joinedOnce)throw new Error("tried to join multiple times. 'join' can only be called a single time per channel instance");return this.timeout=e,this.joinedOnce=!0,this.rejoin(),this.joinPush}
vendor: 5,263 bytes, line 590
590teardown(){this.pushBuffer.forEach(e=>e.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=xn.closed,this.bindings=[]}onClose(e){this.on(wi.close,e)}onError(e){return this.on(wi.error,t=>e(t))}on(e,t){let n=this.bindingRef++;return this.bindings.push({event:e,ref:n,callback:t}),n}off(e,t){this.bindings=this.bindings.filter(n=>!(n.event===e&&(typeof t>"u"||t===n.ref)))}canPush(){return this.socket.isConnected()&&this.isJoined()}push(e,t,n=this.timeout){if(t=t||{},!this.joinedOnce)throw new Error(`tried to push '${e}' to '${this.topic}' before joining. Use channel.join() before pushing events`);let a=new Td(this,e,function(){return t},n);return this.canPush()?a.send():(a.startTimeout(),this.pushBuffer.push(a)),a}leave(e=this.timeout){this.rejoinTimer.reset(),this.joinPush.cancelTimeout(),this.state=xn.leaving;let t=()=>{this.socket.hasLogger()&&this.socket.log("channel",`leave ${this.topic}`),this.trigger(wi.close,"leave")},n=new Td(this,wi.leave,ju({}),e);return n.receive("ok",()=>t()).receive("timeout",()=>t()),n.send(),this.canPush()||n.trigger("ok",{}),n}onMessage(e,t,n){return t}filterBindings(e,t,n){return!0}isMember(e,t,n,a){return this.topic!==e?!1:a&&a!==this.joinRef()?(this.socket.hasLogger()&&this.socket.log("channel","dropping outdated message",{topic:e,event:t,payload:n,joinRef:a}),!1):!0}joinRef(){return this.joinPush.ref}rejoin(e=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=xn.joining,this.joinPush.resend(e))}trigger(e,t,n,a){let i=this.onMessage(e,t,n,a);if(t&&!i)throw new Error("channel onMessage callbacks must return the payload, modified or unmodified");let r=this.bindings.filter(s=>s.event===e&&this.filterBindings(s,t,n));for(let s=0;s<r.length;s++)r[s].callback(i,n,a||this.joinRef())}replyEventName(e){return`chan_reply_${e}`}isClosed(){return this.state===xn.closed}isErrored(){return this.state===xn.errored}isJoined(){return this.state===xn.joined}isJoining(){return this.state===xn.joining}isLeaving(){return this.state===xn.leaving}},sm=class{static request(e,t,n,a,i,r,s){if(qa.XDomainRequest){let l=new qa.XDomainRequest;return this.xdomainRequest(l,e,t,a,i,r,s)}else if(qa.XMLHttpRequest){let l=new qa.XMLHttpRequest;return this.xhrRequest(l,e,t,n,a,i,r,s)}else{if(qa.fetch&&qa.AbortController)return this.fetchRequest(e,t,n,a,i,r,s);throw new Error("No suitable XMLHttpRequest implementation found")}}static fetchRequest(e,t,n,a,i,r,s){let l={method:e,headers:n,body:a},u=null;return i&&(u=new AbortController,setTimeout(()=>u.abort(),i),l.signal=u.signal),qa.fetch(t,l).then(c=>c.text()).then(c=>this.parseJSON(c)).then(c=>s&&s(c)).catch(c=>{c.name==="AbortError"&&r?r():s&&s(null)}),u}static xdomainRequest(e,t,n,a,i,r,s){return e.timeout=i,e.open(t,n),e.onload=()=>{let l=this.parseJSON(e.responseText);s&&s(l)},r&&(e.ontimeout=r),e.onprogress=()=>{},e.send(a),e}static xhrRequest(e,t,n,a,i,r,s,l){e.open(t,n,!0),e.timeout=r;for(let[u,c]of Object.entries(a))e.setRequestHeader(u,c);return e.onerror=()=>l&&l(null),e.onreadystatechange=()=>{if(e.readyState===vV.complete&&l){let u=this.parseJSON(e.responseText);l(u)}},s&&(e.ontimeout=s),e.send(i),e}static parseJSON(e){if(!e||e==="")return null;try{return JSON.parse(e)}catch{return console&&console.log("failed to parse JSON response",e),null}}static serialize(e,t){let n=[];for(var a in e){if(!Object.prototype.hasOwnProperty.call(e,a))continue;let i=t?`${t}[${a}]`:a,r=e[a];typeof r=="object"?n.push(this.serialize(r,i)):n.push(encodeURIComponent(i)+"="+encodeURIComponent(r))}return n.join("&")}static appendParams(e,t){if(Object.keys(t).length===0)return e;let n=e.match(/\?/)?"&":"?";return`${e}${n}${this.serialize(t)}`}},jV=e=>{let t="",n=new Uint8Array(e),a=n.byteLength;for(let i=0;i<a;i++)t+=String.fromCharCode(n[i]);return btoa(t)},Hs=class{constructor(e,t){t&&t.length===2&&t[1].startsWith(qy)&&(this.authToken=atob(t[1].slice(qy.length))),this.endPoint=null,this.token=null,this.skipHeartbeat=!0,this.reqs=new Set,this.awaitingBatchAck=!1,this.currentBatch=null,this.currentBatchTimer=null,this.batchBuffer=[],this.onopen=function(){},this.onerror=function(){},this.onmessage=function(){},this.onclose=function(){},this.pollEndpoint=this.normalizeEndpoint(e),this.readyState=Qa.connecting,setTimeout(()=>this.poll(),0)}normalizeEndpoint(e){return e.replace("ws://","http://").replace("wss://","https://").replace(new RegExp("(.*)/"+Wy.websocket),"$1/"+Wy.longpoll)}endpointURL(){return sm.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(e,t,n){this.close(e,t,n),this.readyState=Qa.connecting}ontimeout(){this.onerror("timeout"),this.closeAndRetry(1005,"timeout",!1)}isActive(){return this.readyState===Qa.open||this.readyState===Qa.connecting}poll(){const e={Accept:"application/json"};this.authToken&&(e["X-Phoenix-AuthToken"]=this.authToken),this.ajax("GET",e,null,()=>this.ontimeout(),t=>{if(t){var{status:n,token:a,messages:i}=t;if(n===410&&this.token!==null){this.onerror(410),this.closeAndRetry(3410,"session_gone",!1);return}this.token=a}else n=0;switch(n){case 200:i.forEach(r=>{setTimeout(()=>this.onmessage({data:r}),0)}),this.poll();break;case 204:this.poll();break;case 410:this.readyState=Qa.open,this.onopen({}),this.poll();break;
590case 403:this.onerror(403),this.close(1008,"forbidden",!1);break;case 0:case 500:this.onerror(500),this.closeAndRetry(1011,"internal server error",500);break;default:throw new Error(`unhandled poll status ${n}`)}})}send(e){typeof e!="string"&&(e=jV(e)),this.currentBatch?this.currentBatch.push(e):this.awaitingBatchAck?this.batchBuffer.push(e):(this.currentBatch=[e],this.currentBatchTimer=setTimeout(()=>{this.batchSend(this.currentBatch),this.currentBatch=null},0))}batchSend(e){this.awaitingBatchAck=!0,this.ajax("POST",{"Content-Type":"application/x-ndjson"},e.join(` 591`),()=>this.onerror("timeout"),t=>{this.awaitingBatchAck=!1,!t||t.status!==200?(this.onerror(t&&t.status),this.closeAndRetry(1011,"internal server error",!1)):this.batchBuffer.length>0&&(this.batchSend(this.batchBuffer),this.batchBuffer=[])})}close(e,t,n){for(let i of this.reqs)i.abort();this.readyState=Qa.closed;let a=Object.assign({code:1e3,reason:void 0,wasClean:!0},{code:e,reason:t,wasClean:n});this.batchBuffer=[],clearTimeout(this.currentBatchTimer),this.currentBatchTimer=null,typeof CloseEvent<"u"?this.onclose(new CloseEvent("close",a)):this.onclose(a)}ajax(e,t,n,a,i){let r,s=()=>{this.reqs.delete(r),a()};r=sm.request(e,this.endpointURL(),t,n,this.timeout,s,l=>{this.reqs.delete(r),this.isActive()&&i(l)}),this.reqs.add(r)}},_V=class ou{constructor(t,n={}){let a=n.events||{state:"presence_state",diff:"presence_diff"};this.state={},this.pendingDiffs=[],this.channel=t,this.joinRef=null,this.caller={onJoin:function(){},onLeave:function(){},onSync:function(){}},this.channel.on(a.state,i=>{let{onJoin:r,onLeave:s,onSync:l}=this.caller;this.joinRef=this.channel.joinRef(),this.state=ou.syncState(this.state,i,r,s),this.pendingDiffs.forEach(u=>{this.state=ou.syncDiff(this.state,u,r,s)}),this.pendingDiffs=[],l()}),this.channel.on(a.diff,i=>{let{onJoin:r,onLeave:s,onSync:l}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(i):(this.state=ou.syncDiff(this.state,i,r,s),l())})}onJoin(t){this.caller.onJoin=t}onLeave(t){this.caller.onLeave=t}onSync(t){this.caller.onSync=t}list(t){return ou.list(this.state,t)}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel.joinRef()}static syncState(t,n,a,i){let r=this.clone(t),s={},l={};return this.map(r,(u,c)=>{n[u]||(l[u]=c)}),this.map(n,(u,c)=>{let h=r[u];if(h){let d=c.metas.map(g=>g.phx_ref),m=h.metas.map(g=>g.phx_ref),f=c.metas.filter(g=>m.indexOf(g.phx_ref)<0),y=h.metas.filter(g=>d.indexOf(g.phx_ref)<0);f.length>0&&(s[u]=c,s[u].metas=f),y.length>0&&(l[u]=this.clone(h),l[u].metas=y)}else s[u]=c}),this.syncDiff(r,{joins:s,leaves:l},a,i)}static syncDiff(t,n,a,i){let{joins:r,leaves:s}=this.clone(n);return a||(a=function(){}),i||(i=function(){}),this.map(r,(l,u)=>{let c=t[l];if(t[l]=this.clone(u),c){let h=t[l].metas.map(m=>m.phx_ref),d=c.metas.filter(m=>h.indexOf(m.phx_ref)<0);t[l].metas.unshift(...d)}a(l,c,u)}),this.map(s,(l,u)=>{let c=t[l];if(!c)return;let h=u.metas.map(d=>d.phx_ref);c.metas=c.metas.filter(d=>h.indexOf(d.phx_ref)<0),i(l,c,u),c.metas.length===0&&delete t[l]}),t}static list(t,n){return n||(n=function(a,i){return i}),this.map(t,(a,i)=>n(a,i))}static map(t,n){return Object.getOwnPropertyNames(t).map(a=>n(a,t[a]))}static clone(t){return JSON.parse(JSON.stringify(t))}},Ed={HEADER_LENGTH:1,META_LENGTH:4,KINDS:{push:0,reply:1,broadcast:2},encode(e,t){if(e.payload.constructor===ArrayBuffer)return t(this.binaryEncode(e));{let n=[e.join_ref,e.ref,e.topic,e.event,e.payload];return t(JSON.stringify(n))}},decode(e,t){if(e.constructor===ArrayBuffer)return t(this.binaryDecode(e));{let[n,a,i,r,s]=JSON.parse(e);return t({join_ref:n,ref:a,topic:i,event:r,payload:s})}},binaryEncode(e){let{join_ref:t,ref:n,event:a,topic:i,payload:r}=e,s=this.META_LENGTH+t.length+n.length+i.length+a.length,l=new ArrayBuffer(this.HEADER_LENGTH+s),u=new DataView(l),c=0;u.setUint8(c++,this.KINDS.push),u.setUint8(c++,t.length),u.setUint8(c++,n.length),u.setUint8(c++,i.length),u.setUint8(c++,a.length),Array.from(t,d=>u.setUint8(c++,d.charCodeAt(0))),Array.from(n,d=>u.setUint8(c++,d.charCodeAt(0))),Array.from(i,d=>u.setUint8(c++,d.charCodeAt(0))),Array.from(a,d=>u.setUint8(c++,d.charCodeAt(0)));var h=new Uint8Array(l.byteLength+r.byteLength);return h.set(new Uint8Array(l),0),h.set(new Uint8Array(r),l.byteLength),h.buffer},binaryDecode(e){let t=new DataView(e),n=t.getUint8(0),a=new TextDecoder;switch(n){case this.KINDS.push:return this.decodePush(e,t,a);case this.KINDS.reply:return this.decodeReply(e,t,a);case this.KINDS.broadcast:return this.decodeBroadcast(e,t,a)}}
vendor: 8,419 bytes, line 591
591,decodePush(e,t,n){let a=t.getUint8(1),i=t.getUint8(2),r=t.getUint8(3),s=this.HEADER_LENGTH+this.META_LENGTH-1,l=n.decode(e.slice(s,s+a));s=s+a;let u=n.decode(e.slice(s,s+i));s=s+i;let c=n.decode(e.slice(s,s+r));s=s+r;let h=e.slice(s,e.byteLength);return{join_ref:l,ref:null,topic:u,event:c,payload:h}},decodeReply(e,t,n){let a=t.getUint8(1),i=t.getUint8(2),r=t.getUint8(3),s=t.getUint8(4),l=this.HEADER_LENGTH+this.META_LENGTH,u=n.decode(e.slice(l,l+a));l=l+a;let c=n.decode(e.slice(l,l+i));l=l+i;let h=n.decode(e.slice(l,l+r));l=l+r;let d=n.decode(e.slice(l,l+s));l=l+s;let m=e.slice(l,e.byteLength),f={status:d,response:m};return{join_ref:u,ref:c,topic:h,event:wi.reply,payload:f}},decodeBroadcast(e,t,n){let a=t.getUint8(1),i=t.getUint8(2),r=this.HEADER_LENGTH+2,s=n.decode(e.slice(r,r+a));r=r+a;let l=n.decode(e.slice(r,r+i));r=r+i;let u=e.slice(r,e.byteLength);return{join_ref:null,ref:null,topic:s,event:l,payload:u}}},SV=class{constructor(e,t={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.fallbackRef=null,this.timeout=t.timeout||xV,this.transport=t.transport||qa.WebSocket||Hs,this.conn=void 0,this.primaryPassedHealthCheck=!1,this.longPollFallbackMs=t.longPollFallbackMs,this.fallbackTimer=null,this.sessionStore=t.sessionStorage||qa&&qa.sessionStorage,this.establishedConnections=0,this.defaultEncoder=Ed.encode.bind(Ed),this.defaultDecoder=Ed.decode.bind(Ed),this.closeWasClean=!0,this.disconnecting=!1,this.binaryType=t.binaryType||"arraybuffer",this.connectClock=1,this.pageHidden=!1,this.encode=void 0,this.decode=void 0,this.transport!==Hs?(this.encode=t.encode||this.defaultEncoder,this.decode=t.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder);let n=null;no&&no.addEventListener&&(no.addEventListener("pagehide",a=>{this.conn&&(this.disconnect(),n=this.connectClock)}),no.addEventListener("pageshow",a=>{n===this.connectClock&&(n=null,this.connect())}),no.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"?this.pageHidden=!0:(this.pageHidden=!1,!this.isConnected()&&!this.closeWasClean&&this.teardown(()=>this.connect()))})),this.heartbeatIntervalMs=t.heartbeatIntervalMs||3e4,this.autoSendHeartbeat=t.autoSendHeartbeat??!0,this.heartbeatCallback=t.heartbeatCallback??(()=>{}),this.rejoinAfterMs=a=>t.rejoinAfterMs?t.rejoinAfterMs(a):[1e3,2e3,5e3][a-1]||1e4,this.reconnectAfterMs=a=>t.reconnectAfterMs?t.reconnectAfterMs(a):[10,50,100,150,200,250,500,1e3,2e3][a-1]||5e3,this.logger=t.logger||null,!this.logger&&t.debug&&(this.logger=(a,i,r)=>{console.log(`${a}: ${i}`,r)}),this.longpollerTimeout=t.longpollerTimeout||2e4,this.params=ju(t.params||{}),this.endPoint=`${e}/${Wy.websocket}`,this.vsn=t.vsn||wV,this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.heartbeatSentAt=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new QE(()=>{if(this.pageHidden){this.log("Not reconnecting as page is hidden!"),this.teardown();return}this.teardown(async()=>{t.beforeReconnect&&await t.beforeReconnect(),this.connect()})},this.reconnectAfterMs),this.authToken=t.authToken}getLongPollTransport(){return Hs}replaceTransport(e){this.connectClock++,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.conn&&(this.conn.close(),this.conn=null),this.transport=e}protocol(){return location.protocol.match(/^https/)?"wss":"ws"}endPointURL(){let e=sm.appendParams(sm.appendParams(this.endPoint,this.params()),{vsn:this.vsn});return e.charAt(0)!=="/"?e:e.charAt(1)==="/"?`${this.protocol()}:${e}`:`${this.protocol()}://${location.host}${e}`}disconnect(e,t,n){this.connectClock++,this.disconnecting=!0,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.teardown(()=>{this.disconnecting=!1,e&&e()},t,n)}connect(e){e&&(console&&console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"),this.params=ju(e)),!(this.conn&&!this.disconnecting)&&(this.longPollFallbackMs&&this.transport!==Hs?this.connectWithFallback(Hs,this.longPollFallbackMs):this.transportConnect())}log(e,t,n){this.logger&&this.logger(e,t,n)}hasLogger(){return this.logger!==null}onOpen(e){let t=this.makeRef();return this.stateChangeCallbacks.open.push([t,e]),t}onClose(e){let t=this.makeRef();return this.stateChangeCallbacks.close.push([t,e]),t}onError(e){let t=this.makeRef();return this.stateChangeCallbacks.error.push([t,e]),t}onMessage(e){let t=this.makeRef();return this.stateChangeCallbacks.message.push([t,e]),t}onHeartbeat(e){this.heartbeatCallback=e}ping(e){if(!this.isConnected())return!1;let t=this.makeRef(),n=Date.now();this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:t});let a=this.onMessage(i=>{i.ref===t&&(this.off([a]),e(Date.now()-n))});return!0}transportName(e){switch(e){case Hs:return"LongPoll";default:return e.name}}transportConnect(){this.connectClock++,this.closeWasClean=!1;let e;this.authToken&&(e=["phoenix",`${qy}${btoa(this.authToken).replace(/=/g,"")}`]),this.conn=new this.transport(this.endPointURL(),e),this.conn.binaryType=this.binaryType,this.conn.timeout=this.longpollerTimeout,this.conn.onopen=()=>this.onConnOpen(),this.conn.onerror=t=>this.onConnError(t),this.conn.onmessage=t=>this.onConnMessage(t),this.conn.onclose=t=>this.onConnClose(t)}getSession(e){return this.sessionStore&&this.sessionStore.getItem(e)}storeSession(e,t){this.sessionStore&&this.sessionStore.setItem(e,t)}connectWithFallback(e,t=2500){clearTimeout(this.fallbackTimer);let n=!1,a=!0,i,r,s=this.transportName(e),l=u=>{this.log("transport",`falling back to ${s}...`,u),this.off([i,r]),a=!1,this.replaceTransport(e),this.transportConnect()};if(this.getSession(`phx:fallback:${s}`))return l("memorized");this.fallbackTimer=setTimeout(l,t),r=this.onError(u=>{this.log("transport","error",u),a&&!n&&(clearTimeout(this.fallbackTimer),l(u))}),this.fallbackRef&&this.off([this.fallbackRef]),this.fallbackRef=this.onOpen(()=>{if(n=!0,!a){let u=this.transportName(e);return this.primaryPassedHealthCheck||this.storeSession(`phx:fallback:${u}`,"true"),this.log("transport",`established ${u} fallback`)}clearTimeout(this.fallbackTimer),this.fallbackTimer=setTimeout(l,t),this.ping(u=>{this.log("transport","connected to primary after",u),this.primaryPassedHealthCheck=!0,clearTimeout(this.fallbackTimer)})}),this.transportConnect()}clearHeartbeats(){clearTimeout(this.heartbeatTimer),clearTimeout(this.heartbeatTimeoutTimer)}onConnOpen(){this.hasLogger()&&this.log("transport",`connected to ${this.endPointURL()}`),this.closeWasClean=!1,this.disconnecting=!1,this.establishedConnections++,this.flushSendBuffer(),this.reconnectTimer.reset(),this.autoSendHeartbeat&&this.resetHeartbeat(),this.triggerStateCallbacks("open")}heartbeatTimeout(){if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.hasLogger()&&this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(e){this.log("error","error in heartbeat callback",e)}this.triggerChanError(),this.closeWasClean=!1,this.teardown(()=>this.reconnectTimer.scheduleTimeout(),kV,"heartbeat timeout")}}resetHeartbeat(){this.conn&&this.conn.skipHeartbeat||(this.pendingHeartbeatRef=null,this.clearHeartbeats(),this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}teardown(e,t,n){if(!this.conn)return e&&e();const a=this.conn;this.waitForBufferDone(a,()=>{t?a.close(t,n||""):a.close(),this.waitForSocketClosed(a,()=>{this.conn===a&&(this.conn.onopen=function(){},this.conn.onerror=function(){},this.conn.onmessage=function(){},this.conn.onclose=function(){},this.conn=null),e&&e()})})}waitForBufferDone(e,t,n=1){if(n===5||!e.bufferedAmount){t();return}setTimeout(()=>{this.waitForBufferDone(e,t,n+1)},150*n)}waitForSocketClosed(e,t,n=1){if(n===5||e.readyState===Qa.closed){t();return}setTimeout(()=>{this.waitForSocketClosed(e,t,n+1)},150*n)}onConnClose(e){this.conn&&(this.conn.onclose=()=>{}),this.hasLogger()&&this.log("transport","close",e),this.triggerChanError(),this.clearHeartbeats(),this.closeWasClean||this.reconnectTimer.scheduleTimeout(),this.triggerStateCallbacks("close",e)}onConnError(e){this.hasLogger()&&this.log("transport",e);let t=this.transport,n=this.establishedConnections;this.triggerStateCallbacks("error",e,t,n),(t===this.transport||n>0)&&this.triggerChanError()}
591triggerChanError(){this.channels.forEach(e=>{e.isErrored()||e.isLeaving()||e.isClosed()||e.trigger(wi.error)})}connectionState(){switch(this.conn&&this.conn.readyState){case Qa.connecting:return"connecting";case Qa.open:return"open";case Qa.closing:return"closing";default:return"closed"}}isConnected(){return this.connectionState()==="open"}remove(e){this.off(e.stateChangeRefs),this.channels=this.channels.filter(t=>t!==e)}off(e){for(let t in this.stateChangeCallbacks)this.stateChangeCallbacks[t]=this.stateChangeCallbacks[t].filter(([n])=>e.indexOf(n)===-1)}channel(e,t={}){let n=new bV(e,t,this);return this.channels.push(n),n}push(e){if(this.hasLogger()){let{topic:t,event:n,payload:a,ref:i,join_ref:r}=e;this.log("push",`${t} ${n} (${r}, ${i})`,a)}this.isConnected()?this.encode(e,t=>this.conn.send(t)):this.sendBuffer.push(()=>this.encode(e,t=>this.conn.send(t)))}makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}sendHeartbeat(){if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(e){this.log("error","error in heartbeat callback",e)}return}if(this.pendingHeartbeatRef){this.heartbeatTimeout();return}this.pendingHeartbeatRef=this.makeRef(),this.heartbeatSentAt=Date.now(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(e){this.log("error","error in heartbeat callback",e)}this.heartbeatTimeoutTimer=setTimeout(()=>this.heartbeatTimeout(),this.heartbeatIntervalMs)}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(e=>e()),this.sendBuffer=[])}onConnMessage(e){this.decode(e.data,t=>{let{topic:n,event:a,payload:i,ref:r,join_ref:s}=t;if(r&&r===this.pendingHeartbeatRef){const l=this.heartbeatSentAt?Date.now()-this.heartbeatSentAt:void 0;this.clearHeartbeats();try{this.heartbeatCallback(i.status==="ok"?"ok":"error",l)}catch(u){this.log("error","error in heartbeat callback",u)}this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.autoSendHeartbeat&&(this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}this.hasLogger()&&this.log("receive",`${i.status||""} ${n} ${a} ${r&&"("+r+")"||""}`.trim(),i);for(let l=0;l<this.channels.length;l++){const u=this.channels[l];u.isMember(n,a,i,s)&&u.trigger(a,i,r,s)}this.triggerStateCallbacks("message",t)})}triggerStateCallbacks(e,...t){try{this.stateChangeCallbacks[e].forEach(([n,a])=>{try{a(...t)}catch(i){this.log("error",`error in ${e} callback`,i)}})}catch(n){this.log("error",`error triggering ${e} callbacks`,n)}}leaveOpenTopic(e){let t=this.channels.find(n=>n.topic===e&&(n.isJoined()||n.isJoining()));t&&(this.hasLogger()&&this.log("transport",`leaving duplicate topic "${e}"`),t.leave())}};class _u{constructor(t,n){const a=CV(n);this.presence=new _V(t.getChannel(),a),this.presence.onJoin((i,r,s)=>{const l=_u.onJoinPayload(i,r,s);t.getChannel().trigger("presence",l)}),this.presence.onLeave((i,r,s)=>{const l=_u.onLeavePayload(i,r,s);t.getChannel().trigger("presence",l)}),this.presence.onSync(()=>{t.getChannel().trigger("presence",{event:"sync"})})}get state(){return _u.transformState(this.presence.state)}static transformState(t){return t=NV(t),Object.getOwnPropertyNames(t).reduce((n,a)=>{const i=t[a];return n[a]=mh(i),n},{})}static onJoinPayload(t,n,a){const i=j1(n),r=mh(a);return{event:"join",key:t,currentPresences:i,newPresences:r}}static onLeavePayload(t,n,a){const i=j1(n),r=mh(a);return{event:"leave",key:t,currentPresences:i,leftPresences:r}}}function mh(e){return e.metas.map(t=>(t.presence_ref=t.phx_ref,delete t.phx_ref,delete t.phx_ref_prev,t))}function NV(e){return JSON.parse(JSON.stringify(e))}function CV(e){return(e==null?void 0:e.events)&&{events:e.events}}function j1(e){return e!=null&&e.metas?mh(e):[]}var _1;(function(e){e.SYNC="sync",e.JOIN="join",e.LEAVE="leave"})(_1||(_1={}));class TV{get state(){return this.presenceAdapter.state}constructor(t,n){this.channel=t,this.presenceAdapter=new _u(this.channel.channelAdapter,n)}}class EV{constructor(t,n,a){const i=AV(a);this.channel=t.getSocket().channel(n,i),this.socket=t}get state(){return this.channel.state}set state(t){this.channel.state=t}get joinedOnce(){return this.channel.joinedOnce}get joinPush(){return this.channel.joinPush}get rejoinTimer(){return this.channel.rejoinTimer}on(t,n){return this.channel.on(t,n)}off(t,n){this.channel.off(t,n)}subscribe(t){return this.channel.join(t)}unsubscribe(t){return this.channel.leave(t)}teardown(){this.channel.teardown()}onClose(t){this.channel.onClose(t)}onError(t){return this.channel.onError(t)}push(t,n,a){let i;try{i=this.channel.push(t,n,a)}catch{throw`tried to push '${t}' to '${this.channel.topic}' before joining. Use channel.subscribe() before pushing events`}if(this.channel.pushBuffer.length>uV){const r=this.channel.pushBuffer.shift();r.cancelTimeout(),this.socket.log("channel",`discarded push due to buffer overflow: ${r.event}`,r.payload())}return i}updateJoinPayload(t){const n=this.channel.joinPush.payload();this.channel.joinPush.payload=()=>Object.assign(Object.assign({},n),t)}canPush(){return this.socket.isConnected()&&this.state===Zi.joined}isJoined(){return this.state===Zi.joined}isJoining(){return this.state===Zi.joining}isClosed(){return this.state===Zi.closed}isLeaving(){return this.state===Zi.leaving}updateFilterBindings(t){this.channel.filterBindings=t}updatePayloadTransform(t){this.channel.onMessage=t}getChannel(){return this.channel}}function AV(e){return{config:Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},e.config)}}var S1;(function(e){e.ALL="*",e.INSERT="INSERT",e.UPDATE="UPDATE",e.DELETE="DELETE"})(S1||(S1={}));var xo;(function(e){e.BROADCAST="broadcast",e.PRESENCE="presence",e.POSTGRES_CHANGES="postgres_changes",e.SYSTEM="system"})(xo||(xo={}));var xi;(function(e){e.SUBSCRIBED="SUBSCRIBED",e.TIMED_OUT="TIMED_OUT",e.CLOSED="CLOSED",e.CHANNEL_ERROR="CHANNEL_ERROR"})(xi||(xi={}));class Su{get state(){return this.channelAdapter.state}set state(t){this.channelAdapter.state=t}get joinedOnce(){return this.channelAdapter.joinedOnce}get timeout(){return this.socket.timeout}get joinPush(){return this.channelAdapter.joinPush}get rejoinTimer(){return this.channelAdapter.rejoinTimer}constructor(t,n={config:{}},a){var i,r;if(this.topic=t,this.params=n,this.socket=a,this.bindings={},this.subTopic=t.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},n.config),this.channelAdapter=new EV(this.socket.socketAdapter,t,this.params),this.presence=new TV(this),this._onClose(()=>{this.socket._remove(this)}),this._updateFilterTransform(),this.broadcastEndpointURL=JE(this.socket.socketAdapter.endPointURL()),this.private=this.params.config.private||!1,!this.private&&(!((r=(i=this.params.config)===null||i===void 0?void 0:i.broadcast)===null||r===void 0)&&r.replay))throw`tried to use replay on public channel '${this.topic}'. It must be a private channel.`}subscribe(t,n=this.timeout){var a,i,r;if(this.socket.isConnected()||this.socket.connect(),this.channelAdapter.isClosed()){const{config:{broadcast:s,presence:l,private:u}}=this.params,c=(i=(a=this.bindings.postgres_changes)===null||a===void 0?void 0:a.map(f=>f.filter))!==null&&i!==void 0?i:[],h=!!this.bindings[xo.PRESENCE]&&this.bindings[xo.PRESENCE].length>0||((r=this.params.config.presence)===null||r===void 0?void 0:r.enabled)===!0,d={},m={broadcast:s,presence:Object.assign(Object.assign({},l),{enabled:h}),postgres_changes:c,private:u};this.socket.accessTokenValue&&(d.access_token=this.socket.accessTokenValue),this._onError(f=>{t==null||t(xi.CHANNEL_ERROR,f)}),this._onClose(()=>t==null?void 0:t(xi.CLOSED)),this.updateJoinPayload(Object.assign({config:m},d)),this._updateFilterMessage(),this.channelAdapter.subscribe(n).receive("ok",async({postgres_changes:f})=>{if(this.socket._isManualToken()||this.socket.setAuth(),f===void 0){t==null||t(xi.SUBSCRIBED);return}this._updatePostgresBindings(f,t)}).receive("error",f=>{this.state=Zi.errored,t==null||t(xi.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(f).join(", ")||"error")))}).receive("timeout",()=>{t==null||t(xi.TIMED_OUT)})}return this}_updatePostgresBindings(t,n){var a;const i=this.bindings.postgres_changes,r=(a=i==null?void 0:i.length)!==null&&a!==void 0?a:0,s=[];for(let l=0;l<r;l++){const u=i[l],{filter:{event:c,schema:h,table:d,filter:m}}=u,f=t&&t[l];if(f&&f.event===c&&Su.isFilterValueEqual(f.schema,h)&&Su.isFilterValueEqual(f.table,d)&&Su.isFilterValueEqual(f.filter,m))s.push(Object.assign(Object.assign({},u),{id:f.id}));else{this.unsubscribe(),this.state=Zi.errored,n==null||n(xi.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=s,this.state!=Zi.errored&&n&&n(xi.SUBSCRIBED)}presenceState(){return this.presence.state}async track(t,n={}){return await this.send({type:"presence",event:"track",payload:t},n.timeout||this.timeout)}async untrack(t={}){return await this.send({type:"presence",event:"untrack"},t)}on(t,n,a){const i=this.channelAdapter.isJoined()||this.channelAdapter.isJoining(),r=t===xo.PRESENCE||t===xo.POSTGRES_CHANGES;if(i&&r)throw this.socket.log("channel",`cannot add \`${t}\` callbacks for ${this.topic} after \`subscribe()\`.`),new Error(`cannot add \`${t}\` callbacks for ${this.topic} after \`subscribe()\`.`);return this._on(t,n,a)}async httpSend(t,n,a={}){var i;if(n==null)return Promise.reject("Payload is required for httpSend()");const r={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(r.Authorization=`Bearer ${this.socket.accessTokenValue}`);const s={method:"POST",headers:r,body:JSON.stringify({messages:[{topic:this.subTopic,event:t,payload:n,private:this.private}]})},l=await this._fetchWithTimeout(this.broadcastEndpointURL,s,(i=a.timeout)!==null&&i!==void 0?i:this.timeout);if(l.status===202)return{success:!0};let u=l.statusText;
591try{const c=await l.json();u=c.error||c.message||u}catch{}return Promise.reject(new Error(u))}async send(t,n={}){var a,i;if(!this.channelAdapter.canPush()&&t.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:r,payload:s}=t,l={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(l.Authorization=`Bearer ${this.socket.accessTokenValue}`);const u={method:"POST",headers:l,body:JSON.stringify({messages:[{topic:this.subTopic,event:r,payload:s,private:this.private}]})};try{const c=await this._fetchWithTimeout(this.broadcastEndpointURL,u,(a=n.timeout)!==null&&a!==void 0?a:this.timeout);return await((i=c.body)===null||i===void 0?void 0:i.cancel()),c.ok?"ok":"error"}catch(c){return c.name==="AbortError"?"timed out":"error"}}else return new Promise(r=>{var s,l,u;const c=this.channelAdapter.push(t.type,t,n.timeout||this.timeout);t.type==="broadcast"&&!(!((u=(l=(s=this.params)===null||s===void 0?void 0:s.config)===null||l===void 0?void 0:l.broadcast)===null||u===void 0)&&u.ack)&&r("ok"),c.receive("ok",()=>r("ok")),c.receive("error",()=>r("error")),c.receive("timeout",()=>r("timed out"))})}updateJoinPayload(t){this.channelAdapter.updateJoinPayload(t)}async unsubscribe(t=this.timeout){return new Promise(n=>{this.channelAdapter.unsubscribe(t).receive("ok",()=>n("ok")).receive("timeout",()=>n("timed out")).receive("error",()=>n("error"))})}teardown(){this.channelAdapter.teardown()}async _fetchWithTimeout(t,n,a){const i=new AbortController,r=setTimeout(()=>i.abort(),a),s=await this.socket.fetch(t,Object.assign(Object.assign({},n),{signal:i.signal}));return clearTimeout(r),s}_on(t,n,a){const i=t.toLocaleLowerCase(),r=this.channelAdapter.on(t,a),s={type:i,filter:n,callback:a,ref:r};return this.bindings[i]?this.bindings[i].push(s):this.bindings[i]=[s],this._updateFilterMessage(),this}_onClose(t){this.channelAdapter.onClose(t)}_onError(t){this.channelAdapter.onError(t)}_updateFilterMessage(){this.channelAdapter.updateFilterBindings((t,n,a)=>{var i,r,s,l,u,c,h;const d=t.event.toLocaleLowerCase();if(this._notThisChannelEvent(d,a))return!1;const m=(i=this.bindings[d])===null||i===void 0?void 0:i.find(f=>f.ref===t.ref);if(!m)return!0;if(["broadcast","presence","postgres_changes"].includes(d))if("id"in m){const f=m.id,y=(r=m.filter)===null||r===void 0?void 0:r.event;return f&&((s=n.ids)===null||s===void 0?void 0:s.includes(f))&&(y==="*"||(y==null?void 0:y.toLocaleLowerCase())===((l=n.data)===null||l===void 0?void 0:l.type.toLocaleLowerCase()))}else{const f=(c=(u=m==null?void 0:m.filter)===null||u===void 0?void 0:u.event)===null||c===void 0?void 0:c.toLocaleLowerCase();return f==="*"||f===((h=n==null?void 0:n.event)===null||h===void 0?void 0:h.toLocaleLowerCase())}else return m.type.toLocaleLowerCase()===d})}_notThisChannelEvent(t,n){const{close:a,error:i,leave:r,join:s}=GE;return n&&[a,i,r,s].includes(t)&&n!==this.joinPush.ref}_updateFilterTransform(){this.channelAdapter.updatePayloadTransform((t,n,a)=>{if(typeof n=="object"&&"ids"in n){const i=n.data,{schema:r,table:s,commit_timestamp:l,type:u,errors:c}=i;return Object.assign(Object.assign({},{schema:r,table:s,commit_timestamp:l,eventType:u,new:{},old:{},errors:c}),this._getPayloadRecords(i))}return n})}copyBindings(t){if(this.joinedOnce)throw new Error("cannot copy bindings into joined channel");for(const n in t.bindings)for(const a of t.bindings[n])this._on(a.type,a.filter,a.callback)}static isFilterValueEqual(t,n){return(t??void 0)===(n??void 0)}_getPayloadRecords(t){const n={new:{},old:{}};return(t.type==="INSERT"||t.type==="UPDATE")&&(n.new=b1(t.columns,t.record)),(t.type==="UPDATE"||t.type==="DELETE")&&(n.old=b1(t.columns,t.old_record)),n}}class PV{constructor(t,n){this.socket=new SV(t,n)}get timeout(){return this.socket.timeout}get endPoint(){return this.socket.endPoint}get transport(){return this.socket.transport}get heartbeatIntervalMs(){return this.socket.heartbeatIntervalMs}get heartbeatCallback(){return this.socket.heartbeatCallback}set heartbeatCallback(t){this.socket.heartbeatCallback=t}get heartbeatTimer(){return this.socket.heartbeatTimer}get pendingHeartbeatRef(){return this.socket.pendingHeartbeatRef}get reconnectTimer(){return this.socket.reconnectTimer}get vsn(){return this.socket.vsn}get encode(){return this.socket.encode}get decode(){return this.socket.decode}get reconnectAfterMs(){return this.socket.reconnectAfterMs}get sendBuffer(){return this.socket.sendBuffer}get stateChangeCallbacks(){return this.socket.stateChangeCallbacks}connect(){this.socket.connect()}disconnect(t,n,a,i=1e4){return new Promise(r=>{setTimeout(()=>r("timeout"),i),this.socket.disconnect(()=>{t(),r("ok")},n,a)})}push(t){this.socket.push(t)}log(t,n,a){this.socket.log(t,n,a)}makeRef(){return this.socket.makeRef()}onOpen(t){this.socket.onOpen(t)}onClose(t){this.socket.onClose(t)}onError(t){this.socket.onError(t)}onMessage(t){this.socket.onMessage(t)}isConnected(){return this.socket.isConnected()}isConnecting(){return this.socket.connectionState()==Vy.connecting}isDisconnecting(){return this.socket.connectionState()==Vy.closing}connectionState(){return this.socket.connectionState()}endPointURL(){return this.socket.endPointURL()}sendHeartbeat(){this.socket.sendHeartbeat()}getSocket(){return this.socket}}const MV={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},RV=[1e3,2e3,5e3,1e4],IV=1e4,OV=` 592 addEventListener("message", (e) => { 593 if (e.data.event === "start") { 594 setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval); 595 } 596 });`;class LV{get endPoint(){return this.socketAdapter.endPoint}get timeout(){return this.socketAdapter.timeout}get transport(){return this.socketAdapter.transport}get heartbeatCallback(){return this.socketAdapter.heartbeatCallback}get heartbeatIntervalMs(){return this.socketAdapter.heartbeatIntervalMs}get heartbeatTimer(){return this.worker?this._workerHeartbeatTimer:this.socketAdapter.heartbeatTimer}get pendingHeartbeatRef(){return this.worker?this._pendingWorkerHeartbeatRef:this.socketAdapter.pendingHeartbeatRef}get reconnectTimer(){return this.socketAdapter.reconnectTimer}get vsn(){return this.socketAdapter.vsn}get encode(){return this.socketAdapter.encode}get decode(){return this.socketAdapter.decode}get reconnectAfterMs(){return this.socketAdapter.reconnectAfterMs}get sendBuffer(){return this.socketAdapter.sendBuffer}get stateChangeCallbacks(){return this.socketAdapter.stateChangeCallbacks}constructor(t,n){var a;if(this.channels=new Array,this.accessTokenValue=null,this.accessToken=null,this.apiKey=null,this.httpEndpoint="",this.headers={},this.params={}
596,this.ref=0,this.serializer=new cV,this._manuallySetToken=!1,this._authPromise=null,this._workerHeartbeatTimer=void 0,this._pendingWorkerHeartbeatRef=null,this._resolveFetch=r=>r?(...s)=>r(...s):(...s)=>fetch(...s),!(!((a=n==null?void 0:n.params)===null||a===void 0)&&a.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=n.params.apikey;const i=this._initializeOptions(n);this.socketAdapter=new PV(t,i),this.httpEndpoint=JE(t),this.fetch=this._resolveFetch(n==null?void 0:n.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.isConnected())){this.accessToken&&!this._authPromise&&this._setAuthSafely("connect"),this._setupConnectionHandlers();try{this.socketAdapter.connect()}catch(t){const n=t.message;throw n.includes("Node.js")?new Error(`${n} 597 598To use Realtime in Node.js, you need to provide a WebSocket implementation: 599 600Option 1: Use Node.js 22+ which has native WebSocket support 601Option 2: Install and provide the "ws" package: 602 603 npm install ws 604 605 import ws from "ws" 606 const client = new RealtimeClient(url, { 607 ...options, 608 transport: ws 609 })`):new Error(`WebSocket not available: ${n}`)}this._handleNodeJsRaceCondition()}}endpointURL(){return this.socketAdapter.endPointURL()}async disconnect(t,n){return this.isDisconnecting()?"ok":await this.socketAdapter.disconnect(()=>{clearInterval(this._workerHeartbeatTimer),this._terminateWorker()},t,n)}getChannels(){return this.channels}async removeChannel(t){const n=await t.unsubscribe();return n==="ok"&&t.teardown(),this.channels.length===0&&this.disconnect(),n}async removeAllChannels(){const t=this.channels.map(async a=>{const i=await a.unsubscribe();return a.teardown(),i}),n=await Promise.all(t);return this.disconnect(),n}log(t,n,a){this.socketAdapter.log(t,n,a)}connectionState(){return this.socketAdapter.connectionState()||Vy.closed}isConnected(){return this.socketAdapter.isConnected()}isConnecting(){return this.socketAdapter.isConnecting()}isDisconnecting(){return this.socketAdapter.isDisconnecting()}channel(t,n={config:{}}){const a=`realtime:${t}`,i=this.getChannels().find(r=>r.topic===a);if(i)return i;{const r=new Su(`realtime:${t}`,n,this);return this.channels.push(r),r}}push(t){this.socketAdapter.push(t)}async setAuth(t=null){this._authPromise=this._performAuth(t);try{await this._authPromise}finally{this._authPromise=null}}_isManualToken(){return this._manuallySetToken}async sendHeartbeat(){this.socketAdapter.sendHeartbeat()}onHeartbeat(t){this.socketAdapter.heartbeatCallback=this._wrapHeartbeatCallback(t)}_makeRef(){return this.socketAdapter.makeRef()}_remove(t){this.channels=this.channels.filter(n=>n.topic!==t.topic)}async _performAuth(t=null){let n,a=!1;if(t)n=t,a=!0;else if(this.accessToken)try{n=await this.accessToken()}catch(i){this.log("error","Error fetching access token from callback",i),n=this.accessTokenValue}else n=this.accessTokenValue;a?this._manuallySetToken=!0:this.accessToken&&(this._manuallySetToken=!1),this.accessTokenValue!=n&&(this.accessTokenValue=n,this.channels.forEach(i=>{const r={access_token:n,version:rV};n&&i.updateJoinPayload(r),i.joinedOnce&&i.channelAdapter.isJoined()&&i.channelAdapter.push(GE.access_token,{access_token:n})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(t="general"){this._isManualToken()||this.setAuth().catch(n=>{this.log("error",`Error setting auth in ${t}`,n)})}_setupConnectionHandlers(){this.socketAdapter.onOpen(()=>{(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).catch(n=>{this.log("error","error waiting for auth on connect",n)}),this.worker&&!this.workerRef&&this._startWorkerHeartbeat()}),this.socketAdapter.onClose(()=>{this.worker&&this.workerRef&&this._terminateWorker()}),this.socketAdapter.onMessage(t=>{t.ref&&t.ref===this._pendingWorkerHeartbeatRef&&(this._pendingWorkerHeartbeatRef=null)})}_handleNodeJsRaceCondition(){this.socketAdapter.isConnected()&&this.socketAdapter.getSocket().onConnOpen()}_wrapHeartbeatCallback(t){return(n,a)=>{n=="sent"&&this._setAuthSafely(),t&&t(n,a)}}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const t=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(t),this.workerRef.onerror=n=>{this.log("worker","worker error",n.message),this._terminateWorker(),this.disconnect()},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)}_workerObjectUrl(t){let n;if(t)n=t;else{const a=new Blob([OV],{type:"application/javascript"});n=URL.createObjectURL(a)}return n}_initializeOptions(t){var n,a,i,r,s,l,u,c,h;this.worker=(n=t==null?void 0:t.worker)!==null&&n!==void 0?n:!1,this.accessToken=(a=t==null?void 0:t.accessToken)!==null&&a!==void 0?a:null;const d={};
609d.timeout=(i=t==null?void 0:t.timeout)!==null&&i!==void 0?i:lV,d.heartbeatIntervalMs=(r=t==null?void 0:t.heartbeatIntervalMs)!==null&&r!==void 0?r:MV.HEARTBEAT_INTERVAL,d.transport=(s=t==null?void 0:t.transport)!==null&&s!==void 0?s:aV.getWebSocketConstructor(),d.params=t==null?void 0:t.params,d.logger=t==null?void 0:t.logger,d.heartbeatCallback=this._wrapHeartbeatCallback(t==null?void 0:t.heartbeatCallback),d.reconnectAfterMs=(l=t==null?void 0:t.reconnectAfterMs)!==null&&l!==void 0?l:g=>RV[g-1]||IV;let m,f;const y=(u=t==null?void 0:t.vsn)!==null&&u!==void 0?u:oV;switch(y){case sV:m=(g,x)=>x(JSON.stringify(g)),f=(g,x)=>x(JSON.parse(g));break;case qE:m=this.serializer.encode.bind(this.serializer),f=this.serializer.decode.bind(this.serializer);break;default:throw new Error(`Unsupported serializer version: ${d.vsn}`)}if(d.vsn=y,d.encode=(c=t==null?void 0:t.encode)!==null&&c!==void 0?c:m,d.decode=(h=t==null?void 0:t.decode)!==null&&h!==void 0?h:f,d.beforeReconnect=this._reconnectAuth.bind(this),(t!=null&&t.logLevel||t!=null&&t.log_level)&&(this.logLevel=t.logLevel||t.log_level,d.params=Object.assign(Object.assign({},d.params),{log_level:this.logLevel})),this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=t==null?void 0:t.workerUrl,d.autoSendHeartbeat=!this.worker}return d}async _reconnectAuth(){await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()}}var oc=class extends Error{constructor(e,t){var n;super(e),this.name="IcebergError",this.status=t.status,this.icebergType=t.icebergType,this.icebergCode=t.icebergCode,this.details=t.details,this.isCommitStateUnknown=t.icebergType==="CommitStateUnknownException"||[500,502,504].includes(t.status)&&((n=t.icebergType)==null?void 0:n.includes("CommitState"))===!0}isNotFound(){return this.status===404}isConflict(){return this.status===409}isAuthenticationTimeout(){return this.status===419}};function DV(e,t,n){const a=new URL(t,e);if(n)for(const[i,r]of Object.entries(n))r!==void 0&&a.searchParams.set(i,r);return a.toString()}async function zV(e){return!e||e.type==="none"?{}:e.type==="bearer"?{Authorization:`Bearer ${e.token}`}:e.type==="header"?{[e.name]:e.value}:e.type==="custom"?await e.getHeaders():{}}function FV(e){const t=e.fetchImpl??globalThis.fetch;return{async request({method:n,path:a,query:i,body:r,headers:s}){const l=DV(e.baseUrl,a,i),u=await zV(e.auth),c=await t(l,{method:n,headers:{...r?{"Content-Type":"application/json"}:{},...u,...s},body:r?JSON.stringify(r):void 0}),h=await c.text(),d=(c.headers.get("content-type")||"").includes("application/json"),m=d&&h?JSON.parse(h):h;if(!c.ok){const f=d?m:void 0,y=f==null?void 0:f.error;throw new oc((y==null?void 0:y.message)??`Request failed with status ${c.status}`,{status:c.status,icebergType:y==null?void 0:y.type,icebergCode:y==null?void 0:y.code,details:f})}return{status:c.status,headers:c.headers,data:m}}}}function Ad(e){return e.join("�")}var BV=class{constructor(e,t=""){this.client=e,this.prefix=t}async listNamespaces(e){const t=e?{parent:Ad(e.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:t})).data.namespaces.map(a=>({namespace:a}))}async createNamespace(e,t){const n={namespace:e.namespace,properties:t==null?void 0:t.properties};return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces`,body:n})).data}async dropNamespace(e){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${Ad(e.namespace)}`})}async loadNamespaceMetadata(e){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Ad(e.namespace)}`})).data.properties}}async namespaceExists(e){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${Ad(e.namespace)}`}),!0}catch(t){if(t instanceof oc&&t.status===404)return!1;throw t}}async createNamespaceIfNotExists(e,t){try{return await this.createNamespace(e,t)}catch(n){if(n instanceof oc&&n.status===409)return;throw n}}};function Ws(e){return e.join("�")}var KV=class{constructor(e,t="",n){this.client=e,this.prefix=t,this.accessDelegation=n}async listTables(e){return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Ws(e.namespace)}/tables`})).data.identifiers}async createTable(e,t){const n={};return this.accessDelegation&&(n["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${Ws(e.namespace)}/tables`,body:t,headers:n})).data.metadata}async updateTable(e,t){const n=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${Ws(e.namespace)}/tables/${e.name}`,body:t});return{"metadata-location":n.data["metadata-location"],metadata:n.data.metadata}}async dropTable(e,t){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${Ws(e.namespace)}/tables/${e.name}`,query:{purgeRequested:String((t==null?void 0:t.purge)??!1)}})}async loadTable(e){const t={};return this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Ws(e.namespace)}/tables/${e.name}`,headers:t})).data.metadata}async tableExists(e){const t={};this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation);try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${Ws(e.namespace)}/tables/${e.name}`,headers:t}),!0}catch(n){if(n instanceof oc&&n.status===404)return!1;throw n}}async createTableIfNotExists(e,t){try{return await this.createTable(e,t)}catch(n){if(n instanceof oc&&n.status===409)return await this.loadTable({namespace:e.namespace,name:t.name});throw n}}},$V=class{constructor(e){var a;let t="v1";e.catalogName&&(t+=`/${e.catalogName}`);const n=e.baseUrl.endsWith("/")?e.baseUrl:`${e.baseUrl}/`;this.client=FV({baseUrl:n,auth:e.auth,fetchImpl:e.fetch}),this.accessDelegation=(a=e.accessDelegation)==null?void 0:a.join(","),this.namespaceOps=new BV(this.client,t),this.tableOps=new KV(this.client,t,this.accessDelegation)}async listNamespaces(e){return this.namespaceOps.listNamespaces(e)}async createNamespace(e,t){return this.namespaceOps.createNamespace(e,t)}async dropNamespace(e){await this.namespaceOps.dropNamespace(e)}async loadNamespaceMetadata(e){return this.namespaceOps.loadNamespaceMetadata(e)}async listTables(e){return this.tableOps.listTables(e)}
609async createTable(e,t){return this.tableOps.createTable(e,t)}async updateTable(e,t){return this.tableOps.updateTable(e,t)}async dropTable(e,t){await this.tableOps.dropTable(e,t)}async loadTable(e){return this.tableOps.loadTable(e)}async namespaceExists(e){return this.namespaceOps.namespaceExists(e)}async tableExists(e){return this.tableOps.tableExists(e)}async createNamespaceIfNotExists(e,t){return this.namespaceOps.createNamespaceIfNotExists(e,t)}async createTableIfNotExists(e,t){return this.tableOps.createTableIfNotExists(e,t)}},pf=class extends Error{constructor(e,t="storage",n,a){super(e),this.__isStorageError=!0,this.namespace=t,this.name=t==="vectors"?"StorageVectorsError":"StorageError",this.status=n,this.statusCode=a}};function gf(e){return typeof e=="object"&&e!==null&&"__isStorageError"in e}var Gy=class extends pf{constructor(e,t,n,a="storage"){super(e,a,t,n),this.name=a==="vectors"?"StorageVectorsApiError":"StorageApiError",this.status=t,this.statusCode=n}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}},XE=class extends pf{constructor(e,t,n="storage"){super(e,n),this.name=n==="vectors"?"StorageVectorsUnknownError":"StorageUnknownError",this.originalError=t}};const UV=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),VV=e=>{if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},Yy=e=>{if(Array.isArray(e))return e.map(n=>Yy(n));if(typeof e=="function"||e!==Object(e))return e;const t={};return Object.entries(e).forEach(([n,a])=>{const i=n.replace(/([-_][a-z])/gi,r=>r.toUpperCase().replace(/[-_]/g,""));t[i]=Yy(a)}),t},HV=e=>!e||typeof e!="string"||e.length===0||e.length>100||e.trim()!==e||e.includes("/")||e.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(e);function lc(e){"@babel/helpers - typeof";return lc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},lc(e)}function WV(e,t){if(lc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var a=n.call(e,t||"default");if(lc(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function qV(e){var t=WV(e,"string");return lc(t)=="symbol"?t:t+""}function GV(e,t,n){return(t=qV(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function N1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,a)}return n}function _e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?N1(Object(n),!0).forEach(function(a){GV(e,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):N1(Object(n)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(n,a))})}return e}const C1=e=>{var t;return e.msg||e.message||e.error_description||(typeof e.error=="string"?e.error:(t=e.error)===null||t===void 0?void 0:t.message)||JSON.stringify(e)},YV=async(e,t,n,a)=>{if(e!==null&&typeof e=="object"&&typeof e.json=="function"){const i=e;let r=parseInt(i.status,10);Number.isFinite(r)||(r=500),i.json().then(s=>{const l=(s==null?void 0:s.statusCode)||(s==null?void 0:s.code)||r+"";t(new Gy(C1(s),r,l,a))}).catch(()=>{const s=r+"";t(new Gy(i.statusText||`HTTP ${r} error`,r,s,a))})}else t(new XE(C1(e),e,a))},JV=(e,t,n,a)=>{const i={method:e,headers:(t==null?void 0:t.headers)||{}};if(e==="GET"||e==="HEAD"||!a)return _e(_e({},i),n);if(VV(a)){var r;const s=(t==null?void 0:t.headers)||{};let l;for(const[u,c]of Object.entries(s))u.toLowerCase()==="content-type"&&(l=c);i.headers=QV(s,"Content-Type",(r=l)!==null&&r!==void 0?r:"application/json"),i.body=JSON.stringify(a)}else i.body=a;return t!=null&&t.duplex&&(i.duplex=t.duplex),_e(_e({},i),n)};function QV(e,t,n){const a=_e({},e);for(const i of Object.keys(a))i.toLowerCase()===t.toLowerCase()&&delete a[i];return a[t]=n,a}async function Wl(e,t,n,a,i,r,s){return new Promise((l,u)=>{e(n,JV(t,a,i,r)).then(c=>{if(!c.ok)throw c;if(a!=null&&a.noResolveJson)return c;if(s==="vectors"){const h=c.headers.get("content-type");if(c.headers.get("content-length")==="0"||c.status===204)return{};
609if(!h||!h.includes("application/json"))return{}}return c.json()}).then(c=>l(c)).catch(c=>YV(c,u,a,s))})}function ZE(e="storage"){return{get:async(t,n,a,i)=>Wl(t,"GET",n,a,i,void 0,e),post:async(t,n,a,i,r)=>Wl(t,"POST",n,i,r,a,e),put:async(t,n,a,i,r)=>Wl(t,"PUT",n,i,r,a,e),head:async(t,n,a,i)=>Wl(t,"HEAD",n,_e(_e({},a),{},{noResolveJson:!0}),i,void 0,e),remove:async(t,n,a,i,r)=>Wl(t,"DELETE",n,i,r,a,e)}}const XV=ZE("storage"),{get:uc,post:Sa,put:Jy,head:ZV,remove:Lk}=XV,Fn=ZE("vectors");var Cl=class{constructor(e,t={},n,a="storage"){this.shouldThrowOnError=!1,this.url=e,this.headers=Object.fromEntries(Object.entries(t).map(([i,r])=>[i.toLowerCase(),r])),this.fetch=UV(n),this.namespace=a}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,t){return this.headers=_e(_e({},this.headers),{},{[e.toLowerCase()]:t}),this}async handleOperation(e){var t=this;try{return{data:await e(),error:null}}catch(n){if(t.shouldThrowOnError)throw n;if(gf(n))return{data:null,error:n};throw n}}},e6=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t}then(e,t){return this.execute().then(e,t)}async execute(){var e=this;try{return{data:(await e.downloadFn()).body,error:null}}catch(t){if(e.shouldThrowOnError)throw t;if(gf(t))return{data:null,error:t};throw t}}};let eA;eA=Symbol.toStringTag;var t6=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[eA]="BlobDownloadBuilder",this.promise=null}asStream(){return new e6(this.downloadFn,this.shouldThrowOnError)}then(e,t){return this.getPromise().then(e,t)}catch(e){return this.getPromise().catch(e)}finally(e){return this.getPromise().finally(e)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var e=this;try{return{data:await(await e.downloadFn()).blob(),error:null}}catch(t){if(e.shouldThrowOnError)throw t;if(gf(t))return{data:null,error:t};throw t}}};const n6={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},T1={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};var a6=class extends Cl{constructor(e,t={},n,a){super(e,t,a,"storage"),this.bucketId=n}async uploadOrUpdate(e,t,n,a){var i=this;return i.handleOperation(async()=>{let r;const s=_e(_e({},T1),a);let l=_e(_e({},i.headers),e==="POST"&&{"x-upsert":String(s.upsert)});const u=s.metadata;typeof Blob<"u"&&n instanceof Blob?(r=new FormData,r.append("cacheControl",s.cacheControl),u&&r.append("metadata",i.encodeMetadata(u)),r.append("",n)):typeof FormData<"u"&&n instanceof FormData?(r=n,r.has("cacheControl")||r.append("cacheControl",s.cacheControl),u&&!r.has("metadata")&&r.append("metadata",i.encodeMetadata(u))):(r=n,l["cache-control"]=`max-age=${s.cacheControl}`,l["content-type"]=s.contentType,u&&(l["x-metadata"]=i.toBase64(i.encodeMetadata(u))),(typeof ReadableStream<"u"&&r instanceof ReadableStream||r&&typeof r=="object"&&"pipe"in r&&typeof r.pipe=="function")&&!s.duplex&&(s.duplex="half")),a!=null&&a.headers&&(l=_e(_e({},l),a.headers));const c=i._removeEmptyFolders(t),h=i._getFinalPath(c),d=await(e=="PUT"?Jy:Sa)(i.fetch,`${i.url}/object/${h}`,r,_e({headers:l},s!=null&&s.duplex?{duplex:s.duplex}:{}));return{path:c,id:d.Id,fullPath:d.Key}})}async upload(e,t,n){return this.uploadOrUpdate("POST",e,t,n)}async uploadToSignedUrl(e,t,n,a){var i=this;const r=i._removeEmptyFolders(e),s=i._getFinalPath(r),l=new URL(i.url+`/object/upload/sign/${s}`);return l.searchParams.set("token",t),i.handleOperation(async()=>{let u;const c=_e(_e({},T1),a),h=_e(_e({},i.headers),{"x-upsert":String(c.upsert)});return typeof Blob<"u"&&n instanceof Blob?(u=new FormData,u.append("cacheControl",c.cacheControl),u.append("",n)):typeof FormData<"u"&&n instanceof FormData?(u=n,u.append("cacheControl",c.cacheControl)):(u=n,h["cache-control"]=`max-age=${c.cacheControl}`,h["content-type"]=c.contentType),{path:r,fullPath:(await Jy(i.fetch,l.toString(),u,{headers:h})).Key}})}async createSignedUploadUrl(e,t){var n=this;return n.handleOperation(async()=>{let a=n._getFinalPath(e);const i=_e({},n.headers);t!=null&&t.upsert&&(i["x-upsert"]="true");const r=await Sa(n.fetch,`${n.url}/object/upload/sign/${a}`,{},{headers:i}),s=new URL(n.url+r.url),l=s.searchParams.get("token");if(!l)throw new pf("No token returned by API");return{signedUrl:s.toString(),path:e,token:l}})}async update(e,t,n){return this.uploadOrUpdate("PUT",e,t,n)}async move(e,t,n){var a=this;return a.handleOperation(async()=>await Sa(a.fetch,`${a.url}/object/move`,{bucketId:a.bucketId,sourceKey:e,destinationKey:t,de
609stinationBucket:n==null?void 0:n.destinationBucket},{headers:a.headers}))}async copy(e,t,n){var a=this;return a.handleOperation(async()=>({path:(await Sa(a.fetch,`${a.url}/object/copy`,{bucketId:a.bucketId,sourceKey:e,destinationKey:t,destinationBucket:n==null?void 0:n.destinationBucket},{headers:a.headers})).Key}))}async createSignedUrl(e,t,n){var a=this;return a.handleOperation(async()=>{let i=a._getFinalPath(e);const r=typeof(n==null?void 0:n.transform)=="object"&&n.transform!==null&&Object.keys(n.transform).length>0;let s=await Sa(a.fetch,`${a.url}/object/sign/${i}`,_e({expiresIn:t},r?{transform:n.transform}:{}),{headers:a.headers});const l=new URLSearchParams;n!=null&&n.download&&l.set("download",n.download===!0?"":n.download),(n==null?void 0:n.cacheNonce)!=null&&l.set("cacheNonce",String(n.cacheNonce));const u=l.toString(),c=r&&s.signedURL.includes("/object/sign/")?s.signedURL.replace("/object/sign/","/render/image/sign/"):s.signedURL;return{signedUrl:encodeURI(`${a.url}${c}${u?`&${u}`:""}`)}})}async createSignedUrls(e,t,n){var a=this;return a.handleOperation(async()=>{const i=await Sa(a.fetch,`${a.url}/object/sign/${a.bucketId}`,{expiresIn:t,paths:e},{headers:a.headers}),r=new URLSearchParams;n!=null&&n.download&&r.set("download",n.download===!0?"":n.download),(n==null?void 0:n.cacheNonce)!=null&&r.set("cacheNonce",String(n.cacheNonce));const s=r.toString();return i.map(l=>_e(_e({},l),{},{signedUrl:l.signedURL?encodeURI(`${a.url}${l.signedURL}${s?`&${s}`:""}`):null}))})}download(e,t,n){const a=typeof(t==null?void 0:t.transform)<"u"?"render/image/authenticated":"object",i=new URLSearchParams;t!=null&&t.transform&&this.applyTransformOptsToQuery(i,t.transform),(t==null?void 0:t.cacheNonce)!=null&&i.set("cacheNonce",String(t.cacheNonce));const r=i.toString(),s=this._getFinalPath(e),l=()=>uc(this.fetch,`${this.url}/${a}/${s}${r?`?${r}`:""}`,{headers:this.headers,noResolveJson:!0},n);return new t6(l,this.shouldThrowOnError)}async info(e){var t=this;const n=t._getFinalPath(e);return t.handleOperation(async()=>Yy(await uc(t.fetch,`${t.url}/object/info/${n}`,{headers:t.headers})))}async exists(e){var t=this;const n=t._getFinalPath(e);try{return await ZV(t.fetch,`${t.url}/object/${n}`,{headers:t.headers}),{data:!0,error:null}}catch(i){if(t.shouldThrowOnError)throw i;if(gf(i)){var a;const r=i instanceof Gy?i.status:i instanceof XE?(a=i.originalError)===null||a===void 0?void 0:a.status:void 0;if(r!==void 0&&[400,404].includes(r))return{data:!1,error:i}}throw i}}getPublicUrl(e,t){const n=this._getFinalPath(e),a=new URLSearchParams;t!=null&&t.download&&a.set("download",t.download===!0?"":t.download),t!=null&&t.transform&&this.applyTransformOptsToQuery(a,t.transform),(t==null?void 0:t.cacheNonce)!=null&&a.set("cacheNonce",String(t.cacheNonce));const i=a.toString(),r=typeof(t==null?void 0:t.transform)<"u"?"render/image":"object";return{data:{publicUrl:encodeURI(`${this.url}/${r}/public/${n}`)+(i?`?${i}`:"")}}}async remove(e){var t=this;return t.handleOperation(async()=>await Lk(t.fetch,`${t.url}/object/${t.bucketId}`,{prefixes:e},{headers:t.headers}))}async list(e,t,n){var a=this;return a.handleOperation(async()=>{const i=_e(_e(_e({},n6),t),{},{prefix:e||""});return await Sa(a.fetch,`${a.url}/object/list/${a.bucketId}`,i,{headers:a.headers},n)})}async listV2(e,t){var n=this;return n.handleOperation(async()=>{const a=_e({},e);return await Sa(n.fetch,`${n.url}/object/list-v2/${n.bucketId}`,a,{headers:n.headers},t)})}encodeMetadata(e){return JSON.stringify(e)}toBase64(e){return typeof Buffer<"u"?Buffer.from(e).toString("base64"):btoa(e)}_getFinalPath(e){return`${this.bucketId}/${e.replace(/^\/+/,"")}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}applyTransformOptsToQuery(e,t){return t.width&&e.set("width",t.width.toString()),t.height&&e.set("height",t.height.toString()),t.resize&&e.set("resize",t.resize),t.format&&e.set("format",t.format),t.quality&&e.set("quality",t.quality.toString()),e}};const i6="2.103.0",Fc={"X-Client-Info":`storage-js/${i6}`};var r6=class extends Cl{constructor(e,t={},n,a){const i=new URL(e);a!=null&&a.useNewHostname&&/supabase\.(co|in|red)$/.test(i.hostname)&&!i.hostname.includes("storage.supabase.")&&(i.hostname=i.hostname.replace("supabase.","storage.supabase."));const r=i.href.replace(/\/$/,""),s=_e(_e({},Fc),t);super(r,s,n,"storage")}async listBuckets(e){var t=this;return t.handleOperation(async()=>{const n=t.listBucketOptionsToQueryString(e);return await uc(t.fetch,`${t.url}/bucket${n}`,{headers:t.headers})})}async getBucket(e){var t=this;return t.handleOperation(async()=>await uc(t.fetch,`${t.url}/bucket/${e}`,{headers:t.headers}))}async createBucket(e,t={public:!1}){var n=this;return n.handleOperation(async()=>await Sa(n.fetch,`${n.url}/bucket`,{id:e,name:e,type:t.type,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:n.headers}))}async updateBucket(e,t){var n=this;return n.handleOperation(async()=>await Jy(n.fetch,`${n.url}/bucket/${e}`,{id:e,name:e,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:n.headers}))}async emptyBucket(e){var t=this;return t.handleOperation(async()=>await Sa(t.fetch,`${t.url}/bucket/${e}/empty`,{},{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await Lk(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}listBucketOptionsToQueryString(e){const t={};return e&&("limit"in e&&(t.limit=String(e.limit)),"offset"in e&&(t.offset=String(e.offset)),e.search&&(t.search=e.search),e.sortColumn&&(t.sortColumn=e.sortColumn),e.sortOrder&&(t.sortOrder=e.sortOrder)),Object.keys(t).length>0?"?"+new URLSearchParams(t).toString():""}},s6=class extends Cl{constructor(e,t={},n){const a=e.replace(/\/$/,""),i=_e(_e({},Fc),t);super(a,i,n,"storage")}async createBucket(e){var t=this;return t.handleOperation(async()=>await Sa(t.fetch,`${t.url}/bucket`,{name:e},{headers:t.headers}))}async listBuckets(e){var t=this;return t.handleOperation(async()=>{const n=new URLSearchParams;(e==null?void 0:e.limit)!==void 0&&n.set("limit",e.limit.toString()),(e==null?void 0:e.offset)!==void 0&&n.set("offset",e.offset.toString()),e!=null&&e.sortColumn&&n.set("sortColumn",e.sortColumn),e!=null&&e.sortOrder&&n.set("sortOrder",e.sortOrder),e!=null&&e.search&&n.set("search",e.search);const a=n.toString(),i=a?`${t.url}/bucket?${a}`:`${t.url}/bucket`;return await uc(t.fetch,i,{headers:t.headers})})}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await Lk(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}from(e){var t=this;if(!HV(e))throw new pf("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 $V({baseUrl:this.url,catalogName:e,auth:{type:"custom",getHeaders:async()=>t.headers},fetch:this.fetch}),a=this.shouldThrowOnError;return new Proxy(n,{get(i,r){const s=i[r];return typeof s!="function"?s:async(...l)=>{try{return{data:await s.apply(i,l),error:null}}catch(u){if(a)throw u;return{data:null,error:u}}}}})}},o6=class extends Cl{constructor(e,t={},n){const a=e.replace(/\/$/,""),i=_e(_e({},Fc),{},{"Content-Type":"application/json"},t);super(a,i,n,"vectors")}async createIndex(e){var t=this;return t.handleOperation(async()=>await Fn.post(t.fetch,`${t.url}/CreateIndex`,e,{headers:t.headers})||{})}async getIndex(e,t){var n=this;return n.handleOperation(async()=>await Fn.post(n.fetch,`${n.url}/GetIndex`,{vectorBucketName:e,indexName:t},{headers:n.headers}))}async listIndexes(e){var t=this;return t.handleOperation(async()=>await Fn.post(t.fetch,`${t.url}/ListIndexes`,e,{headers:t.headers}))}async deleteIndex(e,t){var n=this;return n.handleOperation(async()=>await Fn.post(n.fetch,`${n.url}/DeleteIndex`,{vectorBucketName:e,indexName:t},{headers:n.headers})||{})}},l6=class extends Cl{constructor(e,t={},n){const a=e.replace(/\/$/,""),i=_e(_e({},Fc),{},{"Content-Type":"application/json"},t);super(a,i,n,"vectors")}async putVectors(e){var t=this;if(e.vectors.length<1||e.vectors.length>500)throw new Error("Vector batch size must be between 1 and 500 items");return t.handleOperation(async()=>await Fn.post(t.fetch,`${t.url}/PutVectors`,e,{headers:t.headers})||{})}async getVectors(e){var t=this;return t.handleOperation(async()=>await Fn.post(t.fetch,`${t.url}/GetVectors`,e,{headers:t.headers}))}async listVectors(e){var t=this;if(e.segmentCount!==void 0){if(e.segmentCount<1||e.segmentCount>16)throw new Error("segmentCount must be between 1 and 16");
609if(e.segmentIndex!==void 0&&(e.segmentIndex<0||e.segmentIndex>=e.segmentCount))throw new Error(`segmentIndex must be between 0 and ${e.segmentCount-1}`)}return t.handleOperation(async()=>await Fn.post(t.fetch,`${t.url}/ListVectors`,e,{headers:t.headers}))}async queryVectors(e){var t=this;return t.handleOperation(async()=>await Fn.post(t.fetch,`${t.url}/QueryVectors`,e,{headers:t.headers}))}async deleteVectors(e){var t=this;if(e.keys.length<1||e.keys.length>500)throw new Error("Keys batch size must be between 1 and 500 items");return t.handleOperation(async()=>await Fn.post(t.fetch,`${t.url}/DeleteVectors`,e,{headers:t.headers})||{})}},u6=class extends Cl{constructor(e,t={},n){const a=e.replace(/\/$/,""),i=_e(_e({},Fc),{},{"Content-Type":"application/json"},t);super(a,i,n,"vectors")}async createBucket(e){var t=this;return t.handleOperation(async()=>await Fn.post(t.fetch,`${t.url}/CreateVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}async getBucket(e){var t=this;return t.handleOperation(async()=>await Fn.post(t.fetch,`${t.url}/GetVectorBucket`,{vectorBucketName:e},{headers:t.headers}))}async listBuckets(e={}){var t=this;return t.handleOperation(async()=>await Fn.post(t.fetch,`${t.url}/ListVectorBuckets`,e,{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await Fn.post(t.fetch,`${t.url}/DeleteVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}},c6=class extends u6{constructor(e,t={}){super(e,t.headers||{},t.fetch)}from(e){return new d6(this.url,this.headers,e,this.fetch)}async createBucket(e){var t=()=>super.createBucket,n=this;return t().call(n,e)}async getBucket(e){var t=()=>super.getBucket,n=this;return t().call(n,e)}async listBuckets(e={}){var t=()=>super.listBuckets,n=this;return t().call(n,e)}async deleteBucket(e){var t=()=>super.deleteBucket,n=this;return t().call(n,e)}},d6=class extends o6{constructor(e,t,n,a){super(e,t,a),this.vectorBucketName=n}async createIndex(e){var t=()=>super.createIndex,n=this;return t().call(n,_e(_e({},e),{},{vectorBucketName:n.vectorBucketName}))}async listIndexes(e={}){var t=()=>super.listIndexes,n=this;return t().call(n,_e(_e({},e),{},{vectorBucketName:n.vectorBucketName}))}async getIndex(e){var t=()=>super.getIndex,n=this;return t().call(n,n.vectorBucketName,e)}async deleteIndex(e){var t=()=>super.deleteIndex,n=this;return t().call(n,n.vectorBucketName,e)}index(e){return new h6(this.url,this.headers,this.vectorBucketName,e,this.fetch)}},h6=class extends l6{constructor(e,t,n,a,i){super(e,t,i),this.vectorBucketName=n,this.indexName=a}async putVectors(e){var t=()=>super.putVectors,n=this;return t().call(n,_e(_e({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async getVectors(e){var t=()=>super.getVectors,n=this;return t().call(n,_e(_e({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async listVectors(e={}){var t=()=>super.listVectors,n=this;return t().call(n,_e(_e({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async queryVectors(e){var t=()=>super.queryVectors,n=this;return t().call(n,_e(_e({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async deleteVectors(e){var t=()=>super.deleteVectors,n=this;return t().call(n,_e(_e({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}},m6=class extends r6{constructor(e,t={},n,a){super(e,t,n,a)}from(e){return new a6(this.url,this.headers,e,this.fetch)}get vectors(){return new c6(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new s6(this.url+"/iceberg",this.headers,this.fetch)}};const tA="2.103.0",ao=30*1e3,Qy=3,Rp=Qy*ao,f6="http://localhost:9999",p6="supabase.auth.token",g6={"X-Client-Info":`gotrue-js/${tA}`},Xy="X-Supabase-Api-Version",nA={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},y6=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,w6=10*60*1e3;class cc extends Error{constructor(t,n,a){super(t),this.__isAuthError=!0,this.name="AuthError",this.status=n,this.code=a}}function ye(e){return typeof e=="object"&&e!==null&&"__isAuthError"in e}class x6 extends cc{constructor(t,n,a){super(t,n,a),this.name="AuthApiError",this.status=n,this.code=a}}function k6(e){return ye(e)&&e.name==="AuthApiError"}class Jr extends cc{constructor(t,n){super(t),this.name="AuthUnknownError",this.originalError=n}}class Oi extends cc{constructor(t,n,a,i){super(t,a,i),this.name=n,this.status=a}}class On extends Oi{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function Pd(e){return ye(e)&&e.name==="AuthSessionMissingError"}class qs extends Oi{constructor(){super("Auth session or user missing","AuthInvalidToken
609ResponseError",500,void 0)}}class Md extends Oi{constructor(t){super(t,"AuthInvalidCredentialsError",400,void 0)}}class Rd extends Oi{constructor(t,n=null){super(t,"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 v6(e){return ye(e)&&e.name==="AuthImplicitGrantRedirectError"}class E1 extends Oi{constructor(t,n=null){super(t,"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 b6 extends Oi{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 Zy extends Oi{constructor(t,n){super(t,"AuthRetryableFetchError",n,void 0)}}function Ip(e){return ye(e)&&e.name==="AuthRetryableFetchError"}class A1 extends Oi{constructor(t,n,a){super(t,"AuthWeakPasswordError",n,"weak_password"),this.reasons=a}}class ew extends Oi{constructor(t){super(t,"AuthInvalidJwtError",400,"invalid_jwt")}}const om="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),P1=`
610\r=`.split(""),j6=(()=>{const e=new Array(128);for(let t=0;t<e.length;t+=1)e[t]=-1;for(let t=0;t<P1.length;t+=1)e[P1[t].charCodeAt(0)]=-2;for(let t=0;t<om.length;t+=1)e[om[t].charCodeAt(0)]=t;return e})();function M1(e,t,n){if(e!==null)for(t.queue=t.queue<<8|e,t.queuedBits+=8;t.queuedBits>=6;){const a=t.queue>>t.queuedBits-6&63;n(om[a]),t.queuedBits-=6}else if(t.queuedBits>0)for(t.queue=t.queue<<6-t.queuedBits,t.queuedBits=6;t.queuedBits>=6;){const a=t.queue>>t.queuedBits-6&63;n(om[a]),t.queuedBits-=6}}function aA(e,t,n){const a=j6[e];if(a>-1)for(t.queue=t.queue<<6|a,t.queuedBits+=6;t.queuedBits>=8;)n(t.queue>>t.queuedBits-8&255),t.queuedBits-=8;else{if(a===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(e)}"`)}}function R1(e){const t=[],n=s=>{t.push(String.fromCodePoint(s))},a={utf8seq:0,codepoint:0},i={queue:0,queuedBits:0},r=s=>{N6(s,a,n)};for(let s=0;s<e.length;s+=1)aA(e.charCodeAt(s),i,r);return t.join("")}function _6(e,t){if(e<=127){t(e);return}else if(e<=2047){t(192|e>>6),t(128|e&63);return}else if(e<=65535){t(224|e>>12),t(128|e>>6&63),t(128|e&63);return}else if(e<=1114111){t(240|e>>18),t(128|e>>12&63),t(128|e>>6&63),t(128|e&63);return}throw new Error(`Unrecognized Unicode codepoint: ${e.toString(16)}`)}function S6(e,t){for(let n=0;n<e.length;n+=1){let a=e.charCodeAt(n);if(a>55295&&a<=56319){const i=(a-55296)*1024&65535;a=(e.charCodeAt(n+1)-56320&65535|i)+65536,n+=1}_6(a,t)}}function N6(e,t,n){if(t.utf8seq===0){if(e<=127){n(e);return}for(let a=1;a<6;a+=1)if(!(e>>7-a&1)){t.utf8seq=a;break}if(t.utf8seq===2)t.codepoint=e&31;else if(t.utf8seq===3)t.codepoint=e&15;else if(t.utf8seq===4)t.codepoint=e&7;else throw new Error("Invalid UTF-8 sequence");t.utf8seq-=1}else if(t.utf8seq>0){if(e<=127)throw new Error("Invalid UTF-8 sequence");t.codepoint=t.codepoint<<6|e&63,t.utf8seq-=1,t.utf8seq===0&&n(t.codepoint)}}function Mo(e){const t=[],n={queue:0,queuedBits:0},a=i=>{t.push(i)};for(let i=0;i<e.length;i+=1)aA(e.charCodeAt(i),n,a);return new Uint8Array(t)}function C6(e){const t=[];return S6(e,n=>t.push(n)),new Uint8Array(t)}function ns(e){const t=[],n={queue:0,queuedBits:0},a=i=>{t.push(i)};return e.forEach(i=>M1(i,n,a)),M1(null,n,a),t.join("")}function T6(e){return Math.round(Date.now()/1e3)+e}function E6(){return Symbol("auth-callback")}const Kt=()=>typeof window<"u"&&typeof document<"u",$r={tested:!1,writable:!1},iA=()=>{if(!Kt())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if($r.tested)return $r.writable;const e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),$r.tested=!0,$r.writable=!0}catch{$r.tested=!0,$r.writable=!1}return $r.writable};function A6(e){const t={},n=new URL(e);if(n.hash&&n.hash[0]==="#")try{new URLSearchParams(n.hash.substring(1)).forEach((i,r)=>{t[r]=i})}catch{}return n.searchParams.forEach((a,i)=>{t[i]=a}),t}const rA=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),P6=e=>typeof e=="object"&&e!==null&&"status"in e&&"ok"in e&&"json"in e&&typeof e.json=="function",io=async(e,t,n)=>{await e.setItem(t,JSON.stringify(n))},Ur=async(e,t)=>{const n=await e.getItem(t);if(!n)return null;try{return JSON.parse(n)}catch{return n}},Bt=async(e,t)=>{await e.removeItem(t)};class yf{constructor(){this.promise=new yf.promiseConstructor((t,n)=>{this.resolve=t,this.reject=n})}}yf.promiseConstructor=Promise;function Id(e){const t=e.split(".");if(t.length!==3)throw new ew("Invalid JWT structure");for(let a=0;a<t.length;a++)if(!y6.test(t[a]))throw new ew("JWT not in base64url format");return{header:JSON.parse(R1(t[0])),payload:JSON.parse(R1(t[1])),signature:Mo(t[2]),raw:{header:t[0],payload:t[1]}}}async function M6(e){return await new Promise(t=>{setTimeout(()=>t(null),e)})}function R6(e,t){return new Promise((a,i)=>{(async()=>{for(let r=0;r<1/0;r++)try{const s=await e(r);if(!t(r,null,s)){a(s);return}}catch(s){if(!t(r,s)){i(s);return}}})()})}function I6(e){return("0"+e.toString(16)).substr(-2)}function O6(){const t=new Uint32Array(56);if(typeof crypto>"u"){const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",a=n.length;let i="";for(let r=0;r<56;r++)i+=n.charAt(Math.floor(Math.random()*a));return i}return crypto.getRandomValues(t),Array.from(t,I6).join("")}async function L6(e){const n=new TextEncoder().encode(e),a=await crypto.subtle.digest("SHA-256",
610n),i=new Uint8Array(a);return Array.from(i).map(r=>String.fromCharCode(r)).join("")}async function D6(e){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."),e;const n=await L6(e);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function Gs(e,t,n=!1){const a=O6();let i=a;n&&(i+="/PASSWORD_RECOVERY"),await io(e,`${t}-code-verifier`,i);const r=await D6(a);return[r,a===r?"plain":"s256"]}const z6=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function F6(e){const t=e.headers.get(Xy);if(!t||!t.match(z6))return null;try{return new Date(`${t}T00:00:00.0Z`)}catch{return null}}function B6(e){if(!e)throw new Error("Missing exp claim");const t=Math.floor(Date.now()/1e3);if(e<=t)throw new Error("JWT has expired")}function K6(e){switch(e){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 $6=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function Ys(e){if(!$6.test(e))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function Op(){const e={};return new Proxy(e,{get:(t,n)=>{if(n==="__isUserNotAvailableProxy")return!0;if(typeof n=="symbol"){const a=n.toString();if(a==="Symbol(Symbol.toPrimitive)"||a==="Symbol(Symbol.toStringTag)"||a==="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:(t,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:(t,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 U6(e,t){return new Proxy(e,{get:(n,a,i)=>{if(a==="__isInsecureUserWarningProxy")return!0;if(typeof a=="symbol"){const r=a.toString();if(r==="Symbol(Symbol.toPrimitive)"||r==="Symbol(Symbol.toStringTag)"||r==="Symbol(util.inspect.custom)"||r==="Symbol(nodejs.util.inspect.custom)")return Reflect.get(n,a,i)}return!t.value&&typeof a=="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."),t.value=!0),Reflect.get(n,a,i)}})}function I1(e){return JSON.parse(JSON.stringify(e))}const Gr=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),V6=[502,503,504];async function O1(e){var t;if(!P6(e))throw new Zy(Gr(e),0);if(V6.includes(e.status))throw new Zy(Gr(e),e.status);let n;try{n=await e.json()}catch(r){throw new Jr(Gr(r),r)}let a;const i=F6(e);if(i&&i.getTime()>=nA["2024-01-01"].timestamp&&typeof n=="object"&&n&&typeof n.code=="string"?a=n.code:typeof n=="object"&&n&&typeof n.error_code=="string"&&(a=n.error_code),a){if(a==="weak_password")throw new A1(Gr(n),e.status,((t=n.weak_password)===null||t===void 0?void 0:t.reasons)||[]);if(a==="session_not_found")throw new On}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((r,s)=>r&&typeof s=="string",!0))throw new A1(Gr(n),e.status,n.weak_password.reasons);throw new x6(Gr(n),e.status||500,a)}const H6=(e,t,n,a)=>{const i={method:e,headers:(t==null?void 0:t.headers)||{}};return e==="GET"?i:(i.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},t==null?void 0:t.headers),i.body=JSON.stringify(a),Object.assign(Object.assign({},i),n))};async function ve(e,t,n,a){var i;const r=Object.assign({},a==null?void 0:a.headers);r[Xy]||(r[Xy]=nA["2024-01-01"].name),a!=null&&a.jwt&&(r.Authorization=`Bearer ${a.jwt}`);const s=(i=a==null?void 0:a.query)!==null&&i!==void 0?i:{};a!=null&&a.redirectTo&&(s.redirect_to=a.redirectTo);const l=Object.keys(s).length?"?"+new URLSearchParams(s).toString():"",u=await W6(e,t,n+l,{headers:r,noResolveJson:a==null?void 0:a.noResolveJson},{},a==null?void 0:a.body);return a!=null&&a.xform?a==null?void 0:a.xform(u):{data:Object.assign({},u),error:null}}async function W6(e,t,n,a,i,r){const s=H6(t,a,i,r);let l;try{l=await e(n,Object.assign({},s))}catch(u){throw console.error(u),new Zy(Gr(u),0)}if(l.ok||await O1(l),a!=null&&a.noResolveJson)return l;try{return await l.json()}catch(u){await O1(u)}}function va(e){var t;let n=null;Y6(e)&&(n=Object.assign({},e),e.expires_at||(n.expires_at=T6(e.expires_in)));const a=(t=e.user)!==null&&t!==void 0?t:e;return{data:{session:n,user:a},error:null}}function L1(e){const t=va(e);return!t.error&&e.weak_password&&typeof e.weak_password=="object"&&Array.isArray(e.weak_password.reasons)&&e.weak_password.reasons.length&&e.weak_password.message&&typeof e.weak_password.message=="string"&&e.weak_password.reasons.reduce((n,a)=>
610n&&typeof a=="string",!0)&&(t.data.weak_password=e.weak_password),t}function er(e){var t;return{data:{user:(t=e.user)!==null&&t!==void 0?t:e},error:null}}function q6(e){return{data:e,error:null}}function G6(e){const{action_link:t,email_otp:n,hashed_token:a,redirect_to:i,verification_type:r}=e,s=Nl(e,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),l={action_link:t,email_otp:n,hashed_token:a,redirect_to:i,verification_type:r},u=Object.assign({},s);return{data:{properties:l,user:u},error:null}}function D1(e){return e}function Y6(e){return e.access_token&&e.refresh_token&&e.expires_in}const Lp=["global","local","others"];class J6{constructor({url:t="",headers:n={},fetch:a}){this.url=t,this.headers=n,this.fetch=rA(a),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)},this.customProviders={listProviders:this._listCustomProviders.bind(this),createProvider:this._createCustomProvider.bind(this),getProvider:this._getCustomProvider.bind(this),updateProvider:this._updateCustomProvider.bind(this),deleteProvider:this._deleteCustomProvider.bind(this)}}async signOut(t,n=Lp[0]){if(Lp.indexOf(n)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${Lp.join(", ")}`);try{return await ve(this.fetch,"POST",`${this.url}/logout?scope=${n}`,{headers:this.headers,jwt:t,noResolveJson:!0}),{data:null,error:null}}catch(a){if(ye(a))return{data:null,error:a};throw a}}async inviteUserByEmail(t,n={}){try{return await ve(this.fetch,"POST",`${this.url}/invite`,{body:{email:t,data:n.data},headers:this.headers,redirectTo:n.redirectTo,xform:er})}catch(a){if(ye(a))return{data:{user:null},error:a};throw a}}async generateLink(t){try{const{options:n}=t,a=Nl(t,["options"]),i=Object.assign(Object.assign({},a),n);return"newEmail"in a&&(i.new_email=a==null?void 0:a.newEmail,delete i.newEmail),await ve(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:i,headers:this.headers,xform:G6,redirectTo:n==null?void 0:n.redirectTo})}catch(n){if(ye(n))return{data:{properties:null,user:null},error:n};throw n}}async createUser(t){try{return await ve(this.fetch,"POST",`${this.url}/admin/users`,{body:t,headers:this.headers,xform:er})}catch(n){if(ye(n))return{data:{user:null},error:n};throw n}}async listUsers(t){var n,a,i,r,s,l,u;try{const c={nextPage:null,lastPage:0,total:0},h=await ve(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(a=(n=t==null?void 0:t.page)===null||n===void 0?void 0:n.toString())!==null&&a!==void 0?a:"",per_page:(r=(i=t==null?void 0:t.perPage)===null||i===void 0?void 0:i.toString())!==null&&r!==void 0?r:""},xform:D1});if(h.error)throw h.error;const d=await h.json(),m=(s=h.headers.get("x-total-count"))!==null&&s!==void 0?s:0,f=(u=(l=h.headers.get("link"))===null||l===void 0?void 0:l.split(","))!==null&&u!==void 0?u:[];return f.length>0&&(f.forEach(y=>{const g=parseInt(y.split(";")[0].split("=")[1].substring(0,1)),x=JSON.parse(y.split(";")[1].split("=")[1]);c[`${x}Page`]=g}),c.total=parseInt(m)),{data:Object.assign(Object.assign({},d),c),error:null}}catch(c){if(ye(c))return{data:{users:[]},error:c};throw c}}async getUserById(t){Ys(t);try{return await ve(this.fetch,"GET",`${this.url}/admin/users/${t}`,{headers:this.headers,xform:er})}catch(n){if(ye(n))return{data:{user:null},error:n};throw n}}async updateUserById(t,n){Ys(t);try{return await ve(this.fetch,"PUT",`${this.url}/admin/users/${t}`,{body:n,headers:this.headers,xform:er})}catch(a){if(ye(a))return{data:{user:null},error:a};throw a}}async deleteUser(t,n=!1){Ys(t);try{return await ve(this.fetch,"DELETE",`${this.url}/admin/users/${t}`,{headers:this.headers,body:{should_soft_delete:n},xform:er})}catch(a){if(ye(a))return{data:{user:null},error:a};throw a}}async _listFactors(t){Ys(t.userId);try{const{data:n,error:a}=await ve(this.fetch,"GET",`${this.url}/admin/users/${t.userId}/factors`,{headers:this.headers,xform:i=>({data:{factors:i},error:null})});return{data:n,error:a}}catch(n){if(ye(n))return{data:null,error:n};throw n}}async _deleteFactor(t){Ys(t.userId),Ys(t.id);
610try{return{data:await ve(this.fetch,"DELETE",`${this.url}/admin/users/${t.userId}/factors/${t.id}`,{headers:this.headers}),error:null}}catch(n){if(ye(n))return{data:null,error:n};throw n}}async _listOAuthClients(t){var n,a,i,r,s,l,u;try{const c={nextPage:null,lastPage:0,total:0},h=await ve(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(a=(n=t==null?void 0:t.page)===null||n===void 0?void 0:n.toString())!==null&&a!==void 0?a:"",per_page:(r=(i=t==null?void 0:t.perPage)===null||i===void 0?void 0:i.toString())!==null&&r!==void 0?r:""},xform:D1});if(h.error)throw h.error;const d=await h.json(),m=(s=h.headers.get("x-total-count"))!==null&&s!==void 0?s:0,f=(u=(l=h.headers.get("link"))===null||l===void 0?void 0:l.split(","))!==null&&u!==void 0?u:[];return f.length>0&&(f.forEach(y=>{const g=parseInt(y.split(";")[0].split("=")[1].substring(0,1)),x=JSON.parse(y.split(";")[1].split("=")[1]);c[`${x}Page`]=g}),c.total=parseInt(m)),{data:Object.assign(Object.assign({},d),c),error:null}}catch(c){if(ye(c))return{data:{clients:[]},error:c};throw c}}async _createOAuthClient(t){try{return await ve(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:t,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(ye(n))return{data:null,error:n};throw n}}async _getOAuthClient(t){try{return await ve(this.fetch,"GET",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(ye(n))return{data:null,error:n};throw n}}async _updateOAuthClient(t,n){try{return await ve(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${t}`,{body:n,headers:this.headers,xform:a=>({data:a,error:null})})}catch(a){if(ye(a))return{data:null,error:a};throw a}}async _deleteOAuthClient(t){try{return await ve(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(n){if(ye(n))return{data:null,error:n};throw n}}async _regenerateOAuthClientSecret(t){try{return await ve(this.fetch,"POST",`${this.url}/admin/oauth/clients/${t}/regenerate_secret`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(ye(n))return{data:null,error:n};throw n}}async _listCustomProviders(t){try{const n={};return t!=null&&t.type&&(n.type=t.type),await ve(this.fetch,"GET",`${this.url}/admin/custom-providers`,{headers:this.headers,query:n,xform:a=>{var i;return{data:{providers:(i=a==null?void 0:a.providers)!==null&&i!==void 0?i:[]},error:null}}})}catch(n){if(ye(n))return{data:{providers:[]},error:n};throw n}}async _createCustomProvider(t){try{return await ve(this.fetch,"POST",`${this.url}/admin/custom-providers`,{body:t,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(ye(n))return{data:null,error:n};throw n}}async _getCustomProvider(t){try{return await ve(this.fetch,"GET",`${this.url}/admin/custom-providers/${t}`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(ye(n))return{data:null,error:n};throw n}}async _updateCustomProvider(t,n){try{return await ve(this.fetch,"PUT",`${this.url}/admin/custom-providers/${t}`,{body:n,headers:this.headers,xform:a=>({data:a,error:null})})}catch(a){if(ye(a))return{data:null,error:a};throw a}}async _deleteCustomProvider(t){try{return await ve(this.fetch,"DELETE",`${this.url}/admin/custom-providers/${t}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(n){if(ye(n))return{data:null,error:n};throw n}}}function z1(e={}){return{getItem:t=>e[t]||null,setItem:(t,n)=>{e[t]=n},removeItem:t=>{delete e[t]}}}const $a={debug:!!(globalThis&&iA()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class sA extends Error{constructor(t){super(t),this.isAcquireTimeout=!0}}class F1 extends sA{}async function Q6(e,t,n){$a.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",e,t);const a=new globalThis.AbortController;let i;t>0&&(i=setTimeout(()=>{a.abort(),$a.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",e)},t)),await Promise.resolve();
610try{return await globalThis.navigator.locks.request(e,t===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:a.signal},async r=>{if(r){clearTimeout(i),$a.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",e,r.name);try{return await n()}finally{$a.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",e,r.name)}}else{if(t===0)throw $a.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",e),new F1(`Acquiring an exclusive Navigator LockManager lock "${e}" immediately failed`);if($a.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"),clearTimeout(i),await n()}})}catch(r){if(t>0&&clearTimeout(i),(r==null?void 0:r.name)==="AbortError"&&t>0){if(a.signal.aborted)return $a.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire timeout, recovering by stealing lock",e),console.warn(`@supabase/gotrue-js: Lock "${e}" was not released within ${t}ms. This may indicate an orphaned lock from a component unmount (e.g., React Strict Mode). Forcefully acquiring the lock to recover.`),await Promise.resolve().then(()=>globalThis.navigator.locks.request(e,{mode:"exclusive",steal:!0},async s=>{if(s){$a.debug&&console.log("@supabase/gotrue-js: navigatorLock: recovered (stolen)",e,s.name);try{return await n()}finally{$a.debug&&console.log("@supabase/gotrue-js: navigatorLock: released (stolen)",e,s.name)}}else return console.warn("@supabase/gotrue-js: Navigator LockManager returned null lock even with steal: true"),await n()}));throw $a.debug&&console.log("@supabase/gotrue-js: navigatorLock: lock was stolen by another request",e),new F1(`Lock "${e}" was released because another request stole it`)}throw r}}function X6(){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 oA(e){if(!/^0x[a-fA-F0-9]{40}$/.test(e))throw new Error(`@supabase/auth-js: Address "${e}" is invalid.`);return e.toLowerCase()}function Z6(e){return parseInt(e,16)}function e8(e){const t=new TextEncoder().encode(e);return"0x"+Array.from(t,a=>a.toString(16).padStart(2,"0")).join("")}function t8(e){var t;const{chainId:n,domain:a,expirationTime:i,issuedAt:r=new Date,nonce:s,notBefore:l,requestId:u,resources:c,scheme:h,uri:d,version:m}=e;{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(!a)throw new Error('@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.');if(s&&s.length<8)throw new Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${s}`);if(!d)throw new Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if(m!=="1")throw new Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${m}`);if(!((t=e.statement)===null||t===void 0)&&t.includes(` 611`))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${e.statement}`)}const f=oA(e.address),y=h?`${h}://${a}`:a,g=e.statement?`${e.statement} 612`:"",x=`${y} wants you to sign in with your Ethereum account: 613${f} 614 615${g}`;let w=`URI: ${d} 616Version: ${m} 617Chain ID: ${n}${s?` 618Nonce: ${s}`:""} 619Issued At: ${r.toISOString()}`;if(i&&(w+=` 620Expiration Time: ${i.toISOString()}`),l&&(w+=` 621Not Before: ${l.toISOString()}`),u&&(w+=` 622Request ID: ${u}`),c){let v=` 623Resources:`;for(const k of c){if(!k||typeof k!="string")throw new Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${k}`);v+=` 624- ${k}`}w+=v}return`${x} 625${w}`}
625class Et extends Error{constructor({message:t,code:n,cause:a,name:i}){var r;super(t,{cause:a}),this.__isWebAuthnError=!0,this.name=(r=i??(a instanceof Error?a.name:void 0))!==null&&r!==void 0?r:"Unknown Error",this.code=n}}class lm extends Et{constructor(t,n){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:n,message:t}),this.name="WebAuthnUnknownError",this.originalError=n}}function n8({error:e,options:t}){var n,a,i;const{publicKey:r}=t;if(!r)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new Et({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else if(e.name==="ConstraintError"){if(((n=r.authenticatorSelection)===null||n===void 0?void 0:n.requireResidentKey)===!0)return new Et({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:e});if(t.mediation==="conditional"&&((a=r.authenticatorSelection)===null||a===void 0?void 0:a.userVerification)==="required")return new Et({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:e});if(((i=r.authenticatorSelection)===null||i===void 0?void 0:i.userVerification)==="required")return new Et({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:e})}else{if(e.name==="InvalidStateError")return new Et({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:e});if(e.name==="NotAllowedError")return new Et({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="NotSupportedError")return r.pubKeyCredParams.filter(l=>l.type==="public-key").length===0?new Et({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:e}):new Et({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:e});if(e.name==="SecurityError"){const s=window.location.hostname;if(lA(s)){if(r.rp.id!==s)return new Et({message:`The RP ID "${r.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new Et({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="TypeError"){if(r.user.id.byteLength<1||r.user.id.byteLength>64)return new Et({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:e})}else if(e.name==="UnknownError")return new Et({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e})}return new Et({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}function a8({error:e,options:t}){const{publicKey:n}=t;if(!n)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new Et({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else{if(e.name==="NotAllowedError")return new Et({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="SecurityError"){const a=window.location.hostname;if(lA(a)){if(n.rpId!==a)return new Et({message:`The RP ID "${n.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new Et({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="UnknownError")return new Et({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e})}return new Et({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}class i8{createNewAbortSignal(){if(this.controller){const n=new Error("Cancelling existing WebAuthn API call for new one");n.name="AbortError",this.controller.abort(n)}const t=new AbortController;return this.controller=t,t.signal}cancelCeremony(){if(this.controller){const t=new Error("Manually cancelling existing WebAuthn API call");t.name="AbortError",this.controller.abort(t),this.controller=void 0}}}const r8=new i8;function s8(e){if(!e)throw new Error("Credential creation options are required");if(typeof PublicKeyCredential<"u"&&"parseCreationOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseCreationOptionsFromJSON=="function")return PublicKeyCredential.parseCreationOptionsFromJSON(e);const{challenge:t,user:n,excludeCredentials:a}=e,i=Nl(e,["challenge","user","excludeCredentials"]),r=Mo(t).buffer,s=Object.assign(Object.assign({},n),{id:Mo(n.id).buffer}),l=Object.assign(Object.assign({},i),{challenge:r,user:s});if(a&&a.length>0){l.excludeCredentials=new Array(a.length);for(let u=0;u<a.length;u++){const c=a[u];l.excludeCredentials[u]=Object.assign(Object.assign({},c),{id:Mo(c.id).buffer,type:c.type||"public-key",transports:c.transports})}}return l}function o8(e){if(!e)throw new Error("Credential request options are required");if(typeof PublicKeyCredential<"u"&&"parseRequestOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseRequestOptionsFromJSON=="function")return PublicKeyCredential.parseRequestOptionsFromJSON(e);const{challenge:t,allowCredentials:n}=e,a=Nl(e,["challenge","allowCredentials"]),i=Mo(t).buffer,r=Object.assign(Object.assign({},a),{challenge:i});if(n&&n.length>0){r.allowCredentials=new Array(n.length);for(let s=0;s<n.length;s++){const l=n[s];r.allowCredentials[s]=Object.assign(Object.assign({},l),{id:Mo(l.id).buffer,type:l.type||"public-key",transports:l.transports})}}return r}function l8(e){var t;if("toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();const n=e;return{id:e.id,rawId:e.id,response:{attestationObject:ns(new Uint8Array(e.response.attestationObject)),clientDataJSON:ns(new Uint8Array(e.response.clientDataJSON))},type:"public-key",clientExtensionResults:e.getClientExtensionResults(),authenticatorAttachment:(t=n.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function u8(e){var t;if("toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();const n=e,a=e.getClientExtensionResults(),i=e.response;return{id:e.id,rawId:e.id,response:{authenticatorData:ns(new Uint8Array(i.authenticatorData)),clientDataJSON:ns(new Uint8Array(i.clientDataJSON)),signature:ns(new Uint8Array(i.signature)),userHandle:i.userHandle?ns(new Uint8Array(i.userHandle)):void 0},type:"public-key",clientExtensionResults:a,authenticatorAttachment:(t=n.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function lA(e){return e==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e)}function B1(){var e,t;return!!(Kt()&&"PublicKeyCredential"in window&&window.PublicKeyCredential&&"credentials"in navigator&&typeof((e=navigator==null?void 0:navigator.credentials)===null||e===void 0?void 0:e.create)=="function"&&typeof((t=navigator==null?void 0:navigator.credentials)===null||t===void 0?void 0:t.get)=="function")}async function c8(e){try{const t=await navigator.credentials.create(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new lm("Browser returned unexpected credential type",t)}:{data:null,error:new lm("Empty credential response",t)}}
625catch(t){return{data:null,error:n8({error:t,options:e})}}}async function d8(e){try{const t=await navigator.credentials.get(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new lm("Browser returned unexpected credential type",t)}:{data:null,error:new lm("Empty credential response",t)}}catch(t){return{data:null,error:a8({error:t,options:e})}}}const h8={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},m8={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function um(...e){const t=i=>i!==null&&typeof i=="object"&&!Array.isArray(i),n=i=>i instanceof ArrayBuffer||ArrayBuffer.isView(i),a={};for(const i of e)if(i)for(const r in i){const s=i[r];if(s!==void 0)if(Array.isArray(s))a[r]=s;else if(n(s))a[r]=s;else if(t(s)){const l=a[r];t(l)?a[r]=um(l,s):a[r]=um(s)}else a[r]=s}return a}function f8(e,t){return um(h8,e,t||{})}function p8(e,t){return um(m8,e,t||{})}class g8{constructor(t){this.client=t,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(t){return this.client.mfa.enroll(Object.assign(Object.assign({},t),{factorType:"webauthn"}))}async _challenge({factorId:t,webauthn:n,friendlyName:a,signal:i},r){var s;try{const{data:l,error:u}=await this.client.mfa.challenge({factorId:t,webauthn:n});if(!l)return{data:null,error:u};const c=i??r8.createNewAbortSignal();if(l.webauthn.type==="create"){const{user:h}=l.webauthn.credential_options.publicKey;if(!h.name){const d=a;if(d)h.name=`${h.id}:${d}`;else{const f=(await this.client.getUser()).data.user,y=((s=f==null?void 0:f.user_metadata)===null||s===void 0?void 0:s.name)||(f==null?void 0:f.email)||(f==null?void 0:f.id)||"User";h.name=`${h.id}:${y}`}}h.displayName||(h.displayName=h.name)}switch(l.webauthn.type){case"create":{const h=f8(l.webauthn.credential_options.publicKey,r==null?void 0:r.create),{data:d,error:m}=await c8({publicKey:h,signal:c});return d?{data:{factorId:t,challengeId:l.id,webauthn:{type:l.webauthn.type,credential_response:d}},error:null}:{data:null,error:m}}case"request":{const h=p8(l.webauthn.credential_options.publicKey,r==null?void 0:r.request),{data:d,error:m}=await d8(Object.assign(Object.assign({},l.webauthn.credential_options),{publicKey:h,signal:c}));return d?{data:{factorId:t,challengeId:l.id,webauthn:{type:l.webauthn.type,credential_response:d}},error:null}:{data:null,error:m}}}}catch(l){return ye(l)?{data:null,error:l}:{data:null,error:new Jr("Unexpected error in challenge",l)}}}async _verify({challengeId:t,factorId:n,webauthn:a}){return this.client.mfa.verify({factorId:n,challengeId:t,webauthn:a})}async _authenticate({factorId:t,webauthn:{rpId:n=typeof window<"u"?window.location.hostname:void 0,rpOrigins:a=typeof window<"u"?[window.location.origin]:void 0,signal:i}={}},r){if(!n)return{data:null,error:new cc("rpId is required for WebAuthn authentication")};try{if(!B1())return{data:null,error:new Jr("Browser does not support WebAuthn",null)};const{data:s,error:l}=await this.challenge({factorId:t,webauthn:{rpId:n,rpOrigins:a},signal:i},{request:r});if(!s)return{data:null,error:l};const{webauthn:u}=s;return this._verify({factorId:t,challengeId:s.challengeId,webauthn:{type:u.type,rpId:n,rpOrigins:a,credential_response:u.credential_response}})}catch(s){return ye(s)?{data:null,error:s}:{data:null,error:new Jr("Unexpected error in authenticate",s)}}}async _register({friendlyName:t,webauthn:{rpId:n=typeof window<"u"?window.location.hostname:void 0,rpOrigins:a=typeof window<"u"?[window.location.origin]:void 0,signal:i}={}},r){if(!n)return{data:null,error:new cc("rpId is required for WebAuthn registration")};try{if(!B1())return{data:null,error:new Jr("Browser does not support WebAuthn",null)};const{data:s,error:l}=await this._enroll({friendlyName:t});if(!s)return await this.client.mfa.listFactors().then(h=>{var d;return(d=h.data)===null||d===void 0?void 0:d.all.find(m=>m.factor_type==="webauthn"&&m.friendly_name===t&&m.status!=="unverified")}).then(h=>h?this.client.mfa.unenroll({factorId:h==null?void 0:h.id}):void 0),{data:null,error:l};const{data:u,error:c}=await this._challenge({factorId:s.id,friendlyName:s.friendly_name,webauthn:{rpId:n,rpOrigins:a},signal:i},{create:r});return u?this._verify({factorId:s.id,challengeId:u.challengeId,webauthn:{rpId:n,rpOrigins:a,type:u.webauthn.type,credential_response:u.webauthn.credential_response}}):{data:null,error:c}}catch(s){return ye(s)?{data:null,error:s}:{data:null,error:new Jr("Unexpected error in register",s)}}}}X6();const y8={url:f6,storageKey:p6,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:g6,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:5e3,skipAutoInitialize:!1};async function K1(e,t,n){return await n()}const Js={};class dc{get jwks(){var t,n;return(n=(t=Js[this.storageKey])===null||t===void 0?void 0:t.jwks)!==null&&n!==void 0?n:{keys:[]}}set jwks(t){Js[this.storageKey]=Object.assign(Object.assign({},Js[this.storageKey]),{jwks:t})}get jwks_cached_at(){var t,n;return(n=(t=Js[this.storageKey])===null||t===void 0?void 0:t.cachedAt)!==null&&n!==void 0?n:Number.MIN_SAFE_INTEGER}set jwks_cached_at(t){Js[this.storageKey]=Object.assign(Object.assign({},Js[this.storageKey]),{cachedAt:t})}constructor(t){var n,a,i;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 r=Object.assign(Object.assign({},y8),t);if(this.storageKey=r.storageKey,this.instanceID=(n=dc.nextInstanceID[this.storageKey])!==null&&n!==void 0?n:0,dc.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!r.debug,typeof r.debug=="function"&&(this.logger=r.debug),this.instanceID>0&&Kt()){const s=`${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(s),this.logDebugMessages&&console.trace(s)}if(this.persistSession=r.persistSession,this.autoRefreshToken=r.autoRefreshToken,this.admin=new J6({url:r.url,headers:r.headers,fetch:r.fetch}),this.url=r.url,this.headers=r.headers,this.fetch=rA(r.fetch),this.lock=r.lock||K1,this.detectSessionInUrl=r.detectSessionInUrl,this.flowType=r.flowType,this.hasCustomAuthorizationHeader=r.hasCustomAuthorizationHeader,this.throwOnError=r.throwOnError,this.lockAcquireTimeout=r.lockAcquireTimeout,r.lock?this.lock=r.lock:this.persistSession&&Kt()&&
625(!((a=globalThis==null?void 0:globalThis.navigator)===null||a===void 0)&&a.locks)?this.lock=Q6:this.lock=K1,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 g8(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?(r.storage?this.storage=r.storage:iA()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=z1(this.memoryStorage)),r.userStorage&&(this.userStorage=r.userStorage)):(this.memoryStorage={},this.storage=z1(this.memoryStorage)),Kt()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(s){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",s)}(i=this.broadcastChannel)===null||i===void 0||i.addEventListener("message",async s=>{this._debug("received broadcast notification from other tab or client",s);try{await this._notifyAllSubscribers(s.data.event,s.data.session,!1)}catch(l){this._debug("#broadcastChannel","error",l)}})}r.skipAutoInitialize||this.initialize().catch(s=>{this._debug("#initialize()","error",s)})}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(t){if(this.throwOnError&&t&&t.error)throw t.error;return t}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${tA}) ${new Date().toISOString()}`}_debug(...t){return this.logDebugMessages&&this.logger(this._logPrefix(),...t),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 t;try{let n={},a="none";if(Kt()&&(n=A6(window.location.href),this._isImplicitGrantCallback(n)?a="implicit":await this._isPKCECallback(n)&&(a="pkce")),Kt()&&this.detectSessionInUrl&&a!=="none"){const{data:i,error:r}=await this._getSessionFromURL(n,a);if(r){if(this._debug("#_initialize()","error detecting session from URL",r),v6(r)){const u=(t=r.details)===null||t===void 0?void 0:t.code;if(u==="identity_already_exists"||u==="identity_not_found"||u==="single_identity_not_deletable")return{error:r}}return{error:r}}const{session:s,redirectType:l}=i;return this._debug("#_initialize()","detected session in URL",s,"redirect type",l),await this._saveSession(s),setTimeout(async()=>{l==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",s):await this._notifyAllSubscribers("SIGNED_IN",s)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(n){return ye(n)?this._returnResult({error:n}):this._returnResult({error:new Jr("Unexpected error during initialization",n)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(t){var n,a,i;try{const r=await ve(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(a=(n=t==null?void 0:t.options)===null||n===void 0?void 0:n.data)!==null&&a!==void 0?a:{},gotrue_meta_security:{captcha_token:(i=t==null?void 0:t.options)===null||i===void 0?void 0:i.captchaToken}},xform:va}),{data:s,error:l}=r;if(l||!s)return this._returnResult({data:{user:null,session:null},error:l});const u=s.session,c=s.user;return s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",u)),this._returnResult({data:{user:c,session:u},error:null})}catch(r){if(ye(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async signUp(t){var n,a,i;try{let r;if("email"in t){const{email:h,password:d,options:m}=t;let f=null,y=null;this.flowType==="pkce"&&([f,y]=await Gs(this.storage,this.storageKey)),r=await ve(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:m==null?void 0:m.emailRedirectTo,body:{email:h,password:d,data:(n=m==null?void 0:m.data)!==null&&n!==void 0?n:{},gotrue_meta_security:{captcha_token:m==null?void 0:m.captchaToken},code_challenge:f,code_challenge_method:y},xform:va})}else if("phone"in t){const{phone:h,password:d,options:m}=t;r=await ve(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:h,password:d,data:(a=m==null?void 0:m.data)!==null&&a!==void 0?a:{},channel:(i=m==null?void 0:m.channel)!==null&&i!==void 0?i:"sms",gotrue_meta_security:{captcha_token:m==null?void 0:m.captchaToken}},xform:va})}else throw new Md("You must provide either an email or phone number and a password");const{data:s,error:l}=r;if(l||!s)return await Bt(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:l});const u=s.session,c=s.user;return s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",u)),this._returnResult({data:{user:c,session:u},error:null})}catch(r){if(await Bt(this.storage,`${this.storageKey}-code-verifier`),ye(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async signInWithPassword(t){try{let n;if("email"in t){const{email:r,password:s,options:l}=t;n=await ve(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:r,password:s,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken}},xform:L1})}else if("phone"in t){const{phone:r,password:s,options:l}=t;n=await ve(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:r,password:s,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken}},xform:L1})}else throw new Md("You must provide either an email or phone number and a password");const{data:a,error:i}=n;if(i)return this._returnResult({data:{user:null,session:null},error:i});if(!a||!a.session||!a.user){const r=new qs;return this._returnResult({data:{user:null,session:null},error:r})}return a.session&&(await this._saveSession(a.session),await this._notifyAllSubscribers("SIGNED_IN",a.session)),this._returnResult({data:Object.assign({user:a.user,session:a.session},a.weak_password?{weakPassword:a.weak_password}:null),error:i})}catch(n){if(ye(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async signInWithOAuth(t){var n,a,i,r;return await this._handleProviderSignIn(t.provider,{redirectTo:(n=t.options)===null||n===void 0?void 0:n.redirectTo,scopes:(a=t.options)===null||a===void 0?void 0:a.scopes,queryParams:(i=t.options)===null||i===void 0?void 0:i.queryParams,skipBrowserRedirect:(r=t.options)===null||r===void 0?void 0:r.skipBrowserRedirect})}async exchangeCodeForSession(t){return await this.initializePromise,this._acquireLock(this.lockAcquireTimeout,async()=>this._exchangeCodeForSession(t))}async signInWithWeb3(t){const{chain:n}=t;switch(n){case"ethereum":return await this.signInWithEthereum(t);case"solana":return await this.signInWithSolana(t);default:throw new Error(`@supabase/auth-js: Unsupported chain "${n}"`)}}async signInWithEthereum(t){var n,a,i,r,s,l,u,c,h,d,m;let f,y;if("message"in t)f=t.message,y=t.signature;else{const{chain:g,wallet:x,statement:w,options:v}=t;let k;if(Kt())if(typeof x=="object")k=x;else{const O=window;if("ethereum"in O&&typeof O.ethereum=="object"&&"request"in O.ethereum&&typeof O.ethereum.request=="function")k=O.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 x!="object"||!(v!=null&&v.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");k=x}const j=new URL((n=v==null?void 0:v.url)!==null&&n!==void 0?n:window.location.href),S=await k.request({method:"eth_requestAccounts"}).then(O=>O).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!S||S.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const _=oA(S[0]);let T=(a=v==null?void 0:v.signInWithEthereum)===null||a===void 0?void 0:a.chainId;if(!T){const O=await k.request({method:"eth_chainId"});T=Z6(O)}const E={domain:j.host,address:_,statement:w,uri:j.href,version:"1",chainId:T,nonce:(i=v==null?void 0:v.signInWithEthereum)===null||i===void 0?void 0:i.nonce,issuedAt:(s=(r=v==null?void 0:v.signInWithEthereum)===null||r===void 0?void 0:r.issuedAt)!==null&&s!==void 0?s:new Date,expirationTime:(l=v==null?void 0:v.signInWithEthereum)===null||l===void 0?void 0:l.expirationTime,notBefore:(u=v==null?void 0:v.signInWithEthereum)===null||u===void 0?void 0:u.notBefore,requestId:(c=v==null?void 0:v.signInWithEthereum)===null||c===void 0?void 0:c.requestId,resources:(h=v==null?void 0:v.signInWithEthereum)===null||h===void 0?void 0:h.resources};f=t8(E),y=await k.request({method:"personal_sign",params:[e8(f),_]})}try{const{data:g,error:x}=await ve(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:f,signature:y},!((d=t.options)===null||d===void 0)&&d.captchaToken?{gotrue_meta_security:{captcha_token:(m=t.options)===null||m===void 0?void 0:m.captchaToken}}:null),xform:va});if(x)throw x;if(!g||!g.session||!g.user){const w=new qs;return this._returnResult({data:{user:null,session:null},error:w})}return g.session&&(await this._saveSession(g.session),await this._notifyAllSubscribers("SIGNED_IN",g.session)),this._returnResult({data:Object.assign({},g),error:x})}catch(g){if(ye(g))return this._returnResult({data:{user:null,session:null},error:g});throw g}}async signInWithSolana(t){var n,a,i,r,s,l,u,c,h,d,m,f;let y,g;if("message"in t)y=t.message,g=t.signature;else{const{chain:x,wallet:w,statement:v,options:k}=t;let j;if(Kt())if(typeof w=="object")j=w;else{const _=window;if("solana"in _&&typeof _.solana=="object"&&("signIn"in _.solana&&typeof _.solana.signIn=="function"||"signMessage"in _.solana&&typeof _.solana.signMessage=="function"))j=_.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 w!="object"||!(k!=null&&k.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");j=w}const S=new URL((n=k==null?void 0:k.url)!==null&&n!==void 0?n:window.location.href);if("signIn"in j&&j.signIn){const _=await j.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},k==null?void 0:k.signInWithSolana),{version:"1",domain:S.host,uri:S.href}),v?{statement:v}:null));let T;if(Array.isArray(_)&&_[0]&&typeof _[0]=="object")T=_[0];else if(_&&typeof _=="object"&&"signedMessage"in _&&"signature"in _)T=_;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in T&&"signature"in T&&(typeof T.signedMessage=="string"||T.signedMessage instanceof Uint8Array)&&T.signature instanceof Uint8Array)y=typeof T.signedMessage=="string"?T.signedMessage:new TextDecoder().decode(T.signedMessage),g=T.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in j)||typeof j.signMessage!="function"||!("publicKey"in j)||typeof j!="object"||!j.publicKey||!("toBase58"in j.publicKey)||typeof j.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");y=[`${S.host} wants you to sign in with your Solana account:`,j.publicKey.toBase58(),...v?["",v,""]:[""],"Version: 1",`URI: ${S.href}`,`Issued At: ${(i=(a=k==null?void 0:k.signInWithSolana)===null||a===void 0?void 0:a.issuedAt)!==null&&i!==void 0?i:new Date().toISOString()}`,...!((r=k==null?void 0:k.signInWithSolana)===null||r===void 0)&&r.notBefore?[`Not Before: ${k.signInWithSolana.notBefore}`]:[],...!((s=k==null?void 0:k.signInWithSolana)===null||s===void 0)&&s.expirationTime?[`Expiration Time: ${k.signInWithSolana.expirationTime}`]:[],...!((l=k==null?void 0:k.signInWithSolana)===null||l===void 0)&&l.chainId?[`Chain ID: ${k.signInWithSolana.chainId}`]:[],...!((u=k==null?void 0:k.signInWithSolana)===null||u===void 0)&&u.nonce?[`Nonce: ${k.signInWithSolana.nonce}`]:[],...!((c=k==null?void 0:k.signInWithSolana)===null||c===void 0)&&c.requestId?[`Request ID: ${
625k.signInWithSolana.requestId}`]:[],...!((d=(h=k==null?void 0:k.signInWithSolana)===null||h===void 0?void 0:h.resources)===null||d===void 0)&&d.length?["Resources",...k.signInWithSolana.resources.map(T=>`- ${T}`)]:[]].join(` 626`);const _=await j.signMessage(new TextEncoder().encode(y),"utf8");if(!_||!(_ instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");g=_}}try{const{data:x,error:w}=await ve(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:y,signature:ns(g)},!((m=t.options)===null||m===void 0)&&m.captchaToken?{gotrue_meta_security:{captcha_token:(f=t.options)===null||f===void 0?void 0:f.captchaToken}}:null),xform:va});if(w)throw w;if(!x||!x.session||!x.user){const v=new qs;return this._returnResult({data:{user:null,session:null},error:v})}return x.session&&(await this._saveSession(x.session),await this._notifyAllSubscribers("SIGNED_IN",x.session)),this._returnResult({data:Object.assign({},x),error:w})}catch(x){if(ye(x))return this._returnResult({data:{user:null,session:null},error:x});throw x}}async _exchangeCodeForSession(t){const n=await Ur(this.storage,`${this.storageKey}-code-verifier`),[a,i]=(n??"").split("/");try{if(!a&&this.flowType==="pkce")throw new b6;const{data:r,error:s}=await ve(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:t,code_verifier:a},xform:va});if(await Bt(this.storage,`${this.storageKey}-code-verifier`),s)throw s;if(!r||!r.session||!r.user){const l=new qs;return this._returnResult({data:{user:null,session:null,redirectType:null},error:l})}return r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers("SIGNED_IN",r.session)),this._returnResult({data:Object.assign(Object.assign({},r),{redirectType:i??null}),error:s})}catch(r){if(await Bt(this.storage,`${this.storageKey}-code-verifier`),ye(r))return this._returnResult({data:{user:null,session:null,redirectType:null},error:r});throw r}}async signInWithIdToken(t){try{const{options:n,provider:a,token:i,access_token:r,nonce:s}=t,l=await ve(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:a,id_token:i,access_token:r,nonce:s,gotrue_meta_security:{captcha_token:n==null?void 0:n.captchaToken}},xform:va}),{data:u,error:c}=l;if(c)return this._returnResult({data:{user:null,session:null},error:c});if(!u||!u.session||!u.user){const h=new qs;return this._returnResult({data:{user:null,session:null},error:h})}return u.session&&(await this._saveSession(u.session),await this._notifyAllSubscribers("SIGNED_IN",u.session)),this._returnResult({data:u,error:c})}catch(n){if(ye(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async signInWithOtp(t){var n,a,i,r,s;try{if("email"in t){const{email:l,options:u}=t;let c=null,h=null;this.flowType==="pkce"&&([c,h]=await Gs(this.storage,this.storageKey));const{error:d}=await ve(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:l,data:(n=u==null?void 0:u.data)!==null&&n!==void 0?n:{},create_user:(a=u==null?void 0:u.shouldCreateUser)!==null&&a!==void 0?a:!0,gotrue_meta_security:{captcha_token:u==null?void 0:u.captchaToken},code_challenge:c,code_challenge_method:h},redirectTo:u==null?void 0:u.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:d})}if("phone"in t){const{phone:l,options:u}=t,{data:c,error:h}=await ve(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:l,data:(i=u==null?void 0:u.data)!==null&&i!==void 0?i:{},create_user:(r=u==null?void 0:u.shouldCreateUser)!==null&&r!==void 0?r:!0,gotrue_meta_security:{captcha_token:u==null?void 0:u.captchaToken},channel:(s=u==null?void 0:u.channel)!==null&&s!==void 0?s:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:c==null?void 0:c.message_id},error:h})}throw new Md("You must provide either an email or phone number.")}catch(l){if(await Bt(this.storage,`${this.storageKey}-code-verifier`),ye(l))return this._returnResult({data:{user:null,session:null},error:l});throw l}}async verifyOtp(t){var n,a;try{let i,r;"options"in t&&(i=(n=t.options)===null||n===void 0?void 0:n.redirectTo,r=(a=t.options)===null||a===void 0?void 0:a.captchaToken);const{data:s,error:l}=await ve(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},t),{gotrue_meta_security:{captcha_token:r}}),redirectTo:i,xform:va});if(l)throw l;if(!s)throw new Error("An error occurred on token verification.");const u=s.session,c=s.user;return u!=null&&u.access_token&&(await this._saveSession(u),await this._notifyAllSubscribers(t.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",u)),this._returnResult({data:{user:c,session:u},error:null})}catch(i){if(ye(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}}async signInWithSSO(t){var n,a,i,r,s;try{let l=null,u=null;this.flowType==="pkce"&&([l,u]=await Gs(this.storage,this.storageKey));const c=await ve(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in t?{provider_id:t.providerId}:null),"domain"in t?{domain:t.domain}:null),{redirect_to:(a=(n=t.options)===null||n===void 0?void 0:n.redirectTo)!==null&&a!==void 0?a:void 0}),!((i=t==null?void 0:t.options)===null||i===void 0)&&i.captchaToken?{gotrue_meta_security:{captcha_token:t.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:l,code_challenge_method:u}),headers:this.headers,xform:q6});return!((r=c.data)===null||r===void 0)&&r.url&&Kt()&&!(!((s=t.options)===null||s===void 0)&&s.skipBrowserRedirect)&&window.location.assign(c.data.url),this._returnResult(c)}catch(l){if(await Bt(this.storage,`${this.storageKey}-code-verifier`),ye(l))return this._returnResult({data:null,error:l});throw l}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async t=>{const{data:{session:n},error:a}=t;if(a)throw a;if(!n)throw new On;const{error:i}=await ve(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:n.access_token});return this._returnResult({data:{user:null,session:null},error:i})})}catch(t){if(ye(t))return this._returnResult({data:{user:null,session:null},error:t});throw t}}async resend(t){try{const n=`${this.url}/resend`;if("email"in t){const{email:a,type:i,options:r}=t,{error:s}=await ve(this.fetch,"POST",n,{headers:this.headers,body:{email:a,type:i,gotrue_meta_security:{captcha_token:r==null?void 0:r.captchaToken}},redirectTo:r==null?void 0:r.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:s})}else if("phone"in t){const{phone:a,type:i,options:r}=t,{data:s,error:l}=await ve(this.fetch,"POST",n,{headers:this.headers,body:{phone:a,type:i,gotrue_meta_security:{captcha_token:r==null?void 0:r.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:s==null?void 0:s.message_id},error:l})}throw new Md("You must provide either an email or phone number and a type")}catch(n){if(ye(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(t,n){this._debug("#_acquireLock","begin",t);try{if(this.lockAcquired){const a=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),i=(async()=>(await a,await n()))();return this.pendingInLock.push((async()=>{try{await i}catch{}})()),i}return await this.lock(`lock:${this.storageKey}`,t,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const a=n();for(this.pendingInLock.push((async()=>{try{await a}catch{}})()),await a;this.pendingInLock.length;){const i=[...this.pendingInLock];await Promise.all(i),this.pendingInLock.splice(0,i.length)}return await a}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(t){this._debug("#_useSession","begin");try{const n=await this.__loadSession();return await t(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 t=null;const n=await Ur(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",n),n!==null&&(this._isValidSession(n)?t=n:(this._debug("#getSession()","session from storage is not val
626id"),await this._removeSession())),!t)return{data:{session:null},error:null};const a=t.expires_at?t.expires_at*1e3-Date.now()<Rp:!1;if(this._debug("#__loadSession()",`session has${a?"":" not"} expired`,"expires_at",t.expires_at),!a){if(this.userStorage){const s=await Ur(this.userStorage,this.storageKey+"-user");s!=null&&s.user?t.user=s.user:t.user=Op()}if(this.storage.isServer&&t.user&&!t.user.__isUserNotAvailableProxy){const s={value:this.suppressGetSessionWarning};t.user=U6(t.user,s),s.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:t},error:null}}const{data:i,error:r}=await this._callRefreshToken(t.refresh_token);return r?this._returnResult({data:{session:null},error:r}):this._returnResult({data:{session:i},error:null})}finally{this._debug("#__loadSession()","end")}}async getUser(t){if(t)return await this._getUser(t);await this.initializePromise;const n=await this._acquireLock(this.lockAcquireTimeout,async()=>await this._getUser());return n.data.user&&(this.suppressGetSessionWarning=!0),n}async _getUser(t){try{return t?await ve(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:t,xform:er}):await this._useSession(async n=>{var a,i,r;const{data:s,error:l}=n;if(l)throw l;return!(!((a=s.session)===null||a===void 0)&&a.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new On}:await ve(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(r=(i=s.session)===null||i===void 0?void 0:i.access_token)!==null&&r!==void 0?r:void 0,xform:er})})}catch(n){if(ye(n))return Pd(n)&&(await this._removeSession(),await Bt(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:n});throw n}}async updateUser(t,n={}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._updateUser(t,n))}async _updateUser(t,n={}){try{return await this._useSession(async a=>{const{data:i,error:r}=a;if(r)throw r;if(!i.session)throw new On;const s=i.session;let l=null,u=null;this.flowType==="pkce"&&t.email!=null&&([l,u]=await Gs(this.storage,this.storageKey));const{data:c,error:h}=await ve(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:n==null?void 0:n.emailRedirectTo,body:Object.assign(Object.assign({},t),{code_challenge:l,code_challenge_method:u}),jwt:s.access_token,xform:er});if(h)throw h;return s.user=c.user,await this._saveSession(s),await this._notifyAllSubscribers("USER_UPDATED",s),this._returnResult({data:{user:s.user},error:null})})}catch(a){if(await Bt(this.storage,`${this.storageKey}-code-verifier`),ye(a))return this._returnResult({data:{user:null},error:a});throw a}}async setSession(t){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._setSession(t))}async _setSession(t){try{if(!t.access_token||!t.refresh_token)throw new On;const n=Date.now()/1e3;let a=n,i=!0,r=null;const{payload:s}=Id(t.access_token);if(s.exp&&(a=s.exp,i=a<=n),i){const{data:l,error:u}=await this._callRefreshToken(t.refresh_token);if(u)return this._returnResult({data:{user:null,session:null},error:u});if(!l)return{data:{user:null,session:null},error:null};r=l}else{const{data:l,error:u}=await this._getUser(t.access_token);if(u)return this._returnResult({data:{user:null,session:null},error:u});r={access_token:t.access_token,refresh_token:t.refresh_token,user:l.user,token_type:"bearer",expires_in:a-n,expires_at:a},await this._saveSession(r),await this._notifyAllSubscribers("SIGNED_IN",r)}return this._returnResult({data:{user:r.user,session:r},error:null})}catch(n){if(ye(n))return this._returnResult({data:{session:null,user:null},error:n});throw n}}async refreshSession(t){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._refreshSession(t))}async _refreshSession(t){try{return await this._useSession(async n=>{var a;if(!t){const{data:s,error:l}=n;if(l)throw l;t=(a=s.session)!==null&&a!==void 0?a:void 0}if(!(t!=null&&t.refresh_token))throw new On;const{data:i,error:r}=await this._callRefreshToken(t.refresh_token);return r?this._returnResult({data:{user:null,session:null},error:r}):i?this._returnResult({data:{user:i.user,session:i},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(n){if(ye(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async _getSessionFromURL(t,n){try{if(!Kt())throw new Rd("No browser detected.");
626if(t.error||t.error_description||t.error_code)throw new Rd(t.error_description||"Error in URL with unspecified error_description",{error:t.error||"unspecified_error",code:t.error_code||"unspecified_code"});switch(n){case"implicit":if(this.flowType==="pkce")throw new E1("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new Rd("Not a valid implicit grant flow url.");break;default:}if(n==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!t.code)throw new E1("No code detected.");const{data:v,error:k}=await this._exchangeCodeForSession(t.code);if(k)throw k;const j=new URL(window.location.href);return j.searchParams.delete("code"),window.history.replaceState(window.history.state,"",j.toString()),{data:{session:v.session,redirectType:null},error:null}}const{provider_token:a,provider_refresh_token:i,access_token:r,refresh_token:s,expires_in:l,expires_at:u,token_type:c}=t;if(!r||!l||!s||!c)throw new Rd("No session defined in URL");const h=Math.round(Date.now()/1e3),d=parseInt(l);let m=h+d;u&&(m=parseInt(u));const f=m-h;f*1e3<=ao&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${f}s, should have been closer to ${d}s`);const y=m-d;h-y>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",y,m,h):h-y<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",y,m,h);const{data:g,error:x}=await this._getUser(r);if(x)throw x;const w={provider_token:a,provider_refresh_token:i,access_token:r,expires_in:d,expires_at:m,refresh_token:s,token_type:c,user:g.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:w,redirectType:t.type},error:null})}catch(a){if(ye(a))return this._returnResult({data:{session:null,redirectType:null},error:a});throw a}}_isImplicitGrantCallback(t){return typeof this.detectSessionInUrl=="function"?this.detectSessionInUrl(new URL(window.location.href),t):!!(t.access_token||t.error_description)}async _isPKCECallback(t){const n=await Ur(this.storage,`${this.storageKey}-code-verifier`);return!!(t.code&&n)}async signOut(t={scope:"global"}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._signOut(t))}async _signOut({scope:t}={scope:"global"}){return await this._useSession(async n=>{var a;const{data:i,error:r}=n;if(r&&!Pd(r))return this._returnResult({error:r});const s=(a=i.session)===null||a===void 0?void 0:a.access_token;if(s){const{error:l}=await this.admin.signOut(s,t);if(l&&!(k6(l)&&(l.status===404||l.status===401||l.status===403)||Pd(l)))return this._returnResult({error:l})}return t!=="others"&&(await this._removeSession(),await Bt(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(t){const n=E6(),a={id:n,callback:t,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,a),(async()=>(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{this._emitInitialSession(n)})))(),{data:{subscription:a}}}async _emitInitialSession(t){return await this._useSession(async n=>{var a,i;try{const{data:{session:r},error:s}=n;if(s)throw s;await((a=this.stateChangeEmitters.get(t))===null||a===void 0?void 0:a.callback("INITIAL_SESSION",r)),this._debug("INITIAL_SESSION","callback id",t,"session",r)}catch(r){await((i=this.stateChangeEmitters.get(t))===null||i===void 0?void 0:i.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",t,"error",r),Pd(r)?console.warn(r):console.error(r)}})}async resetPasswordForEmail(t,n={}){let a=null,i=null;this.flowType==="pkce"&&([a,i]=await Gs(this.storage,this.storageKey,!0));try{return await ve(this.fetch,"POST",`${this.url}/recover`,{body:{email:t,code_challenge:a,code_challenge_method:i,gotrue_meta_security:{captcha_token:n.captchaToken}},headers:this.headers,redirectTo:n.redirectTo})}catch(r){if(await Bt(this.storage,`${this.storageKey}-code-verifier`),ye(r))return this._returnResult({data:null,error:r});throw r}}async getUserIdentities(){var t;try{const{data:n,error:a}=await this.getUser();if(a)throw a;return this._returnResult({data:{identities:(t=n.user.identities)!==null&&t!==void 0?t:[]},error:null})}catch(n){if(ye(n))return this._returnResult({data:null,error:n});throw n}}async linkIdentity(t){return"token"in t?this.linkIdentityIdToken(t):this.linkIdentityOAuth(t)}async linkIdentityOAuth(t){var n;try{const{data:a,error:i}=await this._useSession(async r=>{var s,l,u,c,h;const{data:d,error:m}=r;if(m)throw m;const f=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,t.provider,{redirectTo:(s=t.options)===null||s===void 0?void 0:s.redirectTo,scopes:(l=t.options)===null||l===void 0?void 0:l.scopes,queryParams:(u=t.options)===null||u===void 0?void 0:u.queryParams,skipBrowserRedirect:!0});return await ve(this.fetch,"GET",f,{headers:this.headers,jwt:(h=(c=d.session)===null||c===void 0?void 0:c.access_token)!==null&&h!==void 0?h:void 0})});if(i)throw i;return Kt()&&!(!((n=t.options)===null||n===void 0)&&n.skipBrowserRedirect)&&window.location.assign(a==null?void 0:a.url),this._returnResult({data:{provider:t.provider,url:a==null?void 0:a.url},error:null})}catch(a){if(ye(a))return this._returnResult({data:{provider:t.provider,url:null},error:a});throw a}}async linkIdentityIdToken(t){return await this._useSession(async n=>{var a;try{const{error:i,data:{session:r}}=n;if(i)throw i;const{options:s,provider:l,token:u,access_token:c,nonce:h}=t,d=await ve(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:(a=r==null?void 0:r.access_token)!==null&&a!==void 0?a:void 0,body:{provider:l,id_token:u,access_token:c,nonce:h,link_identity:!0,gotrue_meta_security:{captcha_token:s==null?void 0:s.captchaToken}},xform:va}),{data:m,error:f}=d;return f?this._returnResult({data:{user:null,session:null},error:f}):!m||!m.session||!m.user?this._returnResult({data:{user:null,session:null},error:new qs}):(m.session&&(await this._saveSession(m.session),await this._notifyAllSubscribers("USER_UPDATED",m.session)),this._returnResult({data:m,error:f}))}catch(i){if(await Bt(this.storage,`${this.storageKey}-code-verifier`),ye(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}})}async unlinkIdentity(t){try{return await this._useSession(async n=>{var a,i;const{data:r,error:s}=n;if(s)throw s;
626return await ve(this.fetch,"DELETE",`${this.url}/user/identities/${t.identity_id}`,{headers:this.headers,jwt:(i=(a=r.session)===null||a===void 0?void 0:a.access_token)!==null&&i!==void 0?i:void 0})})}catch(n){if(ye(n))return this._returnResult({data:null,error:n});throw n}}async _refreshAccessToken(t){const n=`#_refreshAccessToken(${t.substring(0,5)}...)`;this._debug(n,"begin");try{const a=Date.now();return await R6(async i=>(i>0&&await M6(200*Math.pow(2,i-1)),this._debug(n,"refreshing attempt",i),await ve(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:t},headers:this.headers,xform:va})),(i,r)=>{const s=200*Math.pow(2,i);return r&&Ip(r)&&Date.now()+s-a<ao})}catch(a){if(this._debug(n,"error",a),ye(a))return this._returnResult({data:{session:null,user:null},error:a});throw a}finally{this._debug(n,"end")}}_isValidSession(t){return typeof t=="object"&&t!==null&&"access_token"in t&&"refresh_token"in t&&"expires_at"in t}async _handleProviderSignIn(t,n){const a=await this._getUrlForProvider(`${this.url}/authorize`,t,{redirectTo:n.redirectTo,scopes:n.scopes,queryParams:n.queryParams});return this._debug("#_handleProviderSignIn()","provider",t,"options",n,"url",a),Kt()&&!n.skipBrowserRedirect&&window.location.assign(a),{data:{provider:t,url:a},error:null}}async _recoverAndRefresh(){var t,n;const a="#_recoverAndRefresh()";this._debug(a,"begin");try{const i=await Ur(this.storage,this.storageKey);if(i&&this.userStorage){let s=await Ur(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!s&&(s={user:i.user},await io(this.userStorage,this.storageKey+"-user",s)),i.user=(t=s==null?void 0:s.user)!==null&&t!==void 0?t:Op()}else if(i&&!i.user&&!i.user){const s=await Ur(this.storage,this.storageKey+"-user");s&&(s!=null&&s.user)?(i.user=s.user,await Bt(this.storage,this.storageKey+"-user"),await io(this.storage,this.storageKey,i)):i.user=Op()}if(this._debug(a,"session from storage",i),!this._isValidSession(i)){this._debug(a,"session is not valid"),i!==null&&await this._removeSession();return}const r=((n=i.expires_at)!==null&&n!==void 0?n:1/0)*1e3-Date.now()<Rp;if(this._debug(a,`session has${r?"":" not"} expired with margin of ${Rp}s`),r){if(this.autoRefreshToken&&i.refresh_token){const{error:s}=await this._callRefreshToken(i.refresh_token);s&&(console.error(s),Ip(s)||(this._debug(a,"refresh failed with a non-retryable error, removing the session",s),await this._removeSession()))}}else if(i.user&&i.user.__isUserNotAvailableProxy===!0)try{const{data:s,error:l}=await this._getUser(i.access_token);!l&&(s!=null&&s.user)?(i.user=s.user,await this._saveSession(i),await this._notifyAllSubscribers("SIGNED_IN",i)):this._debug(a,"could not get user data, skipping SIGNED_IN notification")}catch(s){console.error("Error getting user data:",s),this._debug(a,"error getting user data, skipping SIGNED_IN notification",s)}else await this._notifyAllSubscribers("SIGNED_IN",i)}catch(i){this._debug(a,"error",i),console.error(i);return}finally{this._debug(a,"end")}}async _callRefreshToken(t){var n,a;if(!t)throw new On;if(this.refreshingDeferred)return this.refreshingDeferred.promise;const i=`#_callRefreshToken(${t.substring(0,5)}...)`;this._debug(i,"begin");try{this.refreshingDeferred=new yf;const{data:r,error:s}=await this._refreshAccessToken(t);if(s)throw s;if(!r.session)throw new On;await this._saveSession(r.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",r.session);const l={data:r.session,error:null};return this.refreshingDeferred.resolve(l),l}catch(r){if(this._debug(i,"error",r),ye(r)){const s={data:null,error:r};return Ip(r)||await this._removeSession(),(n=this.refreshingDeferred)===null||n===void 0||n.resolve(s),s}throw(a=this.refreshingDeferred)===null||a===void 0||a.reject(r),r}finally{this.refreshingDeferred=null,this._debug(i,"end")}}async _notifyAllSubscribers(t,n,a=!0){const i=`#_notifyAllSubscribers(${t})`;this._debug(i,"begin",n,`broadcast = ${a}`);try{this.broadcastChannel&&a&&this.broadcastChannel.postMessage({event:t,session:n});const r=[],s=Array.from(this.stateChangeEmitters.values()).map(async l=>{try{await l.callback(t,n)}catch(u){r.push(u)}});if(await Promise.all(s),r.length>0){for(let l=0;l<r.length;l+=1)console.error(r[l]);throw r[0]}}finally{this._debug(i,"end")}}async _saveSession(t){this._debug("#_saveSession()",t),this.suppressGetSessionWarning=!0,await Bt(this.storage,`${this.storageKey}-code-verifier`);const n=Object.assign({},t),a=n.user&&n.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!a&&n.user&&await io(this.userStorage,this.storageKey+"-user",{user:n.user});const i=Object.assign({},n);delete i.user;const r=I1(i);await io(this.storage,this.storageKey,r)}else{const i=I1(n);await io(this.storage,this.storageKey,i)}}async _removeSession(){this._debug("#_removeSession()"),this.suppressGetSessionWarning=!1,await Bt(this.storage,this.storageKey),await Bt(this.storage,this.storageKey+"-code-verifier"),await Bt(this.storage,this.storageKey+"-user"),this.userStorage&&await Bt(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const t=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{t&&Kt()&&(window!=null&&window.removeEventListener)&&window.removeEventListener("visibilitychange",t)}
626catch(n){console.error("removing visibilitychange callback failed",n)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const t=setInterval(()=>this._autoRefreshTokenTick(),ao);this.autoRefreshTicker=t,t&&typeof t=="object"&&typeof t.unref=="function"?t.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(t);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 t=this.autoRefreshTicker;this.autoRefreshTicker=null,t&&clearInterval(t);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 t=Date.now();try{return await this._useSession(async n=>{const{data:{session:a}}=n;if(!a||!a.refresh_token||!a.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const i=Math.floor((a.expires_at*1e3-t)/ao);this._debug("#_autoRefreshTokenTick()",`access token expires in ${i} ticks, a tick lasts ${ao}ms, refresh threshold is ${Qy} ticks`),i<=Qy&&await this._callRefreshToken(a.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(t){if(t.isAcquireTimeout||t instanceof sA)this._debug("auto refresh token tick lock not available");else throw t}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!Kt()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>{try{await this._onVisibilityChanged(!1)}catch(t){this._debug("#visibilityChangedCallback","error",t)}},window==null||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(t){console.error("_handleVisibilityChange",t)}}async _onVisibilityChanged(t){const n=`#_onVisibilityChanged(${t})`;this._debug(n,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),t||(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(t,n,a){const i=[`provider=${encodeURIComponent(n)}`];if(a!=null&&a.redirectTo&&i.push(`redirect_to=${encodeURIComponent(a.redirectTo)}`),a!=null&&a.scopes&&i.push(`scopes=${encodeURIComponent(a.scopes)}`),this.flowType==="pkce"){const[r,s]=await Gs(this.storage,this.storageKey),l=new URLSearchParams({code_challenge:`${encodeURIComponent(r)}`,code_challenge_method:`${encodeURIComponent(s)}`});i.push(l.toString())}if(a!=null&&a.queryParams){const r=new URLSearchParams(a.queryParams);i.push(r.toString())}return a!=null&&a.skipBrowserRedirect&&i.push(`skip_http_redirect=${a.skipBrowserRedirect}`),`${t}?${i.join("&")}`}async _unenroll(t){try{return await this._useSession(async n=>{var a;const{data:i,error:r}=n;return r?this._returnResult({data:null,error:r}):await ve(this.fetch,"DELETE",`${this.url}/factors/${t.factorId}`,{headers:this.headers,jwt:(a=i==null?void 0:i.session)===null||a===void 0?void 0:a.access_token})})}catch(n){if(ye(n))return this._returnResult({data:null,error:n});throw n}}async _enroll(t){try{return await this._useSession(async n=>{var a,i;const{data:r,error:s}=n;if(s)return this._returnResult({data:null,error:s});const l=Object.assign({friendly_name:t.friendlyName,factor_type:t.factorType},t.factorType==="phone"?{phone:t.phone}:t.factorType==="totp"?{issuer:t.issuer}:{}),{data:u,error:c}=await ve(this.fetch,"POST",`${this.url}/factors`,{body:l,headers:this.headers,jwt:(a=r==null?void 0:r.session)===null||a===void 0?void 0:a.access_token});return c?this._returnResult({data:null,error:c}):(t.factorType==="totp"&&u.type==="totp"&&(!((i=u==null?void 0:u.totp)===null||i===void 0)&&i.qr_code)&&(u.totp.qr_code=`data:image/svg+xml;utf-8,${u.totp.qr_code}`),this._returnResult({data:u,error:null}))})}catch(n){if(ye(n))return this._returnResult({data:null,error:n});throw n}}async _verify(t){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async n=>{var a;const{data:i,error:r}=n;if(r)return this._returnResult({data:null,error:r});const s=Object.assign({challenge_id:t.challengeId},"webauthn"in t?{webauthn:Object.assign(Object.assign({},t.webauthn),{credential_response:t.webauthn.type==="create"?l8(t.webauthn.credential_response):u8(t.webauthn.credential_response)})}:{code:t.code}),{data:l,error:u}=await ve(this.fetch,"POST",`${this.url}/factors/${t.factorId}/verify`,{body:s,headers:this.headers,jwt:(a=i==null?void 0:i.session)===null||a===void 0?void 0:a.access_token});return u?this._returnResult({data:null,error:u}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+l.expires_in},l)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",l),this._returnResult({data:l,error:u}))})}catch(n){if(ye(n))return this._returnResult({data:null,error:n});throw n}})}async _challenge(t){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async n=>{var a;const{data:i,error:r}=n;if(r)return this._returnResult({data:null,error:r});const s=await ve(this.fetch,"POST",`${this.url}/factors/${t.factorId}/challenge`,{body:t,headers:this.headers,jwt:(a=i==null?void 0:i.session)===null||a===void 0?void 0:a.access_token});if(s.error)return s;const{data:l}=s;if(l.type!=="webauthn")return{data:l,error:null};switch(l.webauthn.type){case"create":return{data:Object.assign(Object.assign({},l),{webauthn:Object.assign(Object.assign({},l.webauthn),{credential_options:Object.assign(Object.assign({},l.webauthn.credential_options),{publicKey:s8(l.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},l),{webauthn:Object.assign(Object.assign({},l.webauthn),{credential_options:Object.assign(Object.assign({},l.webauthn.credential_options),{publicKey:o8(l.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(n){if(ye(n))return this._returnResult({data:null,error:n});throw n}})}async _challengeAndVerify(t){const{data:n,error:a}=await this._challenge({factorId:t.factorId});return a?this._returnResult({data:null,error:a}):await this._verify({factorId:t.factorId,challengeId:n.id,code:t.code})}async _listFactors(){var t;const{data:{user:n},error:a}=await this.getUser();if(a)return{data:null,error:a};const i={all:[],phone:[],totp:[],webauthn:[]};for(const r of(t=n==null?void 0:n.factors)!==null&&t!==void 0?t:[])i.all.push(r),r.status==="verified"&&i[r.factor_type].push(r);return{data:i,error:null}}async _getAuthenticatorAssuranceLevel(t){var n,a,i,r;if(t)try{const{payload:f}=Id(t);let y=null;f.aal&&(y=f.aal);let g=y;const{data:{user:x},error:w}=await this.getUser(t);if(w)return this._returnResult({data:null,error:w});((a=(n=x==null?void 0:x.factors)===null||n===void 0?void 0:n.filter(j=>j.status==="verified"))!==null&&a!==void 0?a:[]).length>0&&(g="aal2");const k=f.amr||[];return{data:{currentLevel:y,nextLevel:g,currentAuthenticationMethods:k},error:null}}catch(f){if(ye(f))return this._returnResult({data:null,error:f});throw f}const{data:{session:s},error:l}
626=await this.getSession();if(l)return this._returnResult({data:null,error:l});if(!s)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:u}=Id(s.access_token);let c=null;u.aal&&(c=u.aal);let h=c;((r=(i=s.user.factors)===null||i===void 0?void 0:i.filter(f=>f.status==="verified"))!==null&&r!==void 0?r:[]).length>0&&(h="aal2");const m=u.amr||[];return{data:{currentLevel:c,nextLevel:h,currentAuthenticationMethods:m},error:null}}async _getAuthorizationDetails(t){try{return await this._useSession(async n=>{const{data:{session:a},error:i}=n;return i?this._returnResult({data:null,error:i}):a?await ve(this.fetch,"GET",`${this.url}/oauth/authorizations/${t}`,{headers:this.headers,jwt:a.access_token,xform:r=>({data:r,error:null})}):this._returnResult({data:null,error:new On})})}catch(n){if(ye(n))return this._returnResult({data:null,error:n});throw n}}async _approveAuthorization(t,n){try{return await this._useSession(async a=>{const{data:{session:i},error:r}=a;if(r)return this._returnResult({data:null,error:r});if(!i)return this._returnResult({data:null,error:new On});const s=await ve(this.fetch,"POST",`${this.url}/oauth/authorizations/${t}/consent`,{headers:this.headers,jwt:i.access_token,body:{action:"approve"},xform:l=>({data:l,error:null})});return s.data&&s.data.redirect_url&&Kt()&&!(n!=null&&n.skipBrowserRedirect)&&window.location.assign(s.data.redirect_url),s})}catch(a){if(ye(a))return this._returnResult({data:null,error:a});throw a}}async _denyAuthorization(t,n){try{return await this._useSession(async a=>{const{data:{session:i},error:r}=a;if(r)return this._returnResult({data:null,error:r});if(!i)return this._returnResult({data:null,error:new On});const s=await ve(this.fetch,"POST",`${this.url}/oauth/authorizations/${t}/consent`,{headers:this.headers,jwt:i.access_token,body:{action:"deny"},xform:l=>({data:l,error:null})});return s.data&&s.data.redirect_url&&Kt()&&!(n!=null&&n.skipBrowserRedirect)&&window.location.assign(s.data.redirect_url),s})}catch(a){if(ye(a))return this._returnResult({data:null,error:a});throw a}}async _listOAuthGrants(){try{return await this._useSession(async t=>{const{data:{session:n},error:a}=t;return a?this._returnResult({data:null,error:a}):n?await ve(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:n.access_token,xform:i=>({data:i,error:null})}):this._returnResult({data:null,error:new On})})}catch(t){if(ye(t))return this._returnResult({data:null,error:t});throw t}}async _revokeOAuthGrant(t){try{return await this._useSession(async n=>{const{data:{session:a},error:i}=n;return i?this._returnResult({data:null,error:i}):a?(await ve(this.fetch,"DELETE",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:a.access_token,query:{client_id:t.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new On})})}catch(n){if(ye(n))return this._returnResult({data:null,error:n});throw n}}async fetchJwk(t,n={keys:[]}){let a=n.keys.find(l=>l.kid===t);if(a)return a;const i=Date.now();if(a=this.jwks.keys.find(l=>l.kid===t),a&&this.jwks_cached_at+w6>i)return a;const{data:r,error:s}=await ve(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(s)throw s;return!r.keys||r.keys.length===0||(this.jwks=r,this.jwks_cached_at=i,a=r.keys.find(l=>l.kid===t),!a)?null:a}async getClaims(t,n={}){try{let a=t;if(!a){const{data:f,error:y}
626=await this.getSession();if(y||!f.session)return this._returnResult({data:null,error:y});a=f.session.access_token}const{header:i,payload:r,signature:s,raw:{header:l,payload:u}}=Id(a);n!=null&&n.allowExpired||B6(r.exp);const c=!i.alg||i.alg.startsWith("HS")||!i.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(i.kid,n!=null&&n.keys?{keys:n.keys}:n==null?void 0:n.jwks);if(!c){const{error:f}=await this.getUser(a);if(f)throw f;return{data:{claims:r,header:i,signature:s},error:null}}const h=K6(i.alg),d=await crypto.subtle.importKey("jwk",c,h,!0,["verify"]);if(!await crypto.subtle.verify(h,d,s,C6(`${l}.${u}`)))throw new ew("Invalid JWT signature");return{data:{claims:r,header:i,signature:s},error:null}}catch(a){if(ye(a))return this._returnResult({data:null,error:a});throw a}}}dc.nextInstanceID={};const w8=dc,x8="2.103.0";let lu="";typeof Deno<"u"?lu="deno":typeof document<"u"?lu="web":typeof navigator<"u"&&navigator.product==="ReactNative"?lu="react-native":lu="node";const k8={"X-Client-Info":`supabase-js-${lu}/${x8}`},v8={headers:k8},b8={schema:"public"},j8={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},_8={};function hc(e){"@babel/helpers - typeof";return hc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},hc(e)}function S8(e,t){if(hc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var a=n.call(e,t||"default");if(hc(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function N8(e){var t=S8(e,"string");return hc(t)=="symbol"?t:t+""}function C8(e,t,n){return(t=N8(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,a)}return n}function vt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$1(Object(n),!0).forEach(function(a){C8(e,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$1(Object(n)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(n,a))})}return e}const T8=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),E8=()=>Headers,A8=(e,t,n)=>{const a=T8(n),i=E8();return async(r,s)=>{var l;const u=(l=await t())!==null&&l!==void 0?l:e;let c=new i(s==null?void 0:s.headers);return c.has("apikey")||c.set("apikey",e),c.has("Authorization")||c.set("Authorization",`Bearer ${u}`),a(r,vt(vt({},s),{},{headers:c}))}};function P8(e){return e.endsWith("/")?e:e+"/"}function M8(e,t){var n,a;const{db:i,auth:r,realtime:s,global:l}=e,{db:u,auth:c,realtime:h,global:d}=t,m={db:vt(vt({},u),i),auth:vt(vt({},c),r),realtime:vt(vt({},h),s),storage:{},global:vt(vt(vt({},d),l),{},{headers:vt(vt({},(n=d==null?void 0:d.headers)!==null&&n!==void 0?n:{}),(a=l==null?void 0:l.headers)!==null&&a!==void 0?a:{})}),accessToken:async()=>""};return e.accessToken?m.accessToken=e.accessToken:delete m.accessToken,m}function R8(e){const t=e==null?void 0:e.trim();if(!t)throw new Error("supabaseUrl is required.");if(!t.match(/^https?:\/\//i))throw new Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(P8(t))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}var I8=class extends w8{constructor(e){super(e)}},O8=class{constructor(e,t,n){var a,i;this.supabaseUrl=e,this.supabaseKey=t;const r=R8(e);if(!t)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",r),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",r),this.storageUrl=new URL("storage/v1",r),this.functionsUrl=new URL("functions/v1",r);const s=`sb-${r.hostname.split(".")[0]}-auth-token`,l={db:b8,realtime:_8,auth:vt(vt({},j8),{},{storageKey:s}),global:v8},u=M8(n??{},l);if(this.storageKey=(a=u.auth.storageKey)!==null&&a!==void 0?a:"",this.headers=(i=u.global.headers)!==null&&i!==void 0?i:{},u.accessToken)this.accessToken=u.accessToken,this.auth=new Proxy({},{get:(h,d)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(d)} is not possible`)}});else{var c;this.auth=this._initSupabaseAuthClient((c=u.auth)!==null&&c!==void 0?c:{},this.headers,u.global.fetch)}this.fetch=A8(t,this._getAccessToken.bind(this),u.global.fetch),this.realtime=this._initRealtimeClient(vt({headers:this.headers,accessToken:this._getAccessToken.bind(this)},u.realtime)),this.accessToken&&Promise.resolve(this.accessToken()).then(h=>this.realtime.setAuth(h)).catch(h=>console.warn("Failed to set initial Realtime auth token:",h)),this.rest=new nV(new URL("rest/v1",r).href,{headers:this.headers,schema:u.db.schema,fetch:this.fetch,timeout:u.db.timeout,urlLengthLimit:u.db.urlLengthLimit}),this.storage=new m6(this.storageUrl.href,this.headers,this.fetch,n==null?void 0:n.storage),u.accessToken||this._listenForAuthEvents()}get functions(){return new WU(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,t={},n={head:!1,get:!1,count:void 0}){return this.rest.rpc(e,t,n)}
626channel(e,t={config:{}}){return this.realtime.channel(e,t)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var e=this,t,n;if(e.accessToken)return await e.accessToken();const{data:a}=await e.auth.getSession();return(t=(n=a.session)===null||n===void 0?void 0:n.access_token)!==null&&t!==void 0?t:e.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:t,detectSessionInUrl:n,storage:a,userStorage:i,storageKey:r,flowType:s,lock:l,debug:u,throwOnError:c},h,d){const m={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new I8({url:this.authUrl.href,headers:vt(vt({},m),h),storageKey:r,autoRefreshToken:e,persistSession:t,detectSessionInUrl:n,storage:a,userStorage:i,flowType:s,lock:l,debug:u,throwOnError:c,fetch:d,hasCustomAuthorizationHeader:Object.keys(this.headers).some(f=>f.toLowerCase()==="authorization")})}_initRealtimeClient(e){return new LV(this.realtimeUrl.href,vt(vt({},e),{},{params:vt(vt({},{apikey:this.supabaseKey}),e==null?void 0:e.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((e,t)=>{this._handleTokenChanged(e,"CLIENT",t==null?void 0:t.access_token)})}_handleTokenChanged(e,t,n){(e==="TOKEN_REFRESHED"||e==="SIGNED_IN")&&this.changedAccessToken!==n?(this.changedAccessToken=n,this.realtime.setAuth(n)):e==="SIGNED_OUT"&&(this.realtime.setAuth(),t=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};const L8=(e,t,n)=>new O8(e,t,n);function D8(){if(typeof window<"u")return!1;const e=globalThis.process;if(!e)return!1;const t=e.version;if(t==null)return!1;const n=t.match(/^v(\d+)\./);return n?parseInt(n[1],10)<=18:!1}D8()&&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 z8="https://crbzrntvphjalxmkrchi.supabase.co",F8="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImNyYnpybnR2cGhqYWx4bWtyY2hpIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzI2Njk1OTIsImV4cCI6MjA4ODI0NTU5Mn0.gzgwUs5LRK8lCT8SfREQ9xC_-tYTp3gC5jp_bvqM-CE",te=L8(z8,F8,{auth:{storage:localStorage,persistSession:!0,autoRefreshToken:!0}}),B8=Object.freeze(Object.defineProperty({__proto__:null,supabase:te},Symbol.toStringTag,{value:"Module"})),Rt=()=>{const[e,t]=p.useState(null),[n,a]=p.useState(null),[i,r]=p.useState(!0);return p.useEffect(()=>{te.auth.getSession().then(({data:{session:u}})=>{a(u),t((u==null?void 0:u.user)??null),r(!1)});const{data:{subscription:l}}=te.auth.onAuthStateChange((u,c)=>{a(c),t((c==null?void 0:c.user)??null),r(!1)});return()=>l.unsubscribe()},[]),{user:e,session:n,loading:i,signOut:async()=>{await te.auth.signOut()}}},K8=e=>{const[t,n]=p.useState(!1),[a,i]=p.useState(!0);return p.useEffect(()=>{if(!e){n(!1),i(!1);return}(async()=>{const{data:s}=await te.from("user_roles").select("role").eq("user_id",e).eq("role","admin").maybeSingle();n(!!s),i(!1)})()},[e]),{isAdmin:t,loading:a}},$8=["en","sw","ki","luo","kal","kam"],U1={en:"EN",sw:"SW",ki:"KI",luo:"LUO",kal:"KAL",kam:"KAM"},U8=()=>{const{lang:e,setLang:t}=Re();return o.jsxs(KE,{children:[o.jsx($E,{asChild:!0,children:o.jsxs("button",{className:"inline-flex items-center gap-1.5 rounded-full bg-muted px-3 py-1.5 text-xs font-semibold text-foreground transition-colors hover:bg-primary hover:text-primary-foreground","aria-label":"Select language",children:[o.jsx(fD,{className:"h-3.5 w-3.5"}),U1[e]]})}),o.jsx(Rk,{align:"end",className:"min-w-[140px]",children:$8.map(n=>o.jsxs(Ik,{onClick:()=>t(n),className:e===n?"bg-primary/10 font-bold":"",children:[o.jsx("span",{className:"mr-2 text-xs font-mono w-6",children:U1[n]}),_K[n]]},n))})]})},Dk=Qm("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),Q=p.forwardRef(({className:e,variant:t,size:n,asChild:a=!1,...i},r)=>{const s=a?p3:"button";return o.jsx(s,{className:ce(Dk({variant:t,size:n,className:e})),ref:r,...i})});Q.displayName="Button";const V8="/assets/click-logo-D9aGNgQq.jpeg",wf=()=>{const{user:e}=Rt(),[t,n]=p.useState(null),[a,i]=p.useState(""),[r,s]=p.useState(!0),[l,u]=p.useState(!1),c=p.useCallback(async()=>{var y,g;if(!e){s(!1);return}s(!0);const{data:m}=await te.from("profiles").select("avatar_url, display_name, email").eq("user_id",e.id).maybeSingle();n((m==null?void 0:m.avatar_url)??null);const f=((y=m==null?void 0:m.display_name)==null?void 0:y.trim())||((g=m==null?void 0:m.email)==null?void 0:g.split("@")[0])||"Citizen";i(f),s(!1)},[e]);p.useEffect(()=>{c()},[c]);const h=p.useCallback(async m=>{if(!e)return{url:null,error:"Not signed in"};if(!m.type.startsWith("image/"))return{url:null,error:"Please choose an image file"};if(m.size>5*1024*1024)return{url:null,error:"Image must be under 5 MB"};u(!0);try{const f=(m.name.split(".").pop()||"jpg").toLowerCase(),y=`${e.id}/avatar-${Date.now()}.${f}`,{error:g}
626=await te.storage.from("avatars").upload(y,m,{cacheControl:"3600",upsert:!0,contentType:m.type});if(g)return{url:null,error:g.message};const{data:x}=te.storage.from("avatars").getPublicUrl(y),w=x.publicUrl,{error:v}=await te.from("profiles").update({avatar_url:w}).eq("user_id",e.id);return v?{url:null,error:v.message}:(n(w),{url:w})}finally{u(!1)}},[e]),d=p.useCallback(async()=>{if(!e)return{error:"Not signed in"};const{error:m}=await te.from("profiles").update({avatar_url:null}).eq("user_id",e.id);return m?{error:m.message}:(n(null),{})},[e]);return{url:t,displayName:a,loading:r,uploading:l,upload:h,remove:d,refresh:c}};var uA={exports:{}},cA={};/** 627 * @license React 628 * use-sync-external-store-shim.production.js 629 * 630 * Copyright (c) Meta Platforms, Inc. and affiliates. 631 * 632 * This source code is licensed under the MIT license found in the 633 * LICENSE file in the root directory of this source tree. 634 */var rl=p;function H8(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var W8=typeof Object.is=="function"?Object.is:H8,q8=rl.useState,G8=rl.useEffect,Y8=rl.useLayoutEffect,J8=rl.useDebugValue;function Q8(e,t){var n=t(),a=q8({inst:{value:n,getSnapshot:t}}),i=a[0].inst,r=a[1];return Y8(function(){i.value=n,i.getSnapshot=t,Dp(i)&&r({inst:i})},[e,n,t]),G8(function(){return Dp(i)&&r({inst:i}),e(function(){Dp(i)&&r({inst:i})})},[e]),J8(n),n}function Dp(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!W8(e,n)}catch{return!0}}function X8(e,t){return t()}var Z8=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?X8:Q8;cA.useSyncExternalStore=rl.useSyncExternalStore!==void 0?rl.useSyncExternalStore:Z8;uA.exports=cA;var eH=uA.exports;function tH(){return eH.useSyncExternalStore(nH,()=>!0,()=>!1)}function nH(){return()=>{}}var zk="Avatar",[aH,fie]=Yt(zk),[iH,dA]=aH(zk),hA=p.forwardRef((e,t)=>{const{__scopeAvatar:n,...a}=e,[i,r]=p.useState("idle");return o.jsx(iH,{scope:n,imageLoadingStatus:i,onImageLoadingStatusChange:r,children:o.jsx(we.span,{...a,ref:t})})});hA.displayName=zk;var mA="AvatarImage",fA=p.forwardRef((e,t)=>{const{__scopeAvatar:n,src:a,onLoadingStatusChange:i=()=>{},...r}=e,s=dA(mA,n),l=rH(a,r),u=fn(c=>{i(c),s.onImageLoadingStatusChange(c)});return St(()=>{l!=="idle"&&u(l)},[l,u]),l==="loaded"?o.jsx(we.img,{...r,ref:t,src:a}):null});fA.displayName=mA;var pA="AvatarFallback",gA=p.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:a,...i}=e,r=dA(pA,n),[s,l]=p.useState(a===void 0);return p.useEffect(()=>{if(a!==void 0){const u=window.setTimeout(()=>l(!0),a);return()=>window.clearTimeout(u)}},[a]),s&&r.imageLoadingStatus!=="loaded"?o.jsx(we.span,{...i,ref:t}):null});gA.displayName=pA;function V1(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function rH(e,{referrerPolicy:t,crossOrigin:n}){const a=tH(),i=p.useRef(null),r=a?(i.current||(i.current=new window.Image),i.current):null,[s,l]=p.useState(()=>V1(r,e));return St(()=>{l(V1(r,e))},[r,e]),St(()=>{const u=d=>()=>{l(d)};if(!r)return;const c=u("loaded"),h=u("error");return r.addEventListener("load",c),r.addEventListener("error",h),t&&(r.referrerPolicy=t),typeof n=="string"&&(r.crossOrigin=n),()=>{r.removeEventListener("load",c),r.removeEventListener("error",h)}},[r,n,t]),s}var yA=hA,wA=fA,xA=gA;const Fk=p.forwardRef(({className:e,...t},n)=>o.jsx(yA,{ref:n,className:ce("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));Fk.displayName=yA.displayName;const Bk=p.forwardRef(({className:e,...t},n)=>o.jsx(wA,{ref:n,className:ce("aspect-square h-full w-full",e),...t}));Bk.displayName=wA.displayName;const Kk=p.forwardRef(({className:e,...t},n)=>o.jsx(xA,{ref:n,className:ce("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));Kk.displayName=xA.displayName;const sH=e=>e.split(/\s+/).filter(Boolean).slice(0,2).map(t=>{var n;return(n=t[0])==null?void 0:n.toUpperCase()}).join("")||"C",zs=p.forwardRef(({name:e,url:t,className:n="h-9 w-9",fallbackTextClass:a="text-xs"},i)=>o.jsxs(Fk,{ref:i,className:n,children:[t&&o.jsx(Bk,{src:t,alt:e,className:"object-cover"}),o.jsx(Kk,{className:`bg-primary/15 text-primary font-heading font-bold ${a}`,children:sH(e)})]}));zs.displayName="UserAvatar";function oH(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const lH=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,uH=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,cH={};function H1(e,t){return(cH.jsx?uH:lH).test(e)}const dH=/[ \t\n\f\r]/g;function hH(e){return typeof e=="object"?e.type==="text"?W1(e.value):!1:W1(e)}function W1(e){return e.replace(dH,"")===""}class Bc{constructor(t,n,a){this.normal=n,this.property=t,a&&(this.space=a)}}Bc.prototype.normal={};Bc.prototype.property={};Bc.prototype.space=void 0;function kA(e,t){const n={},a={};for(const i of e)Object.assign(n,i.property),Object.assign(a,i.normal);return new Bc(n,a,t)}function tw(e){return e.toLowerCase()}class Rn{constructor(t,n){this.attribute=n,this.property=t}}Rn.prototype.attribute="";Rn.prototype.booleanish=!1;Rn.prototype.boolean=!1;Rn.prototype.commaOrSpaceSeparated=!1;Rn.prototype.commaSeparated=!1;Rn.prototype.defined=!1;Rn.prototype.mustUseProperty=!1;Rn.prototype.number=!1;Rn.prototype.overloadedBoolean=!1;Rn.prototype.property="";Rn.prototype.spaceSeparated=!1;Rn.prototype.space=void 0;let mH=0;const Oe=Fs(),Tt=Fs(),nw=Fs(),oe=Fs(),at=Fs(),Ro=Fs(),Ln=Fs();function Fs(){return 2**++mH}const aw=Object.freeze(Object.defineProperty({__proto__:null,boolean:Oe,booleanish:Tt,commaOrSpaceSeparated:Ln,commaSeparated:Ro,number:oe,overloadedBoolean:nw,spaceSeparated:at},Symbol.toStringTag,{value:"Module"})),zp=Object.keys(aw);class $k extends Rn{constructor(t,n,a,i){let r=-1;if(super(t,n),q1(this,"space",i),typeof a=="number")for(;++r<zp.length;){const s=zp[r];q1(this,zp[r],(a&aw[s])===aw[s])}}}$k.prototype.defined=!0;function q1(e,t,n){n&&(e[t]=n)}function Tl(e){const t={},n={};for(const[a,i]of Object.entries(e.properties)){const r=new $k(a,e.transform(e.attributes||{},a),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(a)&&(r.mustUseProperty=!0),t[a]=r,n[tw(a)]=a,n[tw(r.attribute)]=a}return new Bc(t,n,e.space)}const vA=Tl({properties:{ariaActiveDescendant:null,ariaAtomic:Tt,ariaAutoComplete:null,ariaBusy:Tt,ariaChecked:Tt,ariaColCount:oe,ariaColIndex:oe,ariaColSpan:oe,ariaControl
vendor: 5,434 bytes, line 634
634s:at,ariaCurrent:null,ariaDescribedBy:at,ariaDetails:null,ariaDisabled:Tt,ariaDropEffect:at,ariaErrorMessage:null,ariaExpanded:Tt,ariaFlowTo:at,ariaGrabbed:Tt,ariaHasPopup:null,ariaHidden:Tt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:at,ariaLevel:oe,ariaLive:null,ariaModal:Tt,ariaMultiLine:Tt,ariaMultiSelectable:Tt,ariaOrientation:null,ariaOwns:at,ariaPlaceholder:null,ariaPosInSet:oe,ariaPressed:Tt,ariaReadOnly:Tt,ariaRelevant:null,ariaRequired:Tt,ariaRoleDescription:at,ariaRowCount:oe,ariaRowIndex:oe,ariaRowSpan:oe,ariaSelected:Tt,ariaSetSize:oe,ariaSort:null,ariaValueMax:oe,ariaValueMin:oe,ariaValueNow:oe,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function bA(e,t){return t in e?e[t]:t}function jA(e,t){return bA(e,t.toLowerCase())}const fH=Tl({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ro,acceptCharset:at,accessKey:at,action:null,allow:null,allowFullScreen:Oe,allowPaymentRequest:Oe,allowUserMedia:Oe,alt:null,as:null,async:Oe,autoCapitalize:null,autoComplete:at,autoFocus:Oe,autoPlay:Oe,blocking:at,capture:null,charSet:null,checked:Oe,cite:null,className:at,cols:oe,colSpan:null,content:null,contentEditable:Tt,controls:Oe,controlsList:at,coords:oe|Ro,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Oe,defer:Oe,dir:null,dirName:null,disabled:Oe,download:nw,draggable:Tt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Oe,formTarget:null,headers:at,height:oe,hidden:nw,high:oe,href:null,hrefLang:null,htmlFor:at,httpEquiv:at,id:null,imageSizes:null,imageSrcSet:null,inert:Oe,inputMode:null,integrity:null,is:null,isMap:Oe,itemId:null,itemProp:at,itemRef:at,itemScope:Oe,itemType:at,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Oe,low:oe,manifest:null,max:null,maxLength:oe,media:null,method:null,min:null,minLength:oe,multiple:Oe,muted:Oe,name:null,nonce:null,noModule:Oe,noValidate:Oe,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Oe,optimum:oe,pattern:null,ping:at,placeholder:null,playsInline:Oe,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Oe,referrerPolicy:null,rel:at,required:Oe,reversed:Oe,rows:oe,rowSpan:oe,sandbox:at,scope:null,scoped:Oe,seamless:Oe,selected:Oe,shadowRootClonable:Oe,shadowRootDelegatesFocus:Oe,shadowRootMode:null,shape:null,size:oe,sizes:null,slot:null,span:oe,spellCheck:Tt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:oe,step:null,style:null,tabIndex:oe,target:null,title:null,translate:null,type:null,typeMustMatch:Oe,useMap:null,value:Tt,width:oe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:at,axis:null,background:null,bgColor:null,border:oe,borderColor:null,bottomMargin:oe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Oe,declare:Oe,event:null,face:null,frame:null,frameBorder:null,hSpace:oe,leftMargin:oe,link:null,longDesc:null,lowSrc:null,marginHeight:oe,marginWidth:oe,noResize:Oe,noHref:Oe,noShade:Oe,noWrap:Oe,object:null,profile:null,prompt:null,rev:null,rightMargin:oe,rules:null,scheme:null,scrolling:Tt,standby:null,summary:null,text:null,topMargin:oe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:oe,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Oe,disableRemotePlayback:Oe,prefix:null,property:null,results:oe,security:null,unselectable:null},space:"html",transform:jA}),pH=Tl({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRen
634dering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",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",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",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",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",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",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Ln,accentHeight:oe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:oe,amplitude:oe,arabicForm:null,ascent:oe,attributeName:null,attributeType:null,azimuth:oe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:oe,by:null,calcMode:null,capHeight:oe,className:at,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRen
634dering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:oe,diffuseConstant:oe,direction:null,display:null,dur:null,divisor:oe,dominantBaseline:null,download:Oe,dx:null,dy:null,edgeMode:null,editable:null,elevation:oe,enableBackground:null,end:null,event:null,exponent:oe,externalResourcesRequired:null,fill:null,fillOpacity:oe,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Ro,g2:Ro,glyphName:Ro,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:oe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:oe,horizOriginX:oe,horizOriginY:oe,id:null,ideographic:oe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:oe,k:oe,k1:oe,k2:oe,k3:oe,k4:oe,kernelMatrix:Ln,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:oe,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:oe,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:oe,overlineThickness:oe,paintOrder:null,panose1:null,path:null,pathLength:oe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:at,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:oe,pointsAtY:oe,pointsAtZ:oe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Ln,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Ln,rev:Ln,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Ln,requiredFeatures:Ln,requiredFonts:Ln,requiredFormats:Ln,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:oe,specularExponent:oe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:oe,strikethroughThickness:oe,string:null,stroke:null,strokeDashArray:Ln,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:oe,strokeOpacity:oe,strokeWidth:null,style:null,surfaceScale:oe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Ln,tabIndex:oe,tableValues:null,target:null,targetX:oe,targetY:oe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Ln,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:oe,underlineThickness:oe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:oe,values:null,vAlphabetic:oe,vMathematical:oe,vectorEffect:null,vHanging:oe,vIdeographic:oe,version:null,vertAdvY:oe,vertOriginX:oe,vertOriginY:oe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:oe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:bA}),_A=Tl({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}
vendor: 4,749 bytes, lines 634-635
634,space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),SA=Tl({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:jA}),NA=Tl({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),gH={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},yH=/[A-Z]/g,G1=/-[a-z]/g,wH=/^data[-\w.:]+$/i;function xH(e,t){const n=tw(t);let a=t,i=Rn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&wH.test(t)){if(t.charAt(4)==="-"){const r=t.slice(5).replace(G1,vH);a="data"+r.charAt(0).toUpperCase()+r.slice(1)}else{const r=t.slice(4);if(!G1.test(r)){let s=r.replace(yH,kH);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=$k}return new i(a,t)}function kH(e){return"-"+e.toLowerCase()}function vH(e){return e.charAt(1).toUpperCase()}const bH=kA([vA,fH,_A,SA,NA],"html"),Uk=kA([vA,pH,_A,SA,NA],"svg");function jH(e){return e.join(" ").trim()}var Vk={},Y1=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,_H=/\n/g,SH=/^\s*/,NH=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,CH=/^:\s*/,TH=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,EH=/^[;\s]*/,AH=/^\s+|\s+$/g,PH=` 635`,J1="/",Q1="*",Qr="",MH="comment",RH="declaration";function IH(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,a=1;function i(y){var g=y.match(_H);g&&(n+=g.length);var x=y.lastIndexOf(PH);a=~x?y.length-x:a+y.length}function r(){var y={line:n,column:a};return function(g){return g.position=new s(y),c(),g}}function s(y){this.start=y,this.end={line:n,column:a},this.source=t.source}s.prototype.content=e;function l(y){var g=new Error(t.source+":"+n+":"+a+": "+y);if(g.reason=y,g.filename=t.source,g.line=n,g.column=a,g.source=e,!t.silent)throw g}function u(y){var g=y.exec(e);if(g){var x=g[0];return i(x),e=e.slice(x.length),g}}function c(){u(SH)}function h(y){var g;for(y=y||[];g=d();)g!==!1&&y.push(g);return y}function d(){var y=r();if(!(J1!=e.charAt(0)||Q1!=e.charAt(1))){for(var g=2;Qr!=e.charAt(g)&&(Q1!=e.charAt(g)||J1!=e.charAt(g+1));)++g;if(g+=2,Qr===e.charAt(g-1))return l("End of comment missing");var x=e.slice(2,g-2);return a+=2,i(x),e=e.slice(g),a+=2,y({type:MH,comment:x})}}function m(){var y=r(),g=u(NH);if(g){if(d(),!u(CH))return l("property missing ':'");var x=u(TH),w=y({type:RH,property:X1(g[0].replace(Y1,Qr)),value:x?X1(x[0].replace(Y1,Qr)):Qr});return u(EH),w}}function f(){var y=[];h(y);for(var g;g=m();)g!==!1&&(y.push(g),h(y));return y}return c(),f()}function X1(e){return e?e.replace(AH,Qr):Qr}var OH=IH,LH=Sh&&Sh.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Vk,"__esModule",{value:!0});Vk.default=zH;const DH=LH(OH);function zH(e,t){let n=null;if(!e||typeof e!="string")return n;const a=(0,DH.default)(e),i=typeof t=="function";return a.forEach(r=>{if(r.type!=="declaration")return;const{property:s,value:l}=r;i?t(s,l,r):l&&(n=n||{},n[s]=l)}),n}var xf={};Object.defineProperty(xf,"__esModule",{value:!0});xf.camelCase=void 0;var FH=/^--[a-zA-Z0-9_-]+$/,BH=/-([a-z])/g,KH=/^[^-]+$/,$H=/^-(webkit|moz|ms|o|khtml)-/,UH=/^-(ms)-/,VH=function(e){return!e||KH.test(e)||FH.test(e)},HH=function(e,t){return t.toUpperCase()},Z1=function(e,t){return"".concat(t,"-")},WH=function(e,t){return t===void 0&&(t={}),VH(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(UH,Z1):e=e.replace($H,Z1),e.replace(BH,HH))};xf.camelCase=WH;var qH=Sh&&Sh.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},GH=qH(Vk),YH=xf;function iw(e,t){var n={};return!e||typeof e!="string"||(0,GH.default)(e,function(a,i){a&&i&&(n[(0,YH.camelCase)(a,t)]=i)}),n}iw.default=iw;var JH=iw;const QH=Pm(JH),CA=TA("end"),Hk=TA("start");function TA(e){return t;function t(n){const a=n&&n.position&&n.position[e]||{};if(typeof a.line=="number"&&a.line>0&&typeof a.column=="number"&&a.column>0)return{line:a.line,column:a.column,offset:typeof a.offset=="number"&&a.offset>-1?a.offset:void 0}}}function XH(e){const t=Hk(e),n=CA(e);if(t&&n)return{start:t,end:n}}function Nu(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?ej(e.position):"start"in e||"end"in e?ej(e):"line"in e||"column"in e?rw(e):""}function rw(e){return tj(e&&e.line)+":"+tj(e&&e.column)}function ej(e){return rw(e&&e.start)+"-"+rw(e&&e.end)}function tj(e){return e&&typeof e=="number"?e:1}
vendor: 1,921 bytes, line 635
635class rn extends Error{constructor(t,n,a){super(),typeof n=="string"&&(a=n,n=void 0);let i="",r={},s=!1;if(n&&("line"in n&&"column"in n?r={place:n}:"start"in n&&"end"in n?r={place:n}:"type"in n?r={ancestors:[n],place:n.position}:r={...n}),typeof t=="string"?i=t:!r.cause&&t&&(s=!0,i=t.message,r.cause=t),!r.ruleId&&!r.source&&typeof a=="string"){const u=a.indexOf(":");u===-1?r.ruleId=a:(r.source=a.slice(0,u),r.ruleId=a.slice(u+1))}if(!r.place&&r.ancestors&&r.ancestors){const u=r.ancestors[r.ancestors.length-1];u&&(r.place=u.position)}const l=r.place&&"start"in r.place?r.place.start:r.place;this.ancestors=r.ancestors||void 0,this.cause=r.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=l?l.line:void 0,this.name=Nu(r.place)||"1:1",this.place=r.place||void 0,this.reason=this.message,this.ruleId=r.ruleId||void 0,this.source=r.source||void 0,this.stack=s&&r.cause&&typeof r.cause.stack=="string"?r.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}rn.prototype.file="";rn.prototype.name="";rn.prototype.reason="";rn.prototype.message="";rn.prototype.stack="";rn.prototype.column=void 0;rn.prototype.line=void 0;rn.prototype.ancestors=void 0;rn.prototype.cause=void 0;rn.prototype.fatal=void 0;rn.prototype.place=void 0;rn.prototype.ruleId=void 0;rn.prototype.source=void 0;const Wk={}.hasOwnProperty,ZH=new Map,eW=/[A-Z]/g,tW=new Set(["table","tbody","thead","tfoot","tr"]),nW=new Set(["td","th"]),EA="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function aW(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let a;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");a=dW(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");
vendor: 6,302 bytes, line 635
635if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");a=cW(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:a,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Uk:bH,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},r=AA(i,e,void 0);return r&&typeof r!="string"?r:i.create(e,i.Fragment,{children:r||void 0},void 0)}function AA(e,t,n){if(t.type==="element")return iW(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return rW(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return oW(e,t,n);if(t.type==="mdxjsEsm")return sW(e,t);if(t.type==="root")return lW(e,t,n);if(t.type==="text")return uW(e,t)}function iW(e,t,n){const a=e.schema;let i=a;t.tagName.toLowerCase()==="svg"&&a.space==="html"&&(i=Uk,e.schema=i),e.ancestors.push(t);const r=MA(e,t.tagName,!1),s=hW(e,t);let l=Gk(e,t);return tW.has(t.tagName)&&(l=l.filter(function(u){return typeof u=="string"?!hH(u):!0})),PA(e,s,r,t),qk(s,l),e.ancestors.pop(),e.schema=a,e.create(t,r,s,n)}function rW(e,t){if(t.data&&t.data.estree&&e.evaluater){const a=t.data.estree.body[0];return a.type,e.evaluater.evaluateExpression(a.expression)}mc(e,t.position)}function sW(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);mc(e,t.position)}function oW(e,t,n){const a=e.schema;let i=a;t.name==="svg"&&a.space==="html"&&(i=Uk,e.schema=i),e.ancestors.push(t);const r=t.name===null?e.Fragment:MA(e,t.name,!0),s=mW(e,t),l=Gk(e,t);return PA(e,s,r,t),qk(s,l),e.ancestors.pop(),e.schema=a,e.create(t,r,s,n)}function lW(e,t,n){const a={};return qk(a,Gk(e,t)),e.create(t,e.Fragment,a,n)}function uW(e,t){return t.value}function PA(e,t,n,a){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=a)}function qk(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function cW(e,t,n){return a;function a(i,r,s,l){const c=Array.isArray(s.children)?n:t;return l?c(r,s,l):c(r,s)}}function dW(e,t){return n;function n(a,i,r,s){const l=Array.isArray(r.children),u=Hk(a);return t(i,r,s,l,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function hW(e,t){const n={};let a,i;for(i in t.properties)if(i!=="children"&&Wk.call(t.properties,i)){const r=fW(e,i,t.properties[i]);if(r){const[s,l]=r;e.tableCellAlignToStyle&&s==="align"&&typeof l=="string"&&nW.has(t.tagName)?a=l:n[s]=l}}if(a){const r=n.style||(n.style={});r[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=a}return n}function mW(e,t){const n={};for(const a of t.attributes)if(a.type==="mdxJsxExpressionAttribute")if(a.data&&a.data.estree&&e.evaluater){const r=a.data.estree.body[0];r.type;const s=r.expression;s.type;const l=s.properties[0];l.type,Object.assign(n,e.evaluater.evaluateExpression(l.argument))}else mc(e,t.position);else{const i=a.name;let r;if(a.value&&typeof a.value=="object")if(a.value.data&&a.value.data.estree&&e.evaluater){const l=a.value.data.estree.body[0];l.type,r=e.evaluater.evaluateExpression(l.expression)}else mc(e,t.position);else r=a.value===null?!0:a.value;n[i]=r}return n}function Gk(e,t){const n=[];let a=-1;const i=e.passKeys?new Map:ZH;for(;++a<t.children.length;){const r=t.children[a];let s;if(e.passKeys){const u=r.type==="element"?r.tagName:r.type==="mdxJsxFlowElement"||r.type==="mdxJsxTextElement"?r.name:void 0;if(u){const c=i.get(u)||0;s=u+"-"+c,i.set(u,c+1)}}const l=AA(e,r,s);l!==void 0&&n.push(l)}return n}function fW(e,t,n){const a=xH(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=a.commaSeparated?oH(n):jH(n)),a.property==="style"){let i=typeof n=="object"?n:pW(e,String(n));return e.stylePropertyNameCase==="css"&&(i=gW(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&a.space?gH[a.property]||a.property:a.attribute,n]}}function pW(e,t){try{return QH(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const a=n,i=new rn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:a,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=EA+"#cannot-parse-style-attribute",i}}function MA(e,t,n){let a;if(!n)a={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let r=-1,s;for(;++r<i.length;){const l=H1(i[r])?{type:"Identifier",name:i[r]}:{type:"Literal",value:i[r]};s=s?{type:"MemberExpression",object:s,property:l,computed:!!(r&&l.type==="Literal"),optional:!1}:l}a=s}else a=H1(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(a.type==="Literal"){const i=a.value;return Wk.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(a);mc(e)}function mc(e,t){const n=new rn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=EA+"#cannot-handle-mdx-estrees-without-createevaluater",n}function gW(e){const t={};let n;for(n in e)Wk.call(e,n)&&(t[yW(n)]=e[n]);return t}function yW(e){let t=e.replace(eW,wW);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function wW(e){return"-"+e.toLowerCase()}const Fp={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},xW={};function kW(e,t){const n=xW,a=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return RA(e,a,i)}function RA(e,t,n){if(vW(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return nj(e.children,t,n)}return Array.isArray(e)?nj(e,t,n):""}function nj(e,t,n){const a=[];let i=-1;for(;++i<e.length;)a[i]=RA(e[i],t,n);return a.join("")}function vW(e){return!!(e&&typeof e=="object")}const aj=document.createElement("i");function Yk(e){const t="&"+e+";";aj.innerHTML=t;const n=aj.textContent;
vendor: 13,002 bytes, line 635
635return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function ui(e,t,n,a){const i=e.length;let r=0,s;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,a.length<1e4)s=Array.from(a),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);r<a.length;)s=a.slice(r,r+1e4),s.unshift(t,0),e.splice(...s),r+=1e4,t+=1e4}function ia(e,t){return e.length>0?(ui(e,e.length,0,t),e):t}const ij={}.hasOwnProperty;function bW(e){const t={};let n=-1;for(;++n<e.length;)jW(t,e[n]);return t}function jW(e,t){let n;for(n in t){const i=(ij.call(e,n)?e[n]:void 0)||(e[n]={}),r=t[n];let s;if(r)for(s in r){ij.call(i,s)||(i[s]=[]);const l=r[s];_W(i[s],Array.isArray(l)?l:l?[l]:[])}}}function _W(e,t){let n=-1;const a=[];for(;++n<t.length;)(t[n].add==="after"?e:a).push(t[n]);ui(e,0,0,a)}function IA(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Io(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ti=Lr(/[A-Za-z]/),$n=Lr(/[\dA-Za-z]/),SW=Lr(/[#-'*+\--9=?A-Z^-~]/);function sw(e){return e!==null&&(e<32||e===127)}const ow=Lr(/\d/),NW=Lr(/[\dA-Fa-f]/),CW=Lr(/[!-/:-@[-`{-~]/);function Te(e){return e!==null&&e<-2}function An(e){return e!==null&&(e<0||e===32)}function qe(e){return e===-2||e===-1||e===32}const TW=Lr(new RegExp("\\p{P}|\\p{S}","u")),EW=Lr(/\s/);function Lr(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function El(e){const t=[];let n=-1,a=0,i=0;for(;++n<e.length;){const r=e.charCodeAt(n);let s="";if(r===37&&$n(e.charCodeAt(n+1))&&$n(e.charCodeAt(n+2)))i=2;else if(r<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(r))||(s=String.fromCharCode(r));else if(r>55295&&r<57344){const l=e.charCodeAt(n+1);r<56320&&l>56319&&l<57344?(s=String.fromCharCode(r,l),i=1):s="�"}else s=String.fromCharCode(r);s&&(t.push(e.slice(a,n),encodeURIComponent(s)),a=n+i+1,s=""),i&&(n+=i,i=0)}return t.join("")+e.slice(a)}function rt(e,t,n,a){const i=a?a-1:Number.POSITIVE_INFINITY;let r=0;return s;function s(u){return qe(u)?(e.enter(n),l(u)):t(u)}function l(u){return qe(u)&&r++<i?(e.consume(u),l):(e.exit(n),t(u))}}const AW={tokenize:PW};function PW(e){const t=e.attempt(this.parser.constructs.contentInitial,a,i);let n;return t;function a(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),rt(e,t,"linePrefix")}function i(l){return e.enter("paragraph"),r(l)}function r(l){const u=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=u),n=u,s(l)}function s(l){if(l===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(l);return}return Te(l)?(e.consume(l),e.exit("chunkText"),r):(e.consume(l),s)}}const MW={tokenize:RW},rj={tokenize:IW};function RW(e){const t=this,n=[];let a=0,i,r,s;return l;function l(k){if(a<n.length){const j=n[a];return t.containerState=j[1],e.attempt(j[0].continuation,u,c)(k)}return c(k)}function u(k){if(a++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();const j=t.events.length;let S=j,_;for(;S--;)if(t.events[S][0]==="exit"&&t.events[S][1].type==="chunkFlow"){_=t.events[S][1].end;break}w(a);let T=j;for(;T<t.events.length;)t.events[T][1].end={..._},T++;return ui(t.events,S+1,0,t.events.slice(j)),t.events.length=T,c(k)}return l(k)}function c(k){if(a===n.length){if(!i)return m(k);if(i.currentConstruct&&i.currentConstruct.concrete)return y(k);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(rj,h,d)(k)}function h(k){return i&&v(),w(a),m(k)}function d(k){return t.parser.lazy[t.now().line]=a!==n.length,s=t.now().offset,y(k)}function m(k){return t.containerState={},e.attempt(rj,f,y)(k)}function f(k){return a++,n.push([t.currentConstruct,t.containerState]),m(k)}function y(k){if(k===null){i&&v(),w(0),e.consume(k);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:r}),g(k)}function g(k){if(k===null){x(e.exit("chunkFlow"),!0),w(0),e.consume(k);return}return Te(k)?(e.consume(k),x(e.exit("chunkFlow")),a=0,t.interrupt=void 0,l):(e.consume(k),g)}function x(k,j){const S=t.sliceStream(k);if(j&&S.push(null),k.previous=r,r&&(r.next=k),r=k,i.defineSkip(k.start),i.write(S),t.parser.lazy[k.start.line]){let _=i.events.length;for(;_--;)if(i.events[_][1].start.offset<s&&(!i.events[_][1].end||i.events[_][1].end.offset>s))return;const T=t.events.length;let E=T,O,A;for(;E--;)if(t.events[E][0]==="exit"&&t.events[E][1].type==="chunkFlow"){if(O){A=t.events[E][1].end;break}O=!0}for(w(a),_=T;_<t.events.length;)t.events[_][1].end={...A},_++;ui(t.events,E+1,0,t.events.slice(T)),t.events.length=_}}function w(k){let j=n.length;for(;j-- >k;){const S=n[j];t.containerState=S[1],S[0].exit.call(t,e)}n.length=k}function v(){i.write([null]),r=void 0,i=void 0,t.containerState._closeFlow=void 0}}function IW(e,t,n){return rt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function sj(e){if(e===null||An(e)||EW(e))return 1;if(TW(e))return 2}function Jk(e,t,n){const a=[];let i=-1;for(;++i<e.length;){const r=e[i].resolveAll;r&&!a.includes(r)&&(t=r(t,n),a.push(r))}return t}const lw={name:"attention",resolveAll:OW,tokenize:LW};function OW(e,t){let n=-1,a,i,r,s,l,u,c,h;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(a=n;a--;)if(e[a][0]==="exit"&&e[a][1].type==="attentionSequence"&&e[a][1]._open&&t.sliceSerialize(e[a][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[a][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[a][1].end.offset-e[a][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;u=e[a][1].end.offset-e[a][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const d={...e[a][1].end},m={...e[n][1].start};oj(d,-u),oj(m,u),s={type:u>1?"strongSequence":"emphasisSequence",start:d,end:{...e[a][1].end}},l={type:u>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:m},r={type:u>1?"strongText":"emphasisText",start:{...e[a][1].end},end:{...e[n][1].start}},i={type:u>1?"strong":"emphasis",start:{...s.start},end:{...l.end}},e[a][1].end={...s.start},e[n][1].start={...l.end},c=[],e[a][1].end.offset-e[a][1].start.offset&&(c=ia(c,[["enter",e[a][1],t],["exit",e[a][1],t]])),c=ia(c,[["enter",i,t],["enter",s,t],["exit",s,t],["enter",r,t]]),c=ia(c,Jk(t.parser.constructs.insideSpan.null,e.slice(a+1,n),t)),c=ia(c,[["exit",r,t],["enter",l,t],["exit",l,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(h=2,c=ia(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):h=0,ui(e,a-1,n-a+3,c),n=a+c.length-h-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function LW(e,t){const n=this.parser.constructs.attentionMarkers.null,a=this.previous,i=sj(a);let r;return s;function s(u){return r=u,e.enter("attentionSequence"),l(u)}function l(u){if(u===r)return e.consume(u),l;const c=e.exit("attentionSequence"),h=sj(u),d=!h||h===2&&i||n.includes(u),m=!i||i===2&&h||n.includes(a);return c._open=!!(r===42?d:d&&(i||!m)),c._close=!!(r===42?m:m&&(h||!d)),t(u)}}function oj(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const DW={name:"autolink",tokenize:zW};function zW(e,t,n){let a=0;return i;function i(f){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),r}function r(f){return ti(f)?(e.consume(f),s):f===64?n(f):c(f)}function s(f){return f===43||f===45||f===46||$n(f)?(a=1,l(f)):c(f)}function l(f){return f===58?(e.consume(f),a=0,u):(f===43||f===45||f===46||$n(f))&&a++<32?(e.consume(f),l):(a=0,c(f))}function u(f){return f===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),t):f===null||f===32||f===60||sw(f)?n(f):(e.consume(f),u)}function c(f){return f===64?(e.consume(f),h):SW(f)?(e.consume(f),c):n(f)}function h(f){return $n(f)?d(f):n(f)}function d(f){return f===46?(e.consume(f),a=0,h):f===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),t):m(f)}function m(f){if((f===45||$n(f))&&a++<63){const y=f===45?m:d;return e.consume(f),y}return n(f)}}const kf={partial:!0,tokenize:FW};function FW(e,t,n){return a;function a(r){return qe(r)?rt(e,i,"linePrefix")(r):i(r)}function i(r){return r===null||Te(r)?t(r):n(r)}}const OA={continuation:{tokenize:KW},exit:$W,name:"blockQuote",tokenize:BW};function BW(e,t,n){const a=this;return i;function i(s){if(s===62){const l=a.containerState;return l.open||(e.enter("blockQuote",{_container:!0}),l.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),r}return n(s)}function r(s){return qe(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function KW(e,t,n){const a=this;return i;function i(s){return qe(s)?rt(e,r,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):r(s)}function r(s){return e.attempt(OA,t,n)(s)}}function $W(e){e.exit("blockQuote")}const LA={name:"characterEscape",tokenize:UW};function UW(e,t,n){return a;function a(r){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(r),e.exit("escapeMarker"),i}function i(r){return CW(r)?(e.enter("characterEscapeValue"),e.consume(r),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(r)}}const DA={name:"characterReference",tokenize:VW};function VW(e,t,n){const a=this;let i=0,r,s;return l;function l(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),u}function u(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),r=31,s=$n,h(d))}function c(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),r=6,s=NW,h):(e.enter("characterReferenceValue"),r=7,s=ow,h(d))}function h(d){if(d===59&&i){const m=e.exit("characterReferenceValue");return s===$n&&!Yk(a.sliceSerialize(m))?n(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(d)&&i++<r?(e.consume(d),h):n(d)}}const lj={partial:!0,tokenize:WW},uj={concrete:!0,name:"codeFenced",tokenize:HW};function HW(e,t,n){const a=this,i={partial:!0,tokenize:S};let r=0,s=0,l;return u;function u(_){return c(_)}function c(_){const T=a.events[a.events.length-1];return r=T&&T[1].type==="linePrefix"?T[2].sliceSerialize(T[1],!0).length:0,l=_,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),h(_)}function h(_){return _===l?(s++,e.consume(_),h):s<3?n(_):(e.exit("codeFencedFenceSequence"),qe(_)?rt(e,d,"whitespace")(_):d(_))}function d(_){return _===null||Te(_)?(e.exit("codeFencedFence"),a.interrupt?t(_):e.check(lj,g,j)(_)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),m(_))}function m(_){return _===null||Te(_)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(_)):qe(_)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),rt(e,f,"whitespace")(_)):_===96&&_===l?n(_):(e.consume(_),m)}function f(_){return _===null||Te(_)?d(_):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),y(_))}function y(_){return _===null||Te(_)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(_)):_===96&&_===l?n(_):(e.consume(_),y)}function g(_){return e.attempt(i,j,x)(_)}function x(_){return e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),w}function w(_){return r>0&&qe(_)?rt(e,v,"linePrefix",r+1)(_):v(_)}function v(_){return _===null||Te(_)?e.check(lj,g,j)(_):(e.enter("codeFlowValue"),k(_))}function k(_){return _===null||Te(_)?(e.exit("codeFlowValue"),v(_)):(e.consume(_),k)}function j(_){return e.exit("codeFenced"),t(_)}function S(_,T,E){let O=0;return A;function A(z){return _.enter("lineEnding"),_.consume(z),_.exit("lineEnding"),R}function R(z){return _.enter("codeFencedFence"),qe(z)?rt(_,F,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z):F(z)}function F(z){return z===l?(_.enter("codeFencedFenceSequence"),Y(z)):E(z)}function Y(z){return z===l?(O++,_.consume(z),Y):O>=s?(_.exit("codeFencedFenceSequence"),qe(z)?rt(_,V,"whitespace")(z):V(z)):E(z)}function V(z){return z===null||Te(z)?(_.exit("codeFencedFence"),T(z)):E(z)}}}function WW(e,t,n){const a=this;return i;function i(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),r)}function r(s){return a.parser.lazy[a.now().line]?n(s):t(s)}}const Bp={name:"codeIndented",tokenize:GW},qW={partial:!0,tokenize:YW};function GW(e,t,n){const a=this;return i;
vendor: 11,224 bytes, line 635
635function i(c){return e.enter("codeIndented"),rt(e,r,"linePrefix",5)(c)}function r(c){const h=a.events[a.events.length-1];return h&&h[1].type==="linePrefix"&&h[2].sliceSerialize(h[1],!0).length>=4?s(c):n(c)}function s(c){return c===null?u(c):Te(c)?e.attempt(qW,s,u)(c):(e.enter("codeFlowValue"),l(c))}function l(c){return c===null||Te(c)?(e.exit("codeFlowValue"),s(c)):(e.consume(c),l)}function u(c){return e.exit("codeIndented"),t(c)}}function YW(e,t,n){const a=this;return i;function i(s){return a.parser.lazy[a.now().line]?n(s):Te(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):rt(e,r,"linePrefix",5)(s)}function r(s){const l=a.events[a.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(s):Te(s)?i(s):n(s)}}const JW={name:"codeText",previous:XW,resolve:QW,tokenize:ZW};function QW(e){let t=e.length-4,n=3,a,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(a=n;++a<t;)if(e[a][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(a=n-1,t++;++a<=t;)i===void 0?a!==t&&e[a][1].type!=="lineEnding"&&(i=a):(a===t||e[a][1].type==="lineEnding")&&(e[i][1].type="codeTextData",a!==i+2&&(e[i][1].end=e[a-1][1].end,e.splice(i+2,a-i-2),t-=a-i-2,a=i+2),i=void 0);return e}function XW(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function ZW(e,t,n){let a=0,i,r;return s;function s(d){return e.enter("codeText"),e.enter("codeTextSequence"),l(d)}function l(d){return d===96?(e.consume(d),a++,l):(e.exit("codeTextSequence"),u(d))}function u(d){return d===null?n(d):d===32?(e.enter("space"),e.consume(d),e.exit("space"),u):d===96?(r=e.enter("codeTextSequence"),i=0,h(d)):Te(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),u):(e.enter("codeTextData"),c(d))}function c(d){return d===null||d===32||d===96||Te(d)?(e.exit("codeTextData"),u(d)):(e.consume(d),c)}function h(d){return d===96?(e.consume(d),i++,h):i===a?(e.exit("codeTextSequence"),e.exit("codeText"),t(d)):(r.type="codeTextData",c(d))}}class e9{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const a=n??Number.POSITIVE_INFINITY;return a<this.left.length?this.left.slice(t,a):t>this.left.length?this.right.slice(this.right.length-a+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-a+this.left.length).reverse())}splice(t,n,a){const i=n||0;this.setCursor(Math.trunc(t));const r=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return a&&ql(this.left,a),r.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),ql(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),ql(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);ql(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);ql(this.left,n.reverse())}}}function ql(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function zA(e){const t={};let n=-1,a,i,r,s,l,u,c;const h=new e9(e);for(;++n<h.length;){for(;n in t;)n=t[n];if(a=h.get(n),n&&a[1].type==="chunkFlow"&&h.get(n-1)[1].type==="listItemPrefix"&&(u=a[1]._tokenizer.events,r=0,r<u.length&&u[r][1].type==="lineEndingBlank"&&(r+=2),r<u.length&&u[r][1].type==="content"))for(;++r<u.length&&u[r][1].type!=="content";)u[r][1].type==="chunkText"&&(u[r][1]._isInFirstContentOfListItem=!0,r++);if(a[0]==="enter")a[1].contentType&&(Object.assign(t,t9(h,n)),n=t[n],c=!0);else if(a[1]._container){for(r=n,i=void 0;r--;)if(s=h.get(r),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(i&&(h.get(i)[1].type="lineEndingBlank"),s[1].type="lineEnding",i=r);else if(!(s[1].type==="linePrefix"||s[1].type==="listItemIndent"))break;i&&(a[1].end={...h.get(i)[1].start},l=h.slice(i,n),l.unshift(a),h.splice(i,n-i+1,l))}}return ui(e,0,Number.POSITIVE_INFINITY,h.slice(0)),!c}function t9(e,t){const n=e.get(t)[1],a=e.get(t)[2];let i=t-1;const r=[];let s=n._tokenizer;s||(s=a.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));const l=s.events,u=[],c={};let h,d,m=-1,f=n,y=0,g=0;const x=[g];for(;f;){for(;e.get(++i)[1]!==f;);r.push(i),f._tokenizer||(h=a.sliceStream(f),f.next||h.push(null),d&&s.defineSkip(f.start),f._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(h),f._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),d=f,f=f.next}for(f=n;++m<l.length;)l[m][0]==="exit"&&l[m-1][0]==="enter"&&l[m][1].type===l[m-1][1].type&&l[m][1].start.line!==l[m][1].end.line&&(g=m+1,x.push(g),f._tokenizer=void 0,f.previous=void 0,f=f.next);for(s.events=[],f?(f._tokenizer=void 0,f.previous=void 0):x.pop(),m=x.length;m--;){const w=l.slice(x[m],x[m+1]),v=r.pop();u.push([v,v+w.length-1]),e.splice(v,2,w)}for(u.reverse(),m=-1;++m<u.length;)c[y+u[m][0]]=y+u[m][1],y+=u[m][1]-u[m][0]-1;return c}const n9={resolve:i9,tokenize:r9},a9={partial:!0,tokenize:s9};function i9(e){return zA(e),e}function r9(e,t){let n;return a;function a(l){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(l)}function i(l){return l===null?r(l):Te(l)?e.check(a9,s,r)(l):(e.consume(l),i)}function r(l){return e.exit("chunkContent"),e.exit("content"),t(l)}function s(l){return e.consume(l),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function s9(e,t,n){const a=this;return i;function i(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),rt(e,r,"linePrefix")}function r(s){if(s===null||Te(s))return n(s);const l=a.events[a.events.length-1];return!a.parser.constructs.disable.null.includes("codeIndented")&&l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(s):e.interrupt(a.parser.constructs.flow,n,t)(s)}}function FA(e,t,n,a,i,r,s,l,u){const c=u||Number.POSITIVE_INFINITY;let h=0;return d;function d(w){return w===60?(e.enter(a),e.enter(i),e.enter(r),e.consume(w),e.exit(r),m):w===null||w===32||w===41||sw(w)?n(w):(e.enter(a),e.enter(s),e.enter(l),e.enter("chunkString",{contentType:"string"}),g(w))}function m(w){return w===62?(e.enter(r),e.consume(w),e.exit(r),e.exit(i),e.exit(a),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),f(w))}function f(w){return w===62?(e.exit("chunkString"),e.exit(l),m(w)):w===null||w===60||Te(w)?n(w):(e.consume(w),w===92?y:f)}function y(w){return w===60||w===62||w===92?(e.consume(w),f):f(w)}function g(w){return!h&&(w===null||w===41||An(w))?(e.exit("chunkString"),e.exit(l),e.exit(s),e.exit(a),t(w)):h<c&&w===40?(e.consume(w),h++,g):w===41?(e.consume(w),h--,g):w===null||w===32||w===40||sw(w)?n(w):(e.consume(w),w===92?x:g)}function x(w){return w===40||w===41||w===92?(e.consume(w),g):g(w)}}function BA(e,t,n,a,i,r){const s=this;let l=0,u;return c;function c(f){return e.enter(a),e.enter(i),e.consume(f),e.exit(i),e.enter(r),h}function h(f){return l>999||f===null||f===91||f===93&&!u||f===94&&!l&&"_hiddenFootnoteSupport"in s.parser.constructs?n(f):f===93?(e.exit(r),e.enter(i),e.consume(f),e.exit(i),e.exit(a),t):Te(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),h):(e.enter("chunkString",{contentType:"string"}),d(f))}function d(f){return f===null||f===91||f===93||Te(f)||l++>999?(e.exit("chunkString"),h(f)):(e.consume(f),u||(u=!qe(f)),f===92?m:d)}function m(f){return f===91||f===92||f===93?(e.consume(f),l++,d):d(f)}}function KA(e,t,n,a,i,r){let s;return l;function l(m){return m===34||m===39||m===40?(e.enter(a),e.enter(i),e.consume(m),e.exit(i),s=m===40?41:m,u):n(m)}function u(m){return m===s?(e.enter(i),e.consume(m),e.exit(i),e.exit(a),t):(e.enter(r),c(m))}function c(m){return m===s?(e.exit(r),u(s)):m===null?n(m):Te(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),rt(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),h(m))}function h(m){return m===s||m===null||Te(m)?(e.exit("chunkString"),c(m)):(e.consume(m),m===92?d:h)}function d(m){return m===s||m===92?(e.consume(m),h):h(m)}}function Cu(e,t){let n;return a;function a(i){return Te(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,a):qe(i)?rt(e,a,n?"linePrefix":"lineSuffix")(i):t(i)}}const o9={name:"definition",tokenize:u9},l9={partial:!0,tokenize:c9};function u9(e,t,n){const a=this;let i;return r;function r(f){return e.enter("definition"),s(f)}function s(f){return BA.call(a,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(f)}function l(f){return i=Io(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)),f===58?(e.enter("definitionMarker"),e.consume(f),e.exit("definitionMarker"),u):n(f)}function u(f){return An(f)?Cu(e,c)(f):c(f)}function c(f){return FA(e,h,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(f)}function h(f){return e.attempt(l9,d,d)(f)}function d(f){return qe(f)?rt(e,m,"whitespace")(f):m(f)}function m(f){return f===null||Te(f)?(e.exit("definition"),a.parser.defined.push(i),t(f)):n(f)}}function c9(e,t,n){return a;function a(l){return An(l)?Cu(e,i)(l):n(l)}function i(l){return KA(e,r,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function r(l){return qe(l)?rt(e,s,"whitespace")(l):s(l)}function s(l){return l===null||Te(l)?t(l):n(l)}}const d9={name:"hardBreakEscape",tokenize:h9};function h9(e,t,n){return a;function a(r){return e.enter("hardBreakEscape"),e.consume(r),i}function i(r){return Te(r)?(e.exit("hardBreakEscape"),t(r)):n(r)}}const m9={name:"headingAtx",resolve:f9,tokenize:p9};function f9(e,t){let n=e.length-2,a=3,i,r;return e[a][1].type==="whitespace"&&(a+=2),n-2>a&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(a===n-1||n-4>a&&e[n-2][1].type==="whitespace")&&(n-=a+1===n?2:4),n>a&&(i={type:"atxHeadingText",start:e[a][1].start,end:e[n][1].end},r={type:"chunkText",start:e[a][1].start,end:e[n][1].end,contentType:"text"},ui(e,a,n-a+1,[["enter",i,t],["enter",r,t],["exit",r,t],["exit",i,t]])),e}function p9(e,t,n){let a=0;return i;function i(h){return e.enter("atxHeading"),r(h)}function r(h){return e.enter("atxHeadingSequence"),s(h)}function s(h){return h===35&&a++<6?(e.consume(h),s):h===null||An(h)?(e.exit("atxHeadingSequence"),l(h)):n(h)}function l(h){return h===35?(e.enter("atxHeadingSequence"),u(h)):h===null||Te(h)?(e.exit("atxHeading"),t(h)):qe(h)?rt(e,l,"whitespace")(h):(e.enter("atxHeadingText"),c(
vendor: 16,553 bytes, line 635
635h))}function u(h){return h===35?(e.consume(h),u):(e.exit("atxHeadingSequence"),l(h))}function c(h){return h===null||h===35||An(h)?(e.exit("atxHeadingText"),l(h)):(e.consume(h),c)}}const g9=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],cj=["pre","script","style","textarea"],y9={concrete:!0,name:"htmlFlow",resolveTo:k9,tokenize:v9},w9={partial:!0,tokenize:j9},x9={partial:!0,tokenize:b9};function k9(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function v9(e,t,n){const a=this;let i,r,s,l,u;return c;function c(N){return h(N)}function h(N){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(N),d}function d(N){return N===33?(e.consume(N),m):N===47?(e.consume(N),r=!0,g):N===63?(e.consume(N),i=3,a.interrupt?t:b):ti(N)?(e.consume(N),s=String.fromCharCode(N),x):n(N)}function m(N){return N===45?(e.consume(N),i=2,f):N===91?(e.consume(N),i=5,l=0,y):ti(N)?(e.consume(N),i=4,a.interrupt?t:b):n(N)}function f(N){return N===45?(e.consume(N),a.interrupt?t:b):n(N)}function y(N){const J="CDATA[";return N===J.charCodeAt(l++)?(e.consume(N),l===J.length?a.interrupt?t:F:y):n(N)}function g(N){return ti(N)?(e.consume(N),s=String.fromCharCode(N),x):n(N)}function x(N){if(N===null||N===47||N===62||An(N)){const J=N===47,re=s.toLowerCase();return!J&&!r&&cj.includes(re)?(i=1,a.interrupt?t(N):F(N)):g9.includes(s.toLowerCase())?(i=6,J?(e.consume(N),w):a.interrupt?t(N):F(N)):(i=7,a.interrupt&&!a.parser.lazy[a.now().line]?n(N):r?v(N):k(N))}return N===45||$n(N)?(e.consume(N),s+=String.fromCharCode(N),x):n(N)}function w(N){return N===62?(e.consume(N),a.interrupt?t:F):n(N)}function v(N){return qe(N)?(e.consume(N),v):A(N)}function k(N){return N===47?(e.consume(N),A):N===58||N===95||ti(N)?(e.consume(N),j):qe(N)?(e.consume(N),k):A(N)}function j(N){return N===45||N===46||N===58||N===95||$n(N)?(e.consume(N),j):S(N)}function S(N){return N===61?(e.consume(N),_):qe(N)?(e.consume(N),S):k(N)}function _(N){return N===null||N===60||N===61||N===62||N===96?n(N):N===34||N===39?(e.consume(N),u=N,T):qe(N)?(e.consume(N),_):E(N)}function T(N){return N===u?(e.consume(N),u=null,O):N===null||Te(N)?n(N):(e.consume(N),T)}function E(N){return N===null||N===34||N===39||N===47||N===60||N===61||N===62||N===96||An(N)?S(N):(e.consume(N),E)}function O(N){return N===47||N===62||qe(N)?k(N):n(N)}function A(N){return N===62?(e.consume(N),R):n(N)}function R(N){return N===null||Te(N)?F(N):qe(N)?(e.consume(N),R):n(N)}function F(N){return N===45&&i===2?(e.consume(N),W):N===60&&i===1?(e.consume(N),B):N===62&&i===4?(e.consume(N),C):N===63&&i===3?(e.consume(N),b):N===93&&i===5?(e.consume(N),I):Te(N)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(w9,D,Y)(N)):N===null||Te(N)?(e.exit("htmlFlowData"),Y(N)):(e.consume(N),F)}function Y(N){return e.check(x9,V,D)(N)}function V(N){return e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),z}function z(N){return N===null||Te(N)?Y(N):(e.enter("htmlFlowData"),F(N))}function W(N){return N===45?(e.consume(N),b):F(N)}function B(N){return N===47?(e.consume(N),s="",M):F(N)}function M(N){if(N===62){const J=s.toLowerCase();return cj.includes(J)?(e.consume(N),C):F(N)}return ti(N)&&s.length<8?(e.consume(N),s+=String.fromCharCode(N),M):F(N)}function I(N){return N===93?(e.consume(N),b):F(N)}function b(N){return N===62?(e.consume(N),C):N===45&&i===2?(e.consume(N),b):F(N)}function C(N){return N===null||Te(N)?(e.exit("htmlFlowData"),D(N)):(e.consume(N),C)}function D(N){return e.exit("htmlFlow"),t(N)}}function b9(e,t,n){const a=this;return i;function i(s){return Te(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),r):n(s)}function r(s){return a.parser.lazy[a.now().line]?n(s):t(s)}}function j9(e,t,n){return a;function a(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(kf,t,n)}}const _9={name:"htmlText",tokenize:S9};function S9(e,t,n){const a=this;let i,r,s;return l;function l(b){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(b),u}function u(b){return b===33?(e.consume(b),c):b===47?(e.consume(b),S):b===63?(e.consume(b),k):ti(b)?(e.consume(b),E):n(b)}function c(b){return b===45?(e.consume(b),h):b===91?(e.consume(b),r=0,y):ti(b)?(e.consume(b),v):n(b)}function h(b){return b===45?(e.consume(b),f):n(b)}function d(b){return b===null?n(b):b===45?(e.consume(b),m):Te(b)?(s=d,B(b)):(e.consume(b),d)}function m(b){return b===45?(e.consume(b),f):d(b)}function f(b){return b===62?W(b):b===45?m(b):d(b)}function y(b){const C="CDATA[";return b===C.charCodeAt(r++)?(e.consume(b),r===C.length?g:y):n(b)}function g(b){return b===null?n(b):b===93?(e.consume(b),x):Te(b)?(s=g,B(b)):(e.consume(b),g)}function x(b){return b===93?(e.consume(b),w):g(b)}function w(b){return b===62?W(b):b===93?(e.consume(b),w):g(b)}function v(b){return b===null||b===62?W(b):Te(b)?(s=v,B(b)):(e.consume(b),v)}function k(b){return b===null?n(b):b===63?(e.consume(b),j):Te(b)?(s=k,B(b)):(e.consume(b),k)}function j(b){return b===62?W(b):k(b)}function S(b){return ti(b)?(e.consume(b),_):n(b)}function _(b){return b===45||$n(b)?(e.consume(b),_):T(b)}function T(b){return Te(b)?(s=T,B(b)):qe(b)?(e.consume(b),T):W(b)}function E(b){return b===45||$n(b)?(e.consume(b),E):b===47||b===62||An(b)?O(b):n(b)}function O(b){return b===47?(e.consume(b),W):b===58||b===95||ti(b)?(e.consume(b),A):Te(b)?(s=O,B(b)):qe(b)?(e.consume(b),O):W(b)}function A(b){return b===45||b===46||b===58||b===95||$n(b)?(e.consume(b),A):R(b)}function R(b){return b===61?(e.consume(b),F):Te(b)?(s=R,B(b)):qe(b)?(e.consume(b),R):O(b)}function F(b){return b===null||b===60||b===61||b===62||b===96?n(b):b===34||b===39?(e.consume(b),i=b,Y):Te(b)?(s=F,B(b)):qe(b)?(e.consume(b),F):(e.consume(b),V)}function Y(b){return b===i?(e.consume(b),i=void 0,z):b===null?n(b):Te(b)?(s=Y,B(b)):(e.consume(b),Y)}function V(b){return b===null||b===34||b===39||b===60||b===61||b===96?n(b):b===47||b===62||An(b)?O(b):(e.consume(b),V)}function z(b){return b===47||b===62||An(b)?O(b):n(b)}function W(b){return b===62?(e.consume(b),e.exit("htmlTextData"),e.exit("htmlText"),t):n(b)}function B(b){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),M}function M(b){return qe(b)?rt(e,I,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(b):I(b)}function I(b){return e.enter("htmlTextData"),s(b)}}const Qk={name:"labelEnd",resolveAll:E9,resolveTo:A9,tokenize:P9},N9={tokenize:M9},C9={tokenize:R9},T9={tokenize:I9};function E9(e){let t=-1;const n=[];for(;++t<e.length;){const a=e[t][1];if(n.push(e[t]),a.type==="labelImage"||a.type==="labelLink"||a.type==="labelEnd"){const i=a.type==="labelImage"?4:2;a.type="data",t+=i}}return e.length!==n.length&&ui(e,0,e.length,n),e}function A9(e,t){let n=e.length,a=0,i,r,s,l;for(;n--;)if(i=e[n][1],r){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(r=n,i.type!=="labelLink")){a=2;break}}else i.type==="labelEnd"&&(s=n);const u={type:e[r][1].type==="labelLink"?"link":"image",start:{...e[r][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[r][1].start},end:{...e[s][1].end}},h={type:"labelText",start:{...e[r+a+2][1].end},end:{...e[s-2][1].start}};return l=[["enter",u,t],["enter",c,t]],l=ia(l,e.slice(r+1,r+a+3)),l=ia(l,[["enter",h,t]]),l=ia(l,Jk(t.parser.constructs.insideSpan.null,e.slice(r+a+4,s-3),t)),l=ia(l,[["exit",h,t],e[s-2],e[s-1],["exit",c,t]]),l=ia(l,e.slice(s+1)),l=ia(l,[["exit",u,t]]),ui(e,r,e.length,l),e}function P9(e,t,n){const a=this;let i=a.events.length,r,s;for(;i--;)if((a.events[i][1].type==="labelImage"||a.events[i][1].type==="labelLink")&&!a.events[i][1]._balanced){r=a.events[i][1];break}return l;function l(m){return r?r._inactive?d(m):(s=a.parser.defined.includes(Io(a.sliceSerialize({start:r.end,end:a.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(m),e.exit("labelMarker"),e.exit("labelEnd"),u):n(m)}function u(m){return m===40?e.attempt(N9,h,s?h:d)(m):m===91?e.attempt(C9,h,s?c:d)(m):s?h(m):d(m)}function c(m){return e.attempt(T9,h,d)(m)}function h(m){return t(m)}function d(m){return r._balanced=!0,n(m)}}function M9(e,t,n){return a;function a(d){return e.enter("resource"),e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),i}function i(d){return An(d)?Cu(e,r)(d):r(d)}function r(d){return d===41?h(d):FA(e,s,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function s(d){return An(d)?Cu(e,u)(d):h(d)}function l(d){return n(d)}function u(d){return d===34||d===39||d===40?KA(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):h(d)}function c(d){return An(d)?Cu(e,h)(d):h(d)}function h(d){return d===41?(e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),e.exit("resource"),t):n(d)}}function R9(e,t,n){const a=this;return i;function i(l){return BA.call(a,e,r,s,"reference","referenceMarker","referenceString")(l)}function r(l){return a.parser.defined.includes(Io(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)))?t(l):n(l)}function s(l){return n(l)}}function I9(e,t,n){return a;function a(r){return e.enter("reference"),e.enter("referenceMarker"),e.consume(r),e.exit("referenceMarker"),i}function i(r){return r===93?(e.enter("referenceMarker"),e.consume(r),e.exit("referenceMarker"),e.exit("reference"),t):n(r)}}const O9={name:"labelStartImage",resolveAll:Qk.resolveAll,tokenize:L9};function L9(e,t,n){const a=this;return i;function i(l){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(l),e.exit("labelImageMarker"),r}function r(l){return l===91?(e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelImage"),s):n(l)}function s(l){return l===94&&"_hiddenFootnoteSupport"in a.parser.constructs?n(l):t(l)}}const D9={name:"labelStartLink",resolveAll:Qk.resolveAll,tokenize:z9};function z9(e,t,n){const a=this;return i;function i(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),r}function r(s){return s===94&&"_hiddenFootnoteSupport"in a.parser.constructs?n(s):t(s)}}const Kp={name:"lineEnding",tokenize:F9};function F9(e,t){return n;function n(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),rt(e,t,"linePrefix")}}const fh={name:"thematicBreak",tokenize:B9};function B9(e,t,n){let a=0,i;return r;function r(c){return e.enter("thematicBreak"),s(c)}function s(c){return i=c,l(c)}function l(c){return c===i?(e.enter("thematicBreakSequence"),u(c)):a>=3&&(c===null||Te(c))?(e.exit("thematicBreak"),t(c)):n(c)}function u(c){return c===i?(e.consume(c),a++,u):(e.exit("thematicBreakSequence"),qe(c)?rt(e,l,"whitespace")(c):l(c))}}const kn={continuation:{tokenize:V9},exit:W9,name:"list",tokenize:U9},K9={partial:!0,tokenize:q9},$9={partial:!0,tokenize:H9};function U9(e,t,n){const a=this,i=a.events[a.events.length-1];let r=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return l;function l(f){const y=a.containerState.type||(f===42||f===43||f===45?"listUnordered":"listOrdered");if(y==="listUnordered"?!a.containerState.marker||f===a.containerState.marker:ow(f)){if(a.containerState.type||(a.containerState.type=y,e.enter(y,{_container:!0})),y==="listUnordered")return e.enter("listItemPrefix"),f===42||f===45?e.check(fh,n,c)(f):c(f);if(!a.interrupt||f===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(f)}return n(f)}function u(f){return ow(f)&&++s<10?(e.consume(f),u):(!a.interrupt||s<2)&&(a.containerState.marker?f===a.containerState.marker:f===41||f===46)?(e.exit("listItemValue"),c(f)):n(f)}function c(f){return e.enter("listItemMarker"),e.consume(f),e.exit("listItemMarker"),a.containerState.marker=a.containerState.marker||f,e.check(kf,a.interrupt?n:h,e.attempt(K9,m,d))}function h(f){return a.containerState.initialBlankLine=!0,r++,m(f)}function d(f){return qe(f)?(e.enter("listItemPrefixWhitespace"),e.consume(f),e.exit("listItemPrefixWhitespace"),m):n(f)}function m(f){return a.containerState.size=r+a.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(f)}}function V9(e,t,n){const a=this;return a.containerState._closeFlow=void 0,e.check(kf,i,r);function i(l){return a.containerState.furtherBlankLines=a.containerState.furtherBlankLines||a.containerState.initialBlankLine,rt(e,t,"listItemIndent",a.containerState.size+1)(l)}function r(l){return a.containerState.furtherBlankLines||!qe(l)?(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,s(l)):(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,e.attempt($9,t,s)(l))}function s(l){return a.containerState._closeFlow=!0,a.interrupt=void 0,rt(e,e.attempt(kn,t,n),"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function H9(e,t,n){const a=this;return rt(e,i,"listItemIndent",a.containerState.size+1);function i(r){const s=a.events[a.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===a.containerState.size?t(r):n(r)}}function W9(e){e.exit(this.containerState.type)}function q9(e,t,n){const a=this;return rt(e,i,"listItemPrefixWhitespace",a.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(r){const s=a.events[a.events.length-1];return!qe(r)&&s&&s[1].type==="listItemPrefixWhitespace"?t(r):n(r)}}const dj={name:"setextUnderline",resolveTo:G9,tokenize:Y9};function G9(e,t){let n=e.length,a,i,r;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){a=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!r&&e[n][1].type==="definition"&&(r=n);const s={type:"setextHeading",start:{...e[a][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",r?(e.splice(i,0,["enter",s,t]),e.splice(r+1,0,["exit",e[a][1],t]),e[a][1].end={...e[r][1].end}):e[a][1]=s,e.push(["exit",s,t]),e}function Y9(e,t,n){const a=this;let i;return r;function r(c){let h=a.events.length,d;for(;h--;)if(a.events[h][1].type!=="lineEnding"&&a.events[h][1].type!=="linePrefix"&&a.events[h][1].type!=="content"){d=a.events[h][1].type==="paragraph";break}return!a.parser.lazy[a.now().line]&&(a.interrupt||d)?(e.enter("setextHeadingLine"),i=c,s(c)):n(c)}function s(c){return e.enter("setextHeadingLineSequence"),l(c)}function l(c){return c===i?(e.consume(c),l):(e.exit("setextHeadingLineSequence"),qe(c)?rt(e,u,"lineSuffix")(c):u(c))}function u(c){return c===null||Te(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const J9={tokenize:Q9};function Q9(e){const t=this,n=e.attempt(kf,a,e.attempt(this.parser.constructs.flowInitial,i,rt(e,e.attempt(this.parser.constructs.flow,i,e.attempt(n9,i)),"linePrefix")));return n;function a(r){if(r===null){e.consume(r);return}return e.enter("lineEndingBlank"),e.consume(r),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const X9={resolveAll:UA()},Z9=$A("string"),e7=$A("text");function $A(e){return{resolveAll:UA(e==="text"?t7:void 0),tokenize:t};function t(n){const a=this,i=this.parser.constructs[e],r=n.attempt(i,s,l);return s;function s(h){return c(h)?r(h):l(h)}function l(h){if(h===null){n.consume(h);return}return n.enter("data"),n.consume(h),u}function u(h){return c(h)?(n.exit("data"),r(h)):(n.consume(h),u)}function c(h){if(h===null)return!0;const d=i[h];let m=-1;if(d)for(;++m<d.length;){const f=d[m];if(!f.previous||f.previous.call(a,a.previous))return!0}return!1}}}function UA(e){return t;function t(n,a){let i=-1,r;for(;++i<=n.length;)r===void 0?n[i]&&n[i][1].type==="data"&&(r=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==r+2&&(n[r][1].end=n[i-1][1].end,n.splice(r+2,i-r-2),i=r+2),r=void 0);return e?e(n,a):n}}function t7(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const a=e[n-1][1],i=t.sliceStream(a);let r=i.length,s=-1,l=0,u;
vendor: 5,322 bytes, lines 635-637
635for(;r--;){const c=i[r];if(typeof c=="string"){for(s=c.length;c.charCodeAt(s-1)===32;)l++,s--;if(s)break;s=-1}else if(c===-2)u=!0,l++;else if(c!==-1){r++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(l=0),l){const c={type:n===e.length||u||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:r?s:a.start._bufferIndex+s,_index:a.start._index+r,line:a.end.line,column:a.end.column-l,offset:a.end.offset-l},end:{...a.end}};a.end={...c.start},a.start.offset===a.end.offset?Object.assign(a,c):(e.splice(n,0,["enter",c,t],["exit",c,t]),n+=2)}n++}return e}const n7={42:kn,43:kn,45:kn,48:kn,49:kn,50:kn,51:kn,52:kn,53:kn,54:kn,55:kn,56:kn,57:kn,62:OA},a7={91:o9},i7={[-2]:Bp,[-1]:Bp,32:Bp},r7={35:m9,42:fh,45:[dj,fh],60:y9,61:dj,95:fh,96:uj,126:uj},s7={38:DA,92:LA},o7={[-5]:Kp,[-4]:Kp,[-3]:Kp,33:O9,38:DA,42:lw,60:[DW,_9],91:D9,92:[d9,LA],93:Qk,95:lw,96:JW},l7={null:[lw,X9]},u7={null:[42,95]},c7={null:[]},d7=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:u7,contentInitial:a7,disable:c7,document:n7,flow:r7,flowInitial:i7,insideSpan:l7,string:s7,text:o7},Symbol.toStringTag,{value:"Module"}));function h7(e,t,n){let a={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},r=[];let s=[],l=[];const u={attempt:T(S),check:T(_),consume:v,enter:k,exit:j,interrupt:T(_,{interrupt:!0})},c={code:null,containerState:{},defineSkip:g,events:[],now:y,parser:e,previous:null,sliceSerialize:m,sliceStream:f,write:d};let h=t.tokenize.call(c,u);return t.resolveAll&&r.push(t),c;function d(R){return s=ia(s,R),x(),s[s.length-1]!==null?[]:(E(t,0),c.events=Jk(r,c.events,c),c.events)}function m(R,F){return f7(f(R),F)}function f(R){return m7(s,R)}function y(){const{_bufferIndex:R,_index:F,line:Y,column:V,offset:z}=a;return{_bufferIndex:R,_index:F,line:Y,column:V,offset:z}}function g(R){i[R.line]=R.column,A()}function x(){let R;for(;a._index<s.length;){const F=s[a._index];if(typeof F=="string")for(R=a._index,a._bufferIndex<0&&(a._bufferIndex=0);a._index===R&&a._bufferIndex<F.length;)w(F.charCodeAt(a._bufferIndex));else w(F)}}function w(R){h=h(R)}function v(R){Te(R)?(a.line++,a.column=1,a.offset+=R===-3?2:1,A()):R!==-1&&(a.column++,a.offset++),a._bufferIndex<0?a._index++:(a._bufferIndex++,a._bufferIndex===s[a._index].length&&(a._bufferIndex=-1,a._index++)),c.previous=R}function k(R,F){const Y=F||{};return Y.type=R,Y.start=y(),c.events.push(["enter",Y,c]),l.push(Y),Y}function j(R){const F=l.pop();return F.end=y(),c.events.push(["exit",F,c]),F}function S(R,F){E(R,F.from)}function _(R,F){F.restore()}function T(R,F){return Y;function Y(V,z,W){let B,M,I,b;return Array.isArray(V)?D(V):"tokenize"in V?D([V]):C(V);function C(ee){return G;function G(ie){const q=ie!==null&&ee[ie],ae=ie!==null&&ee.null,de=[...Array.isArray(q)?q:q?[q]:[],...Array.isArray(ae)?ae:ae?[ae]:[]];return D(de)(ie)}}function D(ee){return B=ee,M=0,ee.length===0?W:N(ee[M])}function N(ee){return G;function G(ie){return b=O(),I=ee,ee.partial||(c.currentConstruct=ee),ee.name&&c.parser.constructs.disable.null.includes(ee.name)?re():ee.tokenize.call(F?Object.assign(Object.create(c),F):c,u,J,re)(ie)}}function J(ee){return R(I,b),z}function re(ee){return b.restore(),++M<B.length?N(B[M]):W}}}function E(R,F){R.resolveAll&&!r.includes(R)&&r.push(R),R.resolve&&ui(c.events,F,c.events.length-F,R.resolve(c.events.slice(F),c)),R.resolveTo&&(c.events=R.resolveTo(c.events,c))}function O(){const R=y(),F=c.previous,Y=c.currentConstruct,V=c.events.length,z=Array.from(l);return{from:V,restore:W};function W(){a=R,c.previous=F,c.currentConstruct=Y,c.events.length=V,l=z,A()}}function A(){a.line in i&&a.column<2&&(a.column=i[a.line],a.offset+=i[a.line]-1)}}function m7(e,t){const n=t.start._index,a=t.start._bufferIndex,i=t.end._index,r=t.end._bufferIndex;let s;if(n===i)s=[e[n].slice(a,r)];else{if(s=e.slice(n,i),a>-1){const l=s[0];typeof l=="string"?s[0]=l.slice(a):s.shift()}r>0&&s.push(e[i].slice(0,r))}return s}function f7(e,t){let n=-1;const a=[];let i;for(;++n<e.length;){const r=e[n];let s;if(typeof r=="string")s=r;else switch(r){case-5:{s="\r";break}case-4:{s=` 636`;break}case-3:{s=`\r 637`;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&i)continue;s=" ";break}default:s=String.fromCharCode(r)}i=r===-2,a.push(s)}return a.join("")}function p7(e){const a={constructs:bW([d7,...(e||{}).extensions||[]]),content:i(AW),defined:[],document:i(MW),flow:i(J9),lazy:{},string:i(Z9),text:i(e7)};return a;function i(r){return s;function s(l){return h7(a,r,l)}}}function g7(e){for(;!zA(e););return e}const hj=/[\0\t\n\r]/g;function y7(){let e=1,t="",n=!0,a;return i;function i(r,s,l){const u=[];let c,h,d,m,f;for(r=t+(typeof r=="string"?r.toString():new TextDecoder(s||void 0).decode(r)),d=0,t="",n&&(r.charCodeAt(0)===65279&&d++,n=void 0);d<r.length;){if(hj.lastIndex=d,c=hj.exec(r),m=c&&c.index!==void 0?c.index:r.length,f=r.charCodeAt(m),!c){t=r.slice(d);break}if(f===10&&d===m&&a)u.push(-3),a=void 0;else switch(a&&(u.push(-5),a=void 0),d<m&&(u.push(r.slice(d,m)),e+=m-d),f){case 0:{u.push(65533),e++;break}case 9:{for(h=Math.ceil(e/4)*4,u.push(-2);e++<h;)u.push(-1);break}case 10:{u.push(-4),e=1;break}default:a=!0,e=1}d=m+1}return l&&(a&&u.push(-5),t&&u.push(t),u.push(null)),u}}const w7=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function x7(e){return e.replace(w7,k7)}
vendor: 10,360 bytes, line 637
637function k7(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),r=i===120||i===88;return IA(n.slice(r?2:1),r?16:10)}return Yk(n)||e}const VA={}.hasOwnProperty;function v7(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),b7(n)(g7(p7(n).document().write(y7()(e,t,!0))))}function b7(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:r(mt),autolinkProtocol:O,autolinkEmail:O,atxHeading:r(Ve),blockQuote:r(ae),characterEscape:O,characterReference:O,codeFenced:r(de),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:r(de,s),codeText:r(me,s),codeTextData:O,data:O,codeFlowValue:O,definition:r(Ce),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:r(ke),hardBreakEscape:r(We),hardBreakTrailing:r(We),htmlFlow:r(Ge,s),htmlFlowData:O,htmlText:r(Ge,s),htmlTextData:O,image:r(ht),label:s,link:r(mt),listItem:r($),listItemValue:m,listOrdered:r(st,d),listUnordered:r(st),paragraph:r(he),reference:N,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:r(Ve),strong:r(xe),thematicBreak:r(be)},exit:{atxHeading:u(),atxHeadingSequence:S,autolink:u(),autolinkEmail:q,autolinkProtocol:ie,blockQuote:u(),characterEscapeValue:A,characterReferenceMarkerHexadecimal:re,characterReferenceMarkerNumeric:re,characterReferenceValue:ee,characterReference:G,codeFenced:u(x),codeFencedFence:g,codeFencedFenceInfo:f,codeFencedFenceMeta:y,codeFlowValue:A,codeIndented:u(w),codeText:u(z),codeTextData:A,data:A,definition:u(),definitionDestinationString:j,definitionLabelString:v,definitionTitleString:k,emphasis:u(),hardBreakEscape:u(F),hardBreakTrailing:u(F),htmlFlow:u(Y),htmlFlowData:A,htmlText:u(V),htmlTextData:A,image:u(B),label:I,labelText:M,lineEnding:R,link:u(W),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:J,resourceDestinationString:b,resourceTitleString:C,resource:D,setextHeading:u(E),setextHeadingLineSequence:T,setextHeadingText:_,strong:u(),thematicBreak:u()}};HA(t,(e||{}).mdastExtensions||[]);const n={};return a;function a(U){let P={type:"root",children:[]};const L={stack:[P],tokenStack:[],config:t,enter:l,exit:c,buffer:s,resume:h,data:n},H=[];let Z=-1;for(;++Z<U.length;)if(U[Z][1].type==="listOrdered"||U[Z][1].type==="listUnordered")if(U[Z][0]==="enter")H.push(Z);else{const Ae=H.pop();Z=i(U,Ae,Z)}for(Z=-1;++Z<U.length;){const Ae=t[U[Z][0]];VA.call(Ae,U[Z][1].type)&&Ae[U[Z][1].type].call(Object.assign({sliceSerialize:U[Z][2].sliceSerialize},L),U[Z][1])}if(L.tokenStack.length>0){const Ae=L.tokenStack[L.tokenStack.length-1];(Ae[1]||mj).call(L,void 0,Ae[0])}for(P.position={start:$i(U.length>0?U[0][1].start:{line:1,column:1,offset:0}),end:$i(U.length>0?U[U.length-2][1].end:{line:1,column:1,offset:0})},Z=-1;++Z<t.transforms.length;)P=t.transforms[Z](P)||P;return P}function i(U,P,L){let H=P-1,Z=-1,Ae=!1,je,Qe,Ke,Nt;for(;++H<=L;){const Xe=U[H];switch(Xe[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Xe[0]==="enter"?Z++:Z--,Nt=void 0;break}case"lineEndingBlank":{Xe[0]==="enter"&&(je&&!Nt&&!Z&&!Ke&&(Ke=H),Nt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Nt=void 0}if(!Z&&Xe[0]==="enter"&&Xe[1].type==="listItemPrefix"||Z===-1&&Xe[0]==="exit"&&(Xe[1].type==="listUnordered"||Xe[1].type==="listOrdered")){if(je){let wn=H;for(Qe=void 0;wn--;){const Ct=U[wn];if(Ct[1].type==="lineEnding"||Ct[1].type==="lineEndingBlank"){if(Ct[0]==="exit")continue;Qe&&(U[Qe][1].type="lineEndingBlank",Ae=!0),Ct[1].type="lineEnding",Qe=wn}else if(!(Ct[1].type==="linePrefix"||Ct[1].type==="blockQuotePrefix"||Ct[1].type==="blockQuotePrefixWhitespace"||Ct[1].type==="blockQuoteMarker"||Ct[1].type==="listItemIndent"))break}Ke&&(!Qe||Ke<Qe)&&(je._spread=!0),je.end=Object.assign({},Qe?U[Qe][1].start:Xe[1].end),U.splice(Qe||H,0,["exit",je,Xe[2]]),H++,L++}if(Xe[1].type==="listItemPrefix"){const wn={type:"listItem",_spread:!1,start:Object.assign({},Xe[1].start),end:void 0};je=wn,U.splice(H,0,["enter",wn,Xe[2]]),H++,L++,Ke=void 0,Nt=!0}}}return U[P][1]._spread=Ae,L}function r(U,P){return L;function L(H){l.call(this,U(H),H),P&&P.call(this,H)}}function s(){this.stack.push({type:"fragment",children:[]})}function l(U,P,L){this.stack[this.stack.length-1].children.push(U),this.stack.push(U),this.tokenStack.push([P,L||void 0]),U.position={start:$i(P.start),end:void 0}}function u(U){return P;function P(L){U&&U.call(this,L),c.call(this,L)}}function c(U,P){const L=this.stack.pop(),H=this.tokenStack.pop();if(H)H[0].type!==U.type&&(P?P.call(this,U,H[0]):(H[1]||mj).call(this,U,H[0]));else throw new Error("Cannot close `"+U.type+"` ("+Nu({start:U.start,end:U.end})+"): itâs not open");L.position.end=$i(U.end)}function h(){return kW(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function m(U){if(this.data.expectingFirstListItemValue){const P=this.stack[this.stack.length-2];P.start=Number.parseInt(this.sliceSerialize(U),10),this.data.expectingFirstListItemValue=void 0}}function f(){const U=this.resume(),P=this.stack[this.stack.length-1];P.lang=U}function y(){const U=this.resume(),P=this.stack[this.stack.length-1];P.meta=U}function g(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function x(){const U=this.resume(),P=this.stack[this.stack.length-1];P.value=U.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function w(){const U=this.resume(),P=this.stack[this.stack.length-1];P.value=U.replace(/(\r?\n|\r)$/g,"")}function v(U){const P=this.resume(),L=this.stack[this.stack.length-1];L.label=P,L.identifier=Io(this.sliceSerialize(U)).toLowerCase()}function k(){const U=this.resume(),P=this.stack[this.stack.length-1];P.title=U}function j(){const U=this.resume(),P=this.stack[this.stack.length-1];P.url=U}function S(U){const P=this.stack[this.stack.length-1];if(!P.depth){const L=this.sliceSerialize(U).length;P.depth=L}}function _(){this.data.setextHeadingSlurpLineEnding=!0}function T(U){const P=this.stack[this.stack.length-1];P.depth=this.sliceSerialize(U).codePointAt(0)===61?1:2}function E(){this.data.setextHeadingSlurpLineEnding=void 0}function O(U){const L=this.stack[this.stack.length-1].children;let H=L[L.length-1];(!H||H.type!=="text")&&(H=Me(),H.position={start:$i(U.start),end:void 0},L.push(H)),this.stack.push(H)}function A(U){const P=this.stack.pop();P.value+=this.sliceSerialize(U),P.position.end=$i(U.end)}function R(U){const P=this.stack[this.stack.length-1];if(this.data.atHardBreak){const L=P.children[P.children.length-1];L.position.end=$i(U.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(P.type)&&(O.call(this,U),A.call(this,U))}function F(){this.data.atHardBreak=!0}function Y(){const U=this.resume(),P=this.stack[this.stack.length-1];P.value=U}function V(){const U=this.resume(),P=this.stack[this.stack.length-1];P.value=U}function z(){const U=this.resume(),P=this.stack[this.stack.length-1];P.value=U}function W(){const U=this.stack[this.stack.length-1];if(this.data.inReference){const P=this.data.referenceType||"shortcut";U.type+="Reference",U.referenceType=P,delete U.url,delete U.title}else delete U.identifier,delete U.label;this.data.referenceType=void 0}function B(){const U=this.stack[this.stack.length-1];if(this.data.inReference){const P=this.data.referenceType||"shortcut";U.type+="Reference",U.referenceType=P,delete U.url,delete U.title}else delete U.identifier,delete U.label;this.data.referenceType=void 0}function M(U){const P=this.sliceSerialize(U),L=this.stack[this.stack.length-2];L.label=x7(P),L.identifier=Io(P).toLowerCase()}function I(){const U=this.stack[this.stack.length-1],P=this.resume(),L=this.stack[this.stack.length-1];if(this.data.inReference=!0,L.type==="link"){const H=U.children;L.children=H}else L.alt=P}function b(){const U=this.resume(),P=this.stack[this.stack.length-1];P.url=U}function C(){const U=this.resume(),P=this.stack[this.stack.length-1];P.title=U}function D(){this.data.inReference=void 0}function N(){this.data.referenceType="collapsed"}function J(U){const P=this.resume(),L=this.stack[this.stack.length-1];L.label=P,L.identifier=Io(this.sliceSerialize(U)).toLowerCase(),this.data.referenceType="full"}function re(U){this.data.characterReferenceType=U.type}function ee(U){const P=this.sliceSerialize(U),L=this.data.characterReferenceType;let H;L?(H=IA(P,L==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):H=Yk(P);const Z=this.stack[this.stack.length-1];Z.value+=H}function G(U){const P=this.stack.pop();P.position.end=$i(U.end)}function ie(U){A.call(this,U);const P=this.stack[this.stack.length-1];P.url=this.sliceSerialize(U)}function q(U){A.call(this,U);const P=this.stack[this.stack.length-1];P.url="mailto:"+this.sliceSerialize(U)}function ae(){return{type:"blockquote",children:[]}}function de(){return{type:"code",lang:null,meta:null,value:""}}function me(){return{type:"inlineCode",value:""}}function Ce(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ke(){return{type:"emphasis",children:[]}}function Ve(){return{type:"heading",depth:0,children:[]}}function We(){return{type:"break"}}function Ge(){return{type:"html",value:""}}function ht(){return{type:"image",title:null,url:"",alt:null}}function mt(){return{type:"link",title:null,url:"",children:[]}}function st(U){return{type:"list",ordered:U.type==="listOrdered",start:null,spread:U._spread,children:[]}}function $(U){return{type:"listItem",spread:U._spread,checked:null,children:[]}}function he(){return{type:"paragraph",children:[]}}function xe(){return{type:"strong",children:[]}}function Me(){return{type:"text",value:""}}function be(){return{type:"thematicBreak"}}}function $i(e){return{line:e.line,column:e.column,offset:e.offset}}function HA(e,t){let n=-1;for(;++n<t.length;){const a=t[n];Array.isArray(a)?HA(e,a):j7(e,a)}}function j7(e,t){let n;for(n in t)if(VA.call(t,n))switch(n){case"canContainEols":{const a=t[n];a&&e[n].push(...a);break}case"transforms":{const a=t[n];a&&e[n].push(...a);break}case"enter":case"exit":{const a=t[n];a&&Object.assign(e[n],a);break}}}function mj(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Nu({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Nu({start:t.start,end:t.end}
vendor: 8,689 bytes, lines 637-641
637)+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Nu({start:t.start,end:t.end})+") is still open")}function _7(e){const t=this;t.parser=n;function n(a){return v7(a,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function S7(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function N7(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:` 638`}]}function C7(e,t){const n=t.value?t.value+` 639`:"",a={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(a.className=["language-"+i[0]]);let r={type:"element",tagName:"code",properties:a,children:[{type:"text",value:n}]};return t.meta&&(r.data={meta:t.meta}),e.patch(t,r),r=e.applyData(t,r),r={type:"element",tagName:"pre",properties:{},children:[r]},e.patch(t,r),r}function T7(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function E7(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function A7(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=String(t.identifier).toUpperCase(),i=El(a.toLowerCase()),r=e.footnoteOrder.indexOf(a);let s,l=e.footnoteCounts.get(a);l===void 0?(l=0,e.footnoteOrder.push(a),s=e.footnoteOrder.length):s=r+1,l+=1,e.footnoteCounts.set(a,l);const u={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(l>1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};e.patch(t,u);const c={type:"element",tagName:"sup",properties:{},children:[u]};return e.patch(t,c),e.applyData(t,c)}function P7(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function M7(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function WA(e,t){const n=t.referenceType;let a="]";if(n==="collapsed"?a+="[]":n==="full"&&(a+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+a}];const i=e.all(t),r=i[0];r&&r.type==="text"?r.value="["+r.value:i.unshift({type:"text",value:"["});const s=i[i.length-1];return s&&s.type==="text"?s.value+=a:i.push({type:"text",value:a}),i}function R7(e,t){const n=String(t.identifier).toUpperCase(),a=e.definitionById.get(n);if(!a)return WA(e,t);const i={src:El(a.url||""),alt:t.alt};a.title!==null&&a.title!==void 0&&(i.title=a.title);const r={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,r),e.applyData(t,r)}function I7(e,t){const n={src:El(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const a={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,a),e.applyData(t,a)}function O7(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const a={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,a),e.applyData(t,a)}function L7(e,t){const n=String(t.identifier).toUpperCase(),a=e.definitionById.get(n);if(!a)return WA(e,t);const i={href:El(a.url||"")};a.title!==null&&a.title!==void 0&&(i.title=a.title);const r={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function D7(e,t){const n={href:El(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const a={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function z7(e,t,n){const a=e.all(t),i=n?F7(n):qA(t),r={},s=[];if(typeof t.checked=="boolean"){const h=a[0];let d;h&&h.type==="element"&&h.tagName==="p"?d=h:(d={type:"element",tagName:"p",properties:{},children:[]},a.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),r.className=["task-list-item"]}let l=-1;for(;++l<a.length;){const h=a[l];(i||l!==0||h.type!=="element"||h.tagName!=="p")&&s.push({type:"text",value:` 640`}),h.type==="element"&&h.tagName==="p"&&!i?s.push(...h.children):s.push(h)}const u=a[a.length-1];u&&(i||u.type!=="element"||u.tagName!=="p")&&s.push({type:"text",value:` 641`});const c={type:"element",tagName:"li",properties:r,children:s};return e.patch(t,c),e.applyData(t,c)}function F7(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let a=-1;for(;!t&&++a<n.length;)t=qA(n[a])}return t}function qA(e){const t=e.spread;return t??e.children.length>1}function B7(e,t){const n={},a=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<a.length;){const s=a[i];if(s.type==="element"&&s.tagName==="li"&&s.properties&&Array.isArray(s.properties.className)&&s.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const r={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(a,!0)};return e.patch(t,r),e.applyData(t,r)}function K7(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function $7(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function U7(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function V7(e,t){const n=e.all(t),a=n.shift(),i=[];if(a){const s={type:"element",tagName:"thead",properties:{},children:e.wrap([a],!0)};e.patch(t.children[0],s),i.push(s)}if(n.length>0){const s={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},l=Hk(t.children[1]),u=CA(t.children[t.children.length-1]);l&&u&&(s.position={start:l,end:u}),i.push(s)}const r={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,r),e.applyData(t,r)}function H7(e,t,n){const a=n?n.children:void 0,r=(a?a.indexOf(t):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,l=s?s.length:t.children.length;let u=-1;const c=[];for(;++u<l;){const d=t.children[u],m={},f=s?s[u]:void 0;f&&(m.align=f);let y={type:"element",tagName:r,properties:m,children:[]};d&&(y.children=e.all(d),e.patch(d,y),y=e.applyData(d,y)),c.push(y)}const h={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,h),e.applyData(t,h)}function W7(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const fj=9,pj=32;function q7(e){const t=String(e),n=/\r?\n|\r/g;let a=n.exec(t),i=0;const r=[];for(;a;)r.push(gj(t.slice(i,a.index),i>0,!0),a[0]),i=a.index+a[0].length,a=n.exec(t);return r.push(gj(t.slice(i),i>0,!1)),r.join("")}function gj(e,t,n){let a=0,i=e.length;if(t){let r=e.codePointAt(a);for(;r===fj||r===pj;)a++,r=e.codePointAt(a)}if(n){let r=e.codePointAt(i-1);for(;r===fj||r===pj;)i--,r=e.codePointAt(i-1)}return i>a?e.slice(a,i):""}function G7(e,t){const n={type:"text",value:q7(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Y7(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const J7={blockquote:S7,break:N7,code:C7,delete:T7,emphasis:E7,footnoteReference:A7,heading:P7,html:M7,imageReference:R7,image:I7,inlineCode:O7,linkReference:L7,link:D7,listItem:z7,list:B7,paragraph:K7,root:$7,strong:U7,table:V7,tableCell:W7,tableRow:H7,text:G7,thematicBreak:Y7,toml:Od,yaml:Od,definition:Od,footnoteDefinition:Od};function Od(){}const GA=-1,vf=0,Tu=1,cm=2,Xk=3,Zk=4,ev=5,tv=6,YA=7,JA=8,yj=typeof self=="object"?self:globalThis,Q7=(e,t)=>{const n=(i,r)=>(e.set(r,i),i),a=i=>{if(e.has(i))return e.get(i);const[r,s]=t[i];switch(r){case vf:case GA:return n(s,i);case Tu:{const l=n([],i);for(const u of s)l.push(a(u));return l}case cm:{const l=n({},i);for(const[u,c]of s)l[a(u)]=a(c);return l}case Xk:return n(new Date(s),i);case Zk:{const{source:l,flags:u}=s;return n(new RegExp(l,u),i)}case ev:{const l=n(new Map,i);for(const[u,c]of s)l.set(a(u),a(c));return l}case tv:{const l=n(new Set,i);for(const u of s)l.add(a(u));return l}case YA:{const{name:l,message:u}=s;return n(new yj[l](u),i)}case JA:return n(BigInt(s),i);case"BigInt":return n(Object(BigInt(s)),i);case"ArrayBuffer":return n(new Uint8Array(s).buffer,s);case"DataView":{const{buffer:l}=new Uint8Array(s);return n(new DataView(l),s)}}return n(new yj[r](s),i)};return a},wj=e=>Q7(new Map,e)(0),Qs="",{toString:X7}={},{keys:Z7}=Object,Gl=e=>{const t=typeof e;if(t!=="object"||!e)return[vf,t];const n=X7.call(e).slice(8,-1);
vendor: 6,548 bytes, lines 641-643
641switch(n){case"Array":return[Tu,Qs];case"Object":return[cm,Qs];case"Date":return[Xk,Qs];case"RegExp":return[Zk,Qs];case"Map":return[ev,Qs];case"Set":return[tv,Qs];case"DataView":return[Tu,n]}return n.includes("Array")?[Tu,n]:n.includes("Error")?[YA,n]:[cm,n]},Ld=([e,t])=>e===vf&&(t==="function"||t==="symbol"),eq=(e,t,n,a)=>{const i=(s,l)=>{const u=a.push(s)-1;return n.set(l,u),u},r=s=>{if(n.has(s))return n.get(s);let[l,u]=Gl(s);switch(l){case vf:{let h=s;switch(u){case"bigint":l=JA,h=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+u);h=null;break;case"undefined":return i([GA],s)}return i([l,h],s)}case Tu:{if(u){let m=s;return u==="DataView"?m=new Uint8Array(s.buffer):u==="ArrayBuffer"&&(m=new Uint8Array(s)),i([u,[...m]],s)}const h=[],d=i([l,h],s);for(const m of s)h.push(r(m));return d}case cm:{if(u)switch(u){case"BigInt":return i([u,s.toString()],s);case"Boolean":case"Number":case"String":return i([u,s.valueOf()],s)}if(t&&"toJSON"in s)return r(s.toJSON());const h=[],d=i([l,h],s);for(const m of Z7(s))(e||!Ld(Gl(s[m])))&&h.push([r(m),r(s[m])]);return d}case Xk:return i([l,s.toISOString()],s);case Zk:{const{source:h,flags:d}=s;return i([l,{source:h,flags:d}],s)}case ev:{const h=[],d=i([l,h],s);for(const[m,f]of s)(e||!(Ld(Gl(m))||Ld(Gl(f))))&&h.push([r(m),r(f)]);return d}case tv:{const h=[],d=i([l,h],s);for(const m of s)(e||!Ld(Gl(m)))&&h.push(r(m));return d}}const{message:c}=s;return i([l,{name:u,message:c}],s)};return r},xj=(e,{json:t,lossy:n}={})=>{const a=[];return eq(!(t||n),!!t,new Map,a)(e),a},dm=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?wj(xj(e,t)):structuredClone(e):(e,t)=>wj(xj(e,t));function tq(e,t){const n=[{type:"text",value:"â©"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function nq(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function aq(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||tq,a=e.options.footnoteBackLabel||nq,i=e.options.footnoteLabel||"Footnotes",r=e.options.footnoteLabelTagName||"h2",s=e.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let u=-1;for(;++u<e.footnoteOrder.length;){const c=e.footnoteById.get(e.footnoteOrder[u]);if(!c)continue;const h=e.all(c),d=String(c.identifier).toUpperCase(),m=El(d.toLowerCase());let f=0;const y=[],g=e.footnoteCounts.get(d);for(;g!==void 0&&++f<=g;){y.length>0&&y.push({type:"text",value:" "});let v=typeof n=="string"?n:n(u,f);typeof v=="string"&&(v={type:"text",value:v}),y.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+m+(f>1?"-"+f:""),dataFootnoteBackref:"",ariaLabel:typeof a=="string"?a:a(u,f),className:["data-footnote-backref"]},children:Array.isArray(v)?v:[v]})}const x=h[h.length-1];if(x&&x.type==="element"&&x.tagName==="p"){const v=x.children[x.children.length-1];v&&v.type==="text"?v.value+=" ":x.children.push({type:"text",value:" "}),x.children.push(...y)}else h.push(...y);const w={type:"element",tagName:"li",properties:{id:t+"fn-"+m},children:e.wrap(h,!0)};e.patch(c,w),l.push(w)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:r,properties:{...dm(s),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:` 642`},{type:"element",tagName:"ol",properties:{},children:e.wrap(l,!0)},{type:"text",value:` 643`}]}}const QA=function(e){if(e==null)return oq;if(typeof e=="function")return bf(e);if(typeof e=="object")return Array.isArray(e)?iq(e):rq(e);if(typeof e=="string")return sq(e);throw new Error("Expected function, string, or object as test")};function iq(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=QA(e[n]);return bf(a);function a(...i){let r=-1;for(;++r<t.length;)if(t[r].apply(this,i))return!0;return!1}}function rq(e){const t=e;return bf(n);function n(a){const i=a;let r;for(r in e)if(i[r]!==t[r])return!1;return!0}}function sq(e){return bf(t);function t(n){return n&&n.type===e}}function bf(e){return t;function t(n,a,i){return!!(lq(n)&&e.call(this,n,typeof a=="number"?a:void 0,i||void 0))}}function oq(){return!0}function lq(e){return e!==null&&typeof e=="object"&&"type"in e}const XA=[],uq=!0,kj=!1,cq="skip";function dq(e,t,n,a){let i;typeof t=="function"&&typeof n!="function"?(a=n,n=t):i=t;const r=QA(i),s=a?-1:1;l(e,void 0,[])();function l(u,c,h){const d=u&&typeof u=="object"?u:{};if(typeof d.type=="string"){const f=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(m,"name",{value:"node ("+(u.type+(f?"<"+f+">":""))+")"})}return m;function m(){let f=XA,y,g,x;if((!t||r(u,c,h[h.length-1]||void 0))&&(f=hq(n(u,h)),f[0]===kj))return f;if("children"in u&&u.children){const w=u;if(w.children&&f[0]!==cq)for(g=(a?w.children.length:-1)+s,x=h.concat(w);g>-1&&g<w.children.length;){const v=w.children[g];if(y=l(v,g,x)(),y[0]===kj)return y;g=typeof y[1]=="number"?y[1]:g+s}}return f}}}function hq(e){return Array.isArray(e)?e:typeof e=="number"?[uq,e]:e==null?XA:[e]}function ZA(e,t,n,a){let i,r,s;typeof t=="function"&&typeof n!="function"?(r=void 0,s=t,i=n):(r=t,s=n,i=a),dq(e,r,l,i);function l(u,c){const h=c[c.length-1],d=h?h.children.indexOf(u):void 0;return s(u,d,h)}}const uw={}.hasOwnProperty,mq={};function fq(e,t){const n=t||mq,a=new Map,i=new Map,r=new Map,s={...J7,...n.handlers},l={all:c,applyData:gq,definitionById:a,footnoteById:i,footnoteCounts:r,footnoteOrder:[],handlers:s,one:u,options:n,patch:pq,wrap:wq};return ZA(e,function(h){if(h.type==="definition"||h.type==="footnoteDefinition"){const d=h.type==="definition"?a:i,m=String(h.identifier).toUpperCase();d.has(m)||d.set(m,h)}}),l;function u(h,d){const m=h.type,f=l.handlers[m];if(uw.call(l.handlers,m)&&f)return f(l,h,d);if(l.options.passThrough&&l.options.passThrough.includes(m)){if("children"in h){const{children:g,...x}=h,w=dm(x);return w.children=l.all(h),w}return dm(h)}return(l.options.unknownHandler||yq)(l,h,d)}function c(h){const d=[];if("children"in h){const m=h.children;let f=-1;for(;++f<m.length;){const y=l.one(m[f],h);if(y){if(f&&m[f-1].type==="break"&&(!Array.isArray(y)&&y.type==="text"&&(y.value=vj(y.value)),!Array.isArray(y)&&y.type==="element")){const g=y.children[0];g&&g.type==="text"&&(g.value=vj(g.value))}Array.isArray(y)?d.push(...y):d.push(y)}}}return d}}function pq(e,t){e.position&&(t.position=XH(e))}function gq(e,t){let n=t;if(e&&e.data){const a=e.data.hName,i=e.data.hChildren,r=e.data.hProperties;
vendor: 5,562 bytes, lines 643-647
643if(typeof a=="string")if(n.type==="element")n.tagName=a;else{const s="children"in n?n.children:[n];n={type:"element",tagName:a,properties:{},children:s}}n.type==="element"&&r&&Object.assign(n.properties,dm(r)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function yq(e,t){const n=t.data||{},a="value"in t&&!(uw.call(n,"hProperties")||uw.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function wq(e,t){const n=[];let a=-1;for(t&&n.push({type:"text",value:` 644`});++a<e.length;)a&&n.push({type:"text",value:` 645`}),n.push(e[a]);return t&&e.length>0&&n.push({type:"text",value:` 646`}),n}function vj(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function bj(e,t){const n=fq(e,t),a=n.one(e,void 0),i=aq(n),r=Array.isArray(a)?{type:"root",children:a}:a||{type:"root",children:[]};return i&&r.children.push({type:"text",value:` 647`},i),r}function xq(e,t){return e&&"run"in e?async function(n,a){const i=bj(n,{file:a,...t});await e.run(i,a)}:function(n,a){return bj(n,{file:a,...e||t})}}function jj(e){if(e)throw e}var ph=Object.prototype.hasOwnProperty,eP=Object.prototype.toString,_j=Object.defineProperty,Sj=Object.getOwnPropertyDescriptor,Nj=function(t){return typeof Array.isArray=="function"?Array.isArray(t):eP.call(t)==="[object Array]"},Cj=function(t){if(!t||eP.call(t)!=="[object Object]")return!1;var n=ph.call(t,"constructor"),a=t.constructor&&t.constructor.prototype&&ph.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!a)return!1;var i;for(i in t);return typeof i>"u"||ph.call(t,i)},Tj=function(t,n){_j&&n.name==="__proto__"?_j(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},Ej=function(t,n){if(n==="__proto__")if(ph.call(t,n)){if(Sj)return Sj(t,n).value}else return;return t[n]},kq=function e(){var t,n,a,i,r,s,l=arguments[0],u=1,c=arguments.length,h=!1;for(typeof l=="boolean"&&(h=l,l=arguments[1]||{},u=2),(l==null||typeof l!="object"&&typeof l!="function")&&(l={});u<c;++u)if(t=arguments[u],t!=null)for(n in t)a=Ej(l,n),i=Ej(t,n),l!==i&&(h&&i&&(Cj(i)||(r=Nj(i)))?(r?(r=!1,s=a&&Nj(a)?a:[]):s=a&&Cj(a)?a:{},Tj(l,{name:n,newValue:e(h,s,i)})):typeof i<"u"&&Tj(l,{name:n,newValue:i}));return l};const $p=Pm(kq);function cw(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function vq(){const e=[],t={run:n,use:a};return t;function n(...i){let r=-1;const s=i.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);l(null,...i);function l(u,...c){const h=e[++r];let d=-1;if(u){s(u);return}for(;++d<i.length;)(c[d]===null||c[d]===void 0)&&(c[d]=i[d]);i=c,h?bq(h,l)(...c):s(null,...c)}}function a(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function bq(e,t){let n;return a;function a(...s){const l=e.length>s.length;let u;l&&s.push(i);try{u=e.apply(this,s)}catch(c){const h=c;if(l&&n)throw h;return i(h)}l||(u&&u.then&&typeof u.then=="function"?u.then(r,i):u instanceof Error?i(u):r(u))}function i(s,...l){n||(n=!0,t(s,...l))}function r(s){i(null,s)}}const Ha={basename:jq,dirname:_q,extname:Sq,join:Nq,sep:"/"};function jq(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Kc(e);let n=0,a=-1,i=e.length,r;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(r){n=i+1;break}}else a<0&&(r=!0,a=i+1);return a<0?"":e.slice(n,a)}if(t===e)return"";let s=-1,l=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(r){n=i+1;break}}else s<0&&(r=!0,s=i+1),l>-1&&(e.codePointAt(i)===t.codePointAt(l--)?l<0&&(a=i):(l=-1,a=s));return n===a?a=s:a<0&&(a=e.length),e.slice(n,a)}function _q(e){if(Kc(e),e.length===0)return".";let t=-1,n=e.length,a;for(;--n;)if(e.codePointAt(n)===47){if(a){t=n;break}}else a||(a=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function Sq(e){Kc(e);let t=e.length,n=-1,a=0,i=-1,r=0,s;for(;t--;){const l=e.codePointAt(t);if(l===47){if(s){a=t+1;break}continue}n<0&&(s=!0,n=t+1),l===46?i<0?i=t:r!==1&&(r=1):i>-1&&(r=-1)}return i<0||n<0||r===0||r===1&&i===n-1&&i===a+1?"":e.slice(i,n)}function Nq(...e){let t=-1,n;for(;++t<e.length;)Kc(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":Cq(n)}function Cq(e){Kc(e);const t=e.codePointAt(0)===47;let n=Tq(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Tq(e,t){let n="",a=0,i=-1,r=0,s=-1,l,u;for(;++s<=e.length;){if(s<e.length)l=e.codePointAt(s);else{if(l===47)break;l=47}if(l===47){if(!(i===s-1||r===1))if(i!==s-1&&r===2){if(n.length<2||a!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(u=n.lastIndexOf("/"),u!==n.length-1){u<0?(n="",a=0):(n=n.slice(0,u),a=n.length-1-n.lastIndexOf("/")),i=s,r=0;continue}}else if(n.length>0){n="",a=0,i=s,r=0;continue}}t&&(n=n.length>0?n+"/..":"..",a=2)}else n.length>0?n+="/"+e.slice(i+1,s):n=e.slice(i+1,s),a=s-i-1;i=s,r=0}else l===46&&r>-1?r++:r=-1}return n}function Kc(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Eq={cwd:Aq};function Aq(){return"/"}function dw(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}
vendor: 11,917 bytes, lines 647-648
647function Pq(e){if(typeof e=="string")e=new URL(e);else if(!dw(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return Mq(e)}function Mq(e){if(e.hostname!==""){const a=new TypeError('File URL host must be "localhost" or empty on darwin');throw a.code="ERR_INVALID_FILE_URL_HOST",a}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const a=t.codePointAt(n+2);if(a===70||a===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const Up=["history","path","basename","stem","extname","dirname"];class tP{constructor(t){let n;t?dw(t)?n={path:t}:typeof t=="string"||Rq(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":Eq.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let a=-1;for(;++a<Up.length;){const r=Up[a];r in n&&n[r]!==void 0&&n[r]!==null&&(this[r]=r==="history"?[...n[r]]:n[r])}let i;for(i in n)Up.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Ha.basename(this.path):void 0}set basename(t){Hp(t,"basename"),Vp(t,"basename"),this.path=Ha.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Ha.dirname(this.path):void 0}set dirname(t){Aj(this.basename,"dirname"),this.path=Ha.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Ha.extname(this.path):void 0}set extname(t){if(Vp(t,"extname"),Aj(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Ha.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){dw(t)&&(t=Pq(t)),Hp(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Ha.basename(this.path,this.extname):void 0}set stem(t){Hp(t,"stem"),Vp(t,"stem"),this.path=Ha.join(this.dirname||"",t+(this.extname||""))}fail(t,n,a){const i=this.message(t,n,a);throw i.fatal=!0,i}info(t,n,a){const i=this.message(t,n,a);return i.fatal=void 0,i}message(t,n,a){const i=new rn(t,n,a);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Vp(e,t){if(e&&e.includes(Ha.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Ha.sep+"`")}function Hp(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Aj(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function Rq(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Iq=function(e){const a=this.constructor.prototype,i=a[e],r=function(){return i.apply(r,arguments)};return Object.setPrototypeOf(r,a),r},Oq={}.hasOwnProperty;class nv extends Iq{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=vq()}copy(){const t=new nv;let n=-1;for(;++n<this.attachers.length;){const a=this.attachers[n];t.use(...a)}return t.data($p(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Gp("data",this.frozen),this.namespace[t]=n,this):Oq.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Gp("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...a]=this.attachers[this.freezeIndex];if(a[0]===!1)continue;a[0]===!0&&(a[0]=void 0);const i=n.call(t,...a);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Dd(t),a=this.parser||this.Parser;return Wp("parse",a),a(String(n),n)}process(t,n){const a=this;return this.freeze(),Wp("process",this.parser||this.Parser),qp("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(r,s){const l=Dd(t),u=a.parse(l);a.run(u,l,function(h,d,m){if(h||!d||!m)return c(h);const f=d,y=a.stringify(f,m);zq(y)?m.value=y:m.result=y,c(h,m)});function c(h,d){h||!d?s(h):r?r(d):n(void 0,d)}}}processSync(t){let n=!1,a;return this.freeze(),Wp("processSync",this.parser||this.Parser),qp("processSync",this.compiler||this.Compiler),this.process(t,i),Mj("processSync","process",n),a;function i(r,s){n=!0,jj(r),a=s}}run(t,n,a){Pj(t),this.freeze();const i=this.transformers;return!a&&typeof n=="function"&&(a=n,n=void 0),a?r(void 0,a):new Promise(r);function r(s,l){const u=Dd(n);i.run(t,u,c);function c(h,d,m){const f=d||t;h?l(h):s?s(f):a(void 0,f,m)}}}runSync(t,n){let a=!1,i;return this.run(t,n,r),Mj("runSync","run",a),i;function r(s,l){jj(s),i=l,a=!0}}stringify(t,n){this.freeze();const a=Dd(n),i=this.compiler||this.Compiler;return qp("stringify",i),Pj(t),i(t,a)}use(t,...n){const a=this.attachers,i=this.namespace;if(Gp("use",this.frozen),t!=null)if(typeof t=="function")u(t,n);else if(typeof t=="object")Array.isArray(t)?l(t):s(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function r(c){if(typeof c=="function")u(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[h,...d]=c;u(h,d)}else s(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function s(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");l(c.plugins),c.settings&&(i.settings=$p(!0,i.settings,c.settings))}function l(c){let h=-1;if(c!=null)if(Array.isArray(c))for(;++h<c.length;){const d=c[h];r(d)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function u(c,h){let d=-1,m=-1;for(;++d<a.length;)if(a[d][0]===c){m=d;break}if(m===-1)a.push([c,...h]);else if(h.length>0){let[f,...y]=h;const g=a[m][1];cw(g)&&cw(f)&&(f=$p(!0,g,f)),a[m]=[c,f,...y]}}}}const Lq=new nv().freeze();function Wp(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function qp(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Gp(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Pj(e){if(!cw(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Mj(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Dd(e){return Dq(e)?e:new tP(e)}function Dq(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function zq(e){return typeof e=="string"||Fq(e)}function Fq(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Bq="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Rj=[],Ij={allowDangerousHtml:!0},Kq=/^(https?|ircs?|mailto|xmpp)$/i,$q=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function Uq(e){const t=Vq(e),n=Hq(e);return Wq(t.runSync(t.parse(n),n),e)}function Vq(e){const t=e.rehypePlugins||Rj,n=e.remarkPlugins||Rj,a=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Ij}:Ij;return Lq().use(_7).use(n).use(xq,a).use(t)}function Hq(e){const t=e.children||"",n=new tP;return typeof t=="string"&&(n.value=t),n}function Wq(e,t){const n=t.allowedElements,a=t.allowElement,i=t.components,r=t.disallowedElements,s=t.skipHtml,l=t.unwrapDisallowed,u=t.urlTransform||qq;for(const h of $q)Object.hasOwn(t,h.from)&&(""+h.from+(h.to?"use `"+h.to+"` instead":"remove it")+Bq+h.id,void 0);return ZA(e,c),aW(e,{Fragment:o.Fragment,components:i,ignoreInvalidStyle:!0,jsx:o.jsx,jsxs:o.jsxs,passKeys:!0,passNode:!0});function c(h,d,m){if(h.type==="raw"&&m&&typeof d=="number")return s?m.children.splice(d,1):m.children[d]={type:"text",value:h.value},d;if(h.type==="element"){let f;for(f in Fp)if(Object.hasOwn(Fp,f)&&Object.hasOwn(h.properties,f)){const y=h.properties[f],g=Fp[f];(g===null||g.includes(h.tagName))&&(h.properties[f]=u(String(y||""),f,h))}}if(h.type==="element"){let f=n?!n.includes(h.tagName):r?r.includes(h.tagName):!1;if(!f&&a&&typeof d=="number"&&(f=!a(h,d,m)),f&&m&&typeof d=="number")return l&&h.children?m.children.splice(d,1,...h.children):m.children.splice(d,1),d}}}function qq(e){const t=e.indexOf(":"),n=e.indexOf("?"),a=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||a!==-1&&t>a||Kq.test(e.slice(0,t))?e:""}const Yl="/assets/haki-icon-Fq9W6G72.jpeg",Gq="https://crbzrntvphjalxmkrchi.supabase.co/functions/v1/civic-agent",Yq=({contextBillSlug:e})=>{const{t}=Re(),{url:n,displayName:a}=wf(),[i,r]=p.useState(!1),[s,l]=p.useState([]),[u,c]=p.useState(""),[h,d]=p.useState(!1),m=p.useRef(null),f=p.useRef(null);p.useEffect(()=>{m.current&&(m.current.scrollTop=m.current.scrollHeight)},[s,i]),p.useEffect(()=>{i&&f.current&&f.current.focus()},[i]);const y=async()=>{var v,k,j;const g=u.trim();if(!g||h)return;const x={role:"user",content:g},w=[...s,x];l(w),c(""),d(!0);try{const{data:{session:S}}=await te.auth.getSession(),_=(S==null?void 0:S.access_token)||"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImNyYnpybnR2cGhqYWx4bWtyY2hpIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzI2Njk1OTIsImV4cCI6MjA4ODI0NTU5Mn0.gzgwUs5LRK8lCT8SfREQ9xC_-tYTp3gC5jp_bvqM-CE",T=await fetch(Gq,{method:"POST",headers:{"Content-Type":"application/json",apikey:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImNyYnpybnR2cGhqYWx4bWtyY2hpIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzI2Njk1OTIsImV4cCI6MjA4ODI0NTU5Mn0.gzgwUs5LRK8lCT8SfREQ9xC_-tYTp3gC5jp_bvqM-CE",Authorization:`Bearer ${_}`},body:JSON.stringify({messages:w.map(O=>({role:O.role,content:O.content})),context:e?{billSlug:e}:void 0})});if(!T.ok){const O=await T.json().catch(()=>({error:"Unknown error"}));l(A=>[...A,{role:"assistant",content:`â ï¸ ${O.error||"Something went wrong"}`}]),d(!1);return}const E=T.headers.get("content-type")||"";if(E.includes("application/json")){const O=await T.json();l(A=>[...A,{role:"assistant",content:O.content}])}else if(E.includes("text/event-stream")&&T.body){const O=T.body.getReader(),A=new TextDecoder;let R="",F="";const Y=V=>{F=V,l(z=>{const W=z[z.length-1];return(W==null?void 0:W.role)==="assistant"?z.map((B,M)=>M===z.length-1?{...B,content:V}:B):[...z,{role:"assistant",content:V}]})};for(;;){const{done:V,value:z}=await O.read();if(V)break;R+=A.decode(z,{stream:!0});let W;for(;(W=R.indexOf(` 648`))!==-1;){let B=R.slice(0,W);
648if(R=R.slice(W+1),B.endsWith("\r")&&(B=B.slice(0,-1)),B.startsWith(":")||B.trim()===""||!B.startsWith("data: "))continue;const M=B.slice(6).trim();if(M==="[DONE]")break;try{const b=(j=(k=(v=JSON.parse(M).choices)==null?void 0:v[0])==null?void 0:k.delta)==null?void 0:j.content;b&&Y(F+b)}catch{R=B+` 649`+R;break}}}}}catch{l(_=>[..._,{role:"assistant",content:"â ï¸ Network error. Please try again."}])}d(!1)};return o.jsxs(o.Fragment,{children:[!i&&o.jsx("button",{onClick:()=>r(!0),className:"fixed bottom-6 left-4 z-50 h-12 w-12 rounded-full shadow-lg flex items-center justify-center hover:scale-105 transition-transform overflow-hidden border-2 border-primary","aria-label":t("Chat with Haki","Ongea na Haki"),children:o.jsx("img",{src:Yl,alt:"Haki",className:"h-full w-full object-cover"})}),i&&o.jsxs("div",{className:"fixed bottom-0 right-0 z-50 w-full sm:w-[380px] sm:bottom-4 sm:right-4 flex flex-col bg-background border border-border rounded-t-xl sm:rounded-xl shadow-2xl max-h-[85vh] sm:max-h-[600px]",children:[o.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b bg-primary/5 rounded-t-xl",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("img",{src:Yl,alt:"Haki",className:"h-5 w-5 rounded-full object-cover"}),o.jsx("span",{className:"text-xs font-bold",children:"Haki"})]}),o.jsx(Q,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>r(!1),children:o.jsx(Rc,{className:"h-4 w-4"})})]}),o.jsxs("div",{ref:m,className:"flex-1 overflow-y-auto p-3 space-y-3 min-h-[200px]",children:[s.length===0&&o.jsxs("div",{className:"flex gap-2 items-start py-4",children:[o.jsx("img",{src:Yl,alt:"Haki",className:"h-8 w-8 rounded-full object-cover shrink-0 mt-0.5"}),o.jsxs("div",{className:"bg-muted rounded-lg px-3 py-2 text-xs",children:[o.jsx("p",{className:"font-semibold mb-1",children:"Haki"}),o.jsx("p",{children:t("Hello, my name is Haki, how may I be of help today? I can help you understand bills, submit legal requests, or draft petitions.","Habari, jina langu ni Haki, nawezaje kukusaidia leo? Naweza kukusaidia kuelewa miswada, kutuma maombi ya kisheria, au kuandaa maombi.")})]})]}),s.map((g,x)=>o.jsxs("div",{className:`flex gap-2 ${g.role==="user"?"justify-end":"justify-start"}`,children:[g.role==="assistant"&&o.jsx("img",{src:Yl,alt:"Haki",className:"h-6 w-6 rounded-full object-cover shrink-0 mt-0.5"}),o.jsx("div",{className:`max-w-[85%] rounded-lg px-3 py-2 text-xs ${g.role==="user"?"bg-primary text-primary-foreground":"bg-muted"}`,children:g.role==="assistant"?o.jsx("div",{className:"prose prose-xs prose-neutral dark:prose-invert max-w-none [&>*]:text-xs [&>*]:my-1 [&>ul]:pl-4 [&>ol]:pl-4 [&>p]:leading-relaxed",children:o.jsx(Uq,{children:g.content})}):o.jsx("span",{children:g.content})}),g.role==="user"&&o.jsx(zs,{name:a||"You",url:n,className:"h-6 w-6 shrink-0 mt-0.5",fallbackTextClass:"text-[10px]"})]},x)),h&&o.jsxs("div",{className:"flex gap-2",children:[o.jsx("img",{src:Yl,alt:"Haki",className:"h-6 w-6 rounded-full object-cover shrink-0"}),o.jsx("div",{className:"bg-muted rounded-lg px-3 py-2",children:o.jsx(Be,{className:"h-3 w-3 animate-spin text-muted-foreground"})})]})]}),o.jsxs("div",{className:"border-t p-2 flex gap-2",children:[o.jsx("textarea",{ref:f,value:u,onChange:g=>c(g.target.value),onKeyDown:g=>{g.key==="Enter"&&!g.shiftKey&&(g.preventDefault(),y())},placeholder:t("Ask about a bill, your rights...","Uliza kuhusu muswada, haki zako..."),className:"flex-1 resize-none rounded-md border bg-background px-2 py-1.5 text-xs placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-primary min-h-[36px] max-h-[80px]",rows:1,disabled:h}),o.jsx(Q,{size:"icon",className:"h-9 w-9 shrink-0",onClick:y,disabled:h||!u.trim(),children:o.jsx(Vn,{className:"h-3.5 w-3.5"})})]})]})]})};var $c={};(function e(t,n,a,i){var r=!!(t.Worker&&t.Blob&&t.Promise&&t.OffscreenCanvas&&t.OffscreenCanvasRenderingContext2D&&t.HTMLCanvasElement&&t.HTMLCanvasElement.prototype.transferControlToOffscreen&&t.URL&&t.URL.createObjectURL),s=typeof Path2D=="function"&&typeof DOMMatrix=="function",l=function(){if(!t.OffscreenCanvas)return!1;try{var b=new OffscreenCanvas(1,1),C=b.getContext("2d");C.fillRect(0,0,1,1);var D=b.transferToImageBitmap();C.createPattern(D,"no-repeat")}catch{return!1}return!0}();function u(){}function c(b){var C=n.exports.Promise,D=C!==void 0?C:t.Promise;return typeof D=="function"?new D(b):(b(u,u),null)}var h=function(b,C){return{transform:function(D){if(b)return D;if(C.has(D))return C.get(D);var N=new OffscreenCanvas(D.width,D.height),J=N.getContext("2d");return J.drawImage(D,0,0),C.set(D,N),N},clear:function(){C.clear()}}}
vendor: 10,727 bytes, lines 649-650
649(l,new Map),d=function(){var b=Math.floor(16.666666666666668),C,D,N={},J=0;return typeof requestAnimationFrame=="function"&&typeof cancelAnimationFrame=="function"?(C=function(re){var ee=Math.random();return N[ee]=requestAnimationFrame(function G(ie){J===ie||J+b-1<ie?(J=ie,delete N[ee],re()):N[ee]=requestAnimationFrame(G)}),ee},D=function(re){N[re]&&cancelAnimationFrame(N[re])}):(C=function(re){return setTimeout(re,b)},D=function(re){return clearTimeout(re)}),{frame:C,cancel:D}}(),m=function(){var b,C,D={};function N(J){function re(ee,G){J.postMessage({options:ee||{},callback:G})}J.init=function(G){var ie=G.transferControlToOffscreen();J.postMessage({canvas:ie},[ie])},J.fire=function(G,ie,q){if(C)return re(G,null),C;var ae=Math.random().toString(36).slice(2);return C=c(function(de){function me(Ce){Ce.data.callback===ae&&(delete D[ae],J.removeEventListener("message",me),C=null,h.clear(),q(),de())}J.addEventListener("message",me),re(G,ae),D[ae]=me.bind(null,{data:{callback:ae}})}),C},J.reset=function(){J.postMessage({reset:!0});for(var G in D)D[G](),delete D[G]}}return function(){if(b)return b;if(!a&&r){var J=["var CONFETTI, SIZE = {}, module = {};","("+e.toString()+")(this, module, true, SIZE);","onmessage = function(msg) {"," if (msg.data.options) {"," CONFETTI(msg.data.options).then(function () {"," if (msg.data.callback) {"," postMessage({ callback: msg.data.callback });"," }"," });"," } else if (msg.data.reset) {"," CONFETTI && CONFETTI.reset();"," } else if (msg.data.resize) {"," SIZE.width = msg.data.resize.width;"," SIZE.height = msg.data.resize.height;"," } else if (msg.data.canvas) {"," SIZE.width = msg.data.canvas.width;"," SIZE.height = msg.data.canvas.height;"," CONFETTI = module.exports.create(msg.data.canvas);"," }","}"].join(` 650`);try{b=new Worker(URL.createObjectURL(new Blob([J])))}catch(re){return typeof console<"u"&&typeof console.warn=="function"&&console.warn("ð Could not load worker",re),null}N(b)}return b}}(),f={particleCount:50,angle:90,spread:45,startVelocity:45,decay:.9,gravity:1,drift:0,ticks:200,x:.5,y:.5,shapes:["square","circle"],zIndex:100,colors:["#26ccff","#a25afd","#ff5e7e","#88ff5a","#fcff42","#ffa62d","#ff36ff"],disableForReducedMotion:!1,scalar:1};function y(b,C){return C?C(b):b}function g(b){return b!=null}function x(b,C,D){return y(b&&g(b[C])?b[C]:f[C],D)}function w(b){return b<0?0:Math.floor(b)}function v(b,C){return Math.floor(Math.random()*(C-b))+b}function k(b){return parseInt(b,16)}function j(b){return b.map(S)}function S(b){var C=String(b).replace(/[^0-9a-f]/gi,"");return C.length<6&&(C=C[0]+C[0]+C[1]+C[1]+C[2]+C[2]),{r:k(C.substring(0,2)),g:k(C.substring(2,4)),b:k(C.substring(4,6))}}function _(b){var C=x(b,"origin",Object);return C.x=x(C,"x",Number),C.y=x(C,"y",Number),C}function T(b){b.width=document.documentElement.clientWidth,b.height=document.documentElement.clientHeight}function E(b){var C=b.getBoundingClientRect();b.width=C.width,b.height=C.height}function O(b){var C=document.createElement("canvas");return C.style.position="fixed",C.style.top="0px",C.style.left="0px",C.style.pointerEvents="none",C.style.zIndex=b,C}function A(b,C,D,N,J,re,ee,G,ie){b.save(),b.translate(C,D),b.rotate(re),b.scale(N,J),b.arc(0,0,1,ee,G,ie),b.restore()}function R(b){var C=b.angle*(Math.PI/180),D=b.spread*(Math.PI/180);return{x:b.x,y:b.y,wobble:Math.random()*10,wobbleSpeed:Math.min(.11,Math.random()*.1+.05),velocity:b.startVelocity*.5+Math.random()*b.startVelocity,angle2D:-C+(.5*D-Math.random()*D),tiltAngle:(Math.random()*(.75-.25)+.25)*Math.PI,color:b.color,shape:b.shape,tick:0,totalTicks:b.ticks,decay:b.decay,drift:b.drift,random:Math.random()+2,tiltSin:0,tiltCos:0,wobbleX:0,wobbleY:0,gravity:b.gravity*3,ovalScalar:.6,scalar:b.scalar,flat:b.flat}}function F(b,C){C.x+=Math.cos(C.angle2D)*C.velocity+C.drift,C.y+=Math.sin(C.angle2D)*C.velocity+C.gravity,C.velocity*=C.decay,C.flat?(C.wobble=0,C.wobbleX=C.x+10*C.scalar,C.wobbleY=C.y+10*C.scalar,C.tiltSin=0,C.tiltCos=0,C.random=1):(C.wobble+=C.wobbleSpeed,C.wobbleX=C.x+10*C.scalar*Math.cos(C.wobble),C.wobbleY=C.y+10*C.scalar*Math.sin(C.wobble),C.tiltAngle+=.1,C.tiltSin=Math.sin(C.tiltAngle),C.tiltCos=Math.cos(C.tiltAngle),C.random=Math.random()+2);var D=C.tick++/C.totalTicks,N=C.x+C.random*C.tiltCos,J=C.y+C.random*C.tiltSin,re=C.wobbleX+C.random*C.tiltCos,ee=C.wobbleY+C.random*C.tiltSin;if(b.fillStyle="rgba("+C.color.r+", "+C.color.g+", "+C.color.b+", "+(1-D)+")",b.beginPath(),s&&C.shape.type==="path"&&typeof C.shape.path=="string"&&Array.isArray(C.shape.matrix))b.fill(B(C.shape.path,C.shape.matrix,C.x,C.y,Math.abs(re-N)*.1,Math.abs(ee-J)*.1,Math.PI/10*C.wobble));else if(C.shape.type==="bitmap"){var G=Math.PI/10*C.wobble,ie=Math.abs(re-N)*.1,q=Math.abs(ee-J)*.1,ae=C.shape.bitmap.width*C.scalar,de=C.shape.bitmap.height*C.scalar,me=new DOMMatrix([Math.cos(G)*ie,Math.sin(G)*ie,-Math.sin(G)*q,Math.cos(G)*q,C.x,C.y]);me.multiplySelf(new DOMMatrix(C.shape.matrix));var Ce=b.createPattern(h.transform(C.shape.bitmap),"no-repeat");Ce.setTransform(me),b.globalAlpha=1-D,b.fillStyle=Ce,b.fillRect(C.x-ae/2,C.y-de/2,ae,de),b.globalAlpha=1}else if(C.shape==="circle")b.ellipse?b.ellipse(C.x,C.y,Math.abs(re-N)*C.ovalScalar,Math.abs(ee-J)*C.ovalScalar,Math.PI/10*C.wobble,0,2*Math.PI):A(b,C.x,C.y,Math.abs(re-N)*C.ovalScalar,Math.abs(ee-J)*C.ovalScalar,Math.PI/10*C.wobble,0,2*Math.PI);else if(C.shape==="star")for(var ke=Math.PI/2*3,Ve=4*C.scalar,We=8*C.scalar,Ge=C.x,ht=C.y,mt=5,st=Math.PI/mt;mt--;)Ge=C.x+Math.cos(ke)*We,ht=C.y+Math.sin(ke)*We,b.lineTo(Ge,ht),ke+=st,Ge=C.x+Math.cos(ke)*Ve,ht=C.y+Math.sin(ke)*Ve,b.lineTo(Ge,ht),ke+=st;else b.moveTo(Math.floor(C.x),Math.floor(C.y)),b.lineTo(Math.floor(C.wobbleX),Math.floor(J)),b.lineTo(Math.floor(re),Math.floor(ee)),b.lineTo(Math.floor(N),Math.floor(C.wobbleY));return b.closePath(),b.fill(),C.tick<C.totalTicks}function Y(b,C,D,N,J){var re=C.slice(),ee=b.getContext("2d"),G,ie,q=c(function(ae){function de(){G=ie=null,ee.clearRect(0,0,N.width,N.height),h.clear(),J(),ae()}function me(){a&&!(N.width===i.width&&N.height===i.height)&&(N.width=b.width=i.width,N.height=b.height=i.height),!N.width&&!N.height&&(D(b),N.width=b.width,N.height=b.height),ee.clearRect(0,0,N.width,N.height),re=re.filter(function(Ce){return F(ee,Ce)}),re.length?G=d.frame(me):de()}G=d.frame(me),ie=de});return{addFettis:function(ae){return re=re.concat(ae),q},canvas:b,promise:q,reset:function(){G&&d.cancel(G),ie&&ie()}}}function V(b,C){var D=!b,N=!!x(C||{},"resize"),J=!1,re=x(C,"disableForReducedMotion",Boolean),ee=r&&!!x(C||{},"useWorker"),G=ee?m():null,ie=D?T:E,q=b&&G?!!b.__confetti_initialized:!1,ae=typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion)").matches,de;function me(ke,Ve,We){for(var Ge=x(ke,"particleCount",w),ht=x(ke,"angle",Number),mt=x(ke,"spread",Number),st=x(ke,"startVelocity",Number),$=x(ke,"decay",Number),he=x(ke,"gravity",Number),xe=x(ke,"drift",Number),Me=x(ke,"colors",j),be=x(ke,"ticks",Number),U=x(ke,"shapes"),P=x(ke,"scalar"),L=!!x(ke,"flat"),H=_(ke),Z=Ge,Ae=[],je=b.width*H.x,Qe=b.height*H.y;Z--;)Ae.push(R({x:je,y:Qe,angle:ht,spread:mt,startVelocity:st,color:Me[Z%Me.length],shape:U[v(0,U.length)],ticks:be,decay:$,gravity:he,drift:xe,scalar:P,flat:L}));return de?de.addFettis(Ae):(de=Y(b,Ae,ie,Ve,We),de.promise)}function Ce(ke){var Ve=re||x(ke,"disableForReducedMotion",Boolean),We=x(ke,"zIndex",Number);if(Ve&&ae)return c(function(st){st()});D&&de?b=de.canvas:D&&!b&&(b=O(We),document.body.appendChild(b)),N&&!q&&ie(b);var Ge={width:b.width,height:b.height};G&&!q&&G.init(b),q=!0,G&&(b.__confetti_initialized=!0);function ht(){if(G){var st={getBoundingClientRect:function(){if(!D)return b.getBoundingClientRect()}};ie(st),G.postMessage({resize:{width:st.width,height:st.height}});return}Ge.width=Ge.height=null}function mt(){de=null,N&&(J=!1,t.removeEventListener("resize",ht)),D&&b&&(document.body.contains(b)&&document.body.removeChild(b),b=null,q=!1)}return N&&!J&&(J=!0,t.addEventListener("resize",ht,!1)),G?G.fire(ke,Ge,mt):me(ke,Ge,mt)}return Ce.reset=function(){G&&G.reset(),de&&de.reset()},Ce}var z;function W(){return z||(z=V(null,{useWorker:!0,resize:!0})),z}function B(b,C,D,N,J,re,ee){var G=new Path2D(b),ie=new Path2D;ie.addPath(G,new DOMMatrix(C));var q=new Path2D;return q.addPath(ie,new DOMMatrix([Math.cos(ee)*J,Math.sin(ee)*J,-Math.sin(ee)*re,Math.cos(ee)*re,D,N])),q}function M(b){if(!s)throw new Error("path confetti are not supported in this browser");var C,D;typeof b=="string"?C=b:(C=b.path,D=b.matrix);var N=new Path2D(C),J=document.createElement("canvas"),re=J.getContext("2d");if(!D){for(var ee=1e3,G=ee,ie=ee,q=0,ae=0,de,me,Ce=0;Ce<ee;Ce+=2)for(var ke=0;ke<ee;ke+=2)re.isPointInPath(N,Ce,ke,"nonzero")&&(G=Math.min(G,Ce),ie=Math.min(ie,ke),q=Math.max(q,Ce),ae=Math.max(ae,ke));de=q-G,me=ae-ie;var Ve=10,We=Math.min(Ve/de,Ve/me);D=[We,0,0,We,-Math.round(de/2+G)*We,-Math.round(me/2+ie)*We]}return{type:"path",path:C,matrix:D}}function I(b){var C,D=1,N="#000000",J='"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "EmojiOne Color", "Android Emoji", "Twemoji Mozilla", "system emoji", sans-serif';typeof b=="string"?C=b:(C=b.text,D="scalar"in b?b.scalar:D,J="fontFamily"in b?b.fontFamily:J,N="color"in b?b.color:N);var re=10*D,ee=""+re+"px "+J,G=new OffscreenCanvas(re,re),ie=G.getContext("2d");ie.font=ee;var q=ie.measureText(C),ae=Math.ceil(q.actualBoundingBoxRight+q.actualBoundingBoxLeft),de=Math.ceil(q.actualBoundingBoxAscent+q.actualBoundingBoxDescent),me=2,Ce=q.actualBoundingBoxLeft+me,ke=q.actualBoundingBoxAscent+me;ae+=me+me,de+=me+me,G=new OffscreenCanvas(ae,de),ie=G.getContext("2d"),ie.font=ee,ie.fillStyle=N,ie.fillText(C,Ce,ke);var Ve=1/D;return{type:"bitmap",bitmap:G.transferToImageBitmap(),matrix:[Ve,0,0,Ve,-ae*Ve/2,-de*Ve/2]}}n.exports=function(){return W().apply(this,arguments)},n.exports.reset=function(){W().reset()},n.exports.create=V,n.exports.shapeFromPath=M,n.exports.shapeFromText=I})(function(){return typeof window<"u"?window:typeof self<"u"?self:this||{}}(),$c,!1);const Yp=$c.exports;$c.exports.create;const nP={bill_view:3,bill_follow:5,manifesto_match_complete:10,voter_plan_save:8,forum_post:5,consultation_submit:10,petition_start:15,guide_view:2},Oj={bill_view:{en:"Read a bill summary",sw:"Soma muhtasari wa mswada"},bill_follow:{en:"Followed a bill",sw:"Ulifuata mswada"},manifesto_match_complete:{en:"Completed Pick & Vote",sw:"Ulimaliza Chagua na Upige Kura"},voter_plan_save:{en:"Saved voter registration plan",sw:"Ulihifadhi mpango wa usajili wa kupiga kura"},forum_post:{en:"Posted in a community forum",sw:"Ulichapisha katika jukwaa la jamii"},consultation_submit:{en:"Submitted a legal consultation",sw:"Uliwasilisha ushauri wa kisheria"}
650,petition_start:{en:"Started a petition draft",sw:"Ulianzisha rasimu ya ombi"},guide_view:{en:"Read a public participation guide",sw:"Ulisoma mwongozo wa ushiriki wa umma"}},sl=[{id:"starter",pointsRequired:0,title_en:"Starter Citizen",title_sw:"Raia Mwanzilishi",description_en:"Join CLICK and begin your civic journey.",description_sw:"Jiunge na CLICK uanze safari yako ya uraia.",reward_en:"Welcome badge",reward_sw:"Beji ya karibu",type:"standard"},{id:"bill_tracker",pointsRequired:50,title_en:"Bill Tracker",title_sw:"Mfuatiliaji wa Miswada",description_en:"Follow and read key bills affecting your life.",description_sw:"Fuata na soma miswada inayoathiri maisha yako.",reward_en:"Profile badge unlocked",reward_sw:"Beji ya wasifu imefunguliwa",type:"standard"},{id:"manifesto_explorer",pointsRequired:120,title_en:"Pick & Vote",title_sw:"Chagua na Upige Kura",description_en:"Complete Pick & Vote and reflect on priorities.",description_sw:"Maliza Chagua na Upige Kura na utafakari kipaumbele.",reward_en:"Bonus civic points",reward_sw:"Pointi za ziada za uraia",type:"standard"},{id:"uko_kadi_ready",pointsRequired:180,title_en:"Uko Kadi Ready",title_sw:"Uko Tayari kwa Kadi",description_en:"Prepare for voter registration and plan your visit.",description_sw:"Jiandae kwa usajili wa kupiga kura na panga ziara yako.",reward_en:"Reward eligibility unlocked",reward_sw:"Ustahiki wa zawadi umefunguliwa",type:"major"},{id:"civic_explorer",pointsRequired:220,title_en:"Civic Explorer",title_sw:"Mchunguzi wa Uraia",description_en:"Build steady, meaningful engagement across CLICK.",description_sw:"Jenga ushiriki thabiti na wenye maana kote CLICK.",reward_en:"Free data bundle eligibility",reward_sw:"Ustahiki wa kifungu cha data bure",type:"major"},{id:"policy_participant",pointsRequired:300,title_en:"Policy Participant",title_sw:"Mshiriki wa Sera",description_en:"Engage deeply with policies, events, and discussions.",description_sw:"Shiriki kwa kina na sera, matukio, na majadiliano.",reward_en:"Airtime / data reward tier",reward_sw:"Daraja la zawadi ya muda wa maongezi / data",type:"major"},{id:"community_voice",pointsRequired:450,title_en:"Community Voice",title_sw:"Sauti ya Jamii",description_en:"Become a visible and consistent civic participant.",description_sw:"Kuwa mshiriki anayeonekana na thabiti wa uraia.",reward_en:"Premium reward tier",reward_sw:"Daraja la zawadi la juu",type:"major"}],aP=[{id:"bill_tracker",earnedByActionKey:"bill_follow",name_en:"Bill Tracker",name_sw:"Mfuatiliaji wa Miswada",description_en:"You followed and explored key bills.",description_sw:"Ulifuata na kuchunguza miswada muhimu."},{id:"manifesto_explorer",earnedByActionKey:"manifesto_match_complete",name_en:"Pick & Vote",name_sw:"Chagua na Upige Kura",description_en:"You completed the blind manifesto game.",description_sw:"Ulimaliza Chagua na Upige Kura."},{id:"uko_kadi_ready",earnedByActionKey:"voter_plan_save",name_en:"Uko Kadi Ready",name_sw:"Uko Tayari kwa Kadi",description_en:"You prepared for voter registration.",description_sw:"Ulijiandaa kwa usajili wa kupiga kura."},{id:"community_voice",earnedByActionCount:10,name_en:"Community Voice",name_sw:"Sauti ya Jamii",description_en:"You consistently joined civic discussions.",description_sw:"Ulijiunga kwa kawaida na majadiliano ya uraia."},{id:"petition_starter",earnedByActionKey:"petition_start",name_en:"Petition Starter",name_sw:"Mwanzilishi wa Ombi",description_en:"You submitted your first petition.",description_sw:"Uliwasilisha ombi lako la kwanza."}],Jq=[{id:"read-bill",titleKey:"bill_view",en:"Read one bill summary",sw:"Soma muhtasari wa mswada mmoja"},{id:"follow-bill",titleKey:"bill_follow",en:"Follow one bill",sw:"Fuata mswada mmoja"},{id:"guide",titleKey:"guide_view",en:"Read a public participation guide",sw:"Soma mwongozo
650wa ushiriki wa umma"}];function iP(e){return sl.find(t=>t.pointsRequired>e)||null}function av(e){return[...sl].reverse().find(t=>e>=t.pointsRequired)||sl[0]}async function rP(e,t={}){const n=t.points??nP[e];try{const{data:a,error:i}=await te.rpc("award_civic_points",{_action_key:e,_points:n,_ref_type:t.refType??null,_ref_id:t.refId??null});return i?(console.warn("[civic] award_civic_points failed",e,i.message),0):Number(a)||0}catch(a){return console.warn("[civic] award_civic_points threw",a),0}}const Uc=()=>{const{user:e}=Rt(),[t,n]=p.useState({total_points:0,streak_days:0,actions_count:0}),[a,i]=p.useState([]),[r,s]=p.useState(!0),l=p.useCallback(async()=>{if(!e){n({total_points:0,streak_days:0,actions_count:0}),i([]),s(!1);return}s(!0);const[{data:u},{data:c}]=await Promise.all([te.rpc("get_civic_stats"),te.from("civic_actions").select("id, action_key, points, ref_type, ref_id, occurred_on, created_at").order("created_at",{ascending:!1}).limit(20)]);if(u&&Array.isArray(u)&&u[0]){const h=u[0];n({total_points:Number(h.total_points)||0,streak_days:Number(h.streak_days)||0,actions_count:Number(h.actions_count)||0})}c&&i(c),s(!1)},[e]);return p.useEffect(()=>{l()},[l]),{stats:t,actions:a,loading:r,refresh:l,isAuthenticated:!!e}},ol=Object.freeze(Object.defineProperty({__proto__:null,awardCivicPoints:rP,useCivicScore:Uc},Symbol.toStringTag,{value:"Module"})),sP="civic-milestones-celebrated",Qq=()=>{const e={spread:70,ticks:80,gravity:.9,scalar:1,zIndex:9999};Yp({...e,particleCount:80,origin:{x:.2,y:.7}}),Yp({...e,particleCount:80,origin:{x:.8,y:.7}}),setTimeout(()=>{Yp({...e,particleCount:60,origin:{x:.5,y:.6}})},200)},Xq=e=>{try{const t=localStorage.getItem(`${sP}:${e}`);return new Set(t?JSON.parse(t):[])}catch{return new Set}},Lj=(e,t)=>{try{localStorage.setItem(`${sP}:${e}`,JSON.stringify(Array.from(t)))}catch{}},Zq=()=>{const{stats:e,isAuthenticated:t,loading:n}=Uc(),{t:a,lang:i}=Re(),r=p.useRef(null),s=p.useRef(null);p.useEffect(()=>{var c;if(!t||n)return;let l=s.current;if(!l){try{const h=Object.keys(localStorage).filter(d=>d.startsWith("sb-")&&d.endsWith("-auth-token"));if(h.length){const d=JSON.parse(localStorage.getItem(h[0]));l=((c=d==null?void 0:d.user)==null?void 0:c.id)||"me"}}catch{}l=l||"me",s.current=l}const u=Xq(l);if(r.current!==l){let h=!1;for(const d of sl)d.pointsRequired!==0&&e.total_points>=d.pointsRequired&&!u.has(d.id)&&(u.add(d.id),h=!0);h&&Lj(l,u),r.current=l;return}for(const h of sl)if(h.pointsRequired!==0&&e.total_points>=h.pointsRequired&&!u.has(h.id)){u.add(h.id),Lj(l,u);const d=i==="en"?h.title_en:h.title_sw,m=i==="en"?h.description_en:h.description_sw;nn.success(a(`Milestone unlocked: ${d}`,`Hatua imefunguliwa: ${d}`),{description:m,duration:6e3}),Qq()}},[e.total_points,t,n,i,a])},Dj=[{path:"/",icon:y2,label_en:"Home",label_sw:"Nyumbani"},{path:"/bills",icon:Jn,label_en:"Bills",label_sw:"Miswada"},{path:"/budget",icon:yl,label_en:"Budget",label_sw:"Bajeti"},{path:"/my-money",icon:Ss,label_en:"Pesa Yangu",label_sw:"Pesa Yangu"},{path:"/uko-kadi",icon:nl,label_en:"Uko Kadi",label_sw:"Uko Kadi"},{path:"/manifesto-match",icon:Hn,label_en:"Pick & Vote",label_sw:"Pick & Vote"},{path:"/guides",icon:La,label_en:"Guides",label_sw:"Miongozo"},{path:"/events",icon:Xm,label_en:"Events",label_sw:"Matukio"},{path:"/civic-score",icon:Wn,label_en:"Score",label_sw:"Alama"}],eG=({children:e})=>{const t=Or(),{lang:n}=Re(),{user:a}=Rt(),[i,r]=p.useState(!1),[s,l]=p.useState(0),[u,c]=p.useState(!1);Zq(),p.useEffect(()=>{if(!a){r(!1);return}te.from("user_roles").select("role").eq("user_id",a.id).in("role",["legal","admin"]).then(({data:y})=>r(!!(y&&y.length>0)))},[a]),p.useEffect(()=>{let y=!1;const g=async()=>{const w=localStorage.getItem("menu_last_seen")||new Date(Date.now()-6048e5).toISOString(),{count:v}=await te.from("items").select("id",{count:"exact",head:!0}).gt("created_at",w);y||l(v||0)};g();const x=setInterval(g,6e4);return()=>{y=!0,clearInterval(x)}},[]);const h=y=>{y&&(localStorage.setItem("menu_last_seen",new Date().toISOString()),l(0))},d=()=>{c(!0),"vibrate"in navigator&&navigator.vibrate(10),setTimeout(()=>c(!1),400)},m=i?[...Dj,{path:"/lawyer",icon:Ft,label_en:"Legal",label_sw:"Kisheria"}]:Dj,f=t.pathname.startsWith("/admin");return o.jsxs("div",{className:"flex min-h-screen flex-col bg-background",children:[o.jsx("header",{className:"sticky top-0 z-50 border-b border-border/60 bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/80",children:o.jsxs("div",{className:"container flex h-14 items-center justify-between",children:[o.jsxs(Ue,{to:"/home",className:"flex items-center gap-2",children:[o.jsx("img",{src:V8,alt:"CLICK",className:"h-8 w-8 rounded-lg object-cover"}),o.jsx("span",{className:"font-heading text-lg font-bold text-foreground",children:"CLICK"})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(U8,{}),a?o.jsx(Ue,{to:"/settings",className:"rounded-full p-2 text-muted-foreground hover:bg-muted hover:text-foreground transition-colors",children:o.jsx(v2,{className:"h-4 w-4"})}):o.jsx(Ue,{to:"/welcome",children:o.jsxs(Q,{variant:"outline",size:"sm",className:"h-8 gap-1.5 text-xs font-medium",children:[o.jsx(w2,{className:"h-3.5 w-3.5"}),n==="en"?"Log in":"Ingia"]})})]})]})}),o.jsx("main",{className:"container flex-1 pb-20 pt-4",children:e}),!f&&o.jsx("div",{className:"fixed bottom-5 right-5 z-50",children:o.jsxs(KE,{onOpenChange:h,children:[o.jsx($E,{asChild:!0,children:o.jsxs(Q,{size:"lg",onPointerDown:d,className:"relative h-16 w-16 rounded-full p-0 bg-gradient-to-br from-primary via-primary to-accent text-primary-foreground shadow-[0_8px_24px_-4px_hsl(var(--primary)/0.55)] hover:shadow-[0_12px_28px_-4px_hsl(var(--primary)/0.7)] hover:scale-105 active:scale-90 transition-all duration-150 ring-2 ring-background","aria-label":n==="en"?"Open menu":"Fungua menyu",children:[o.jsx(SD,{className:"h-6 w-6"}),u&&o.jsx("span",{className:"absolute inset-0 rounded-full ring-4 ring-primary/40 animate-ping pointer-events-none"}),s>0&&o.jsx("span",{className:"absolute -top-1 -right-1 flex h-5 min-w-[20px] items-center justify-center rounded-full bg-destructive px-1.5 text-[10px] font-bold text-destructive-foreground ring-2 ring-background shadow-md animate-in zoom-in-50",children:s>9?"9+":s})]})}),o.jsxs(Rk,{align:"end",side:"top",sideOffset:12,className:"w-72 p-3 rounded-2xl border border-border/60 bg-popover/95 backdrop-blur-xl shadow-2xl max-h-[75vh] overflow-y-auto animate-in fade-in-0 zoom-in-95 slide-in-from-bottom-2",children:[o.jsxs("div",{className:"px-2 pb-2 pt-1",children:[o.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-widest text-muted-foreground",children:n==="en"?"Explore":"Chunguza"}),o.jsx("p",{className:"text-sm font-heading font-bold text-foreground mt-0.5",children:n==="en"?"Where to next?":"Twende wapi?"})]}),o.jsx(UE,{className:"mb-2"}),o.jsx("div",{className:"grid grid-cols-2 gap-2",children:m.map(y=>{const g=y.path==="/"?t.pathname==="/":t.pathname.startsWith(y.path);return o.jsx(Ik,{asChild:!0,className:"p-0 focus:bg-transparent",children:o.jsxs(Ue,{to:y.path,className:ce("flex flex-col items-center justify-center gap-1.5 rounded-xl px-2 py-3 text-xs font-medium cursor-pointer transition-all border",g?"bg-primary/10 text-primary border-primary/30 shadow-sm":"bg-card/40 text-foreground border-border/40 hover:bg-accent/15 hover:border-accent/40 hover:text-foreground hover:-translate-y-0.5"),children:[o.jsx("span",{className:ce("flex h-9 w-9 items-center justify-center rounded-lg transition-colors",g?"bg-primary/20":"bg-muted/60"),
650children:o.jsx(y.icon,{className:ce("h-4 w-4",g?"text-primary":"text-muted-foreground")})}),o.jsx("span",{className:"text-center leading-tight",children:n==="en"?y.label_en:y.label_sw})]})},y.path)})})]})]})}),a&&o.jsx(Yq,{})]})};async function tG(e){let t=te.from("items").select("*").eq("status","active").order("last_action_date",{ascending:!1});e&&(t=t.eq("type",e));const{data:n,error:a}=await t;if(a)throw a;return(n||[]).map(i=>({id:i.id,type:i.type,click_count:i.click_count||0,follower_count:i.follower_count||0,post_count:i.post_count||0,title_en:i.title_en||"",title_sw:i.title_sw||"",slug:i.slug||"",description_en:i.description_en||"",description_sw:i.description_sw||"",stage:i.stage||"draft",stage_history:i.stage_history||[],introduced_date:i.introduced_date||"",last_action_date:i.last_action_date||"",source_primary_name:i.source_primary_name||"",source_primary_url:i.source_primary_url||"",source_urls:i.source_urls||[],official_source_links:i.official_source_links||[],document_url:i.document_url||void 0,constitution_reference:i.constitution_reference||void 0,is_mock:i.is_mock||!1,status:i.status||"active",categories:i.categories||[]}))}function iv(e){return bl({queryKey:["items",e],queryFn:()=>tG(e),refetchInterval:6e4,refetchOnWindowFocus:!0})}function nG(e){return bl({queryKey:["item",e],queryFn:async()=>{const{data:t,error:n}=await te.from("items").select("*").eq("slug",e).single();if(n)throw n;return t},enabled:!!e})}const Se={constitution:{name:"Constitution of Kenya",name_sw:"Katiba ya Kenya",url:"https://www.parliament.go.ke/sites/default/files/2017-05/The_Constitution_of_Kenya_2010.pdf"},bills_tracker:{name:"Parliament Bills Tracker",name_sw:"Kifuatiliaji cha Miswada ya Bunge",url:"https://www.parliament.go.ke/the-national-assembly/house-business/bills-tracker"},kenya_law:{name:"Kenya Law Bills Database",name_sw:"Hifadhidata ya Miswada ya Sheria ya Kenya",url:"https://kenyalaw.org/bills/"},parliament:{name:"Kenya Parliament",name_sw:"Bunge la Kenya",url:"https://www.parliament.go.ke/"},parliament_bills:{name:"National Assembly Bills",name_sw:"Miswada ya Bunge la Taifa",url:"https://www.parliament.go.ke/the-national-assembly/house-business/bills"},senate_bills:{name:"Senate Bills",name_sw:"Miswada ya Seneti",url:"https://www.parliament.go.ke/the-senate/senate-bills"}},Eu=[{key:"draft",label_en:"Draft",label_sw:"Rasimu"},{key:"introduced",label_en:"Introduced",label_sw:"Imewasilishwa"},{key:"committee",label_en:"Committee",label_sw:"Kamati"},{key:"first_reading",label_en:"1st Reading",label_sw:"Usomaji 1"},{key:"second_reading",label_en:"2nd Reading",label_sw:"Usomaji 2"},{key:"third_reading",label_en:"3rd Reading",label_sw:"Usomaji 3"},{key:"passed",label_en:"Passed",label_sw:"Imepitishwa"},{key:"assent",label_en:"Assent",label_sw:"Idhini"}],hw=["Nairobi","Mombasa","Kisumu","Nakuru","Kiambu","Machakos","Kajiado","Uasin Gishu","Kilifi","Nyeri","Murang'a","Kakamega","Bungoma","Meru","Kwale","Laikipia","Nyandarua","Embu","Kitui","Makueni","Nandi","Baringo","Bomet","Kericho","Narok","Trans Nzoia","Elgeyo Marakwet","West Pokot","Samburu","Turkana","Marsabit","Isiolo","Garissa","Wajir","Mandera","Tana River","Lamu","Taita Taveta","Tharaka Nithi","Kirinyaga","Siaya","Homa Bay","Migori","Kisii","Nyamira","Vihiga","Busia"],rv=[{id:"cat-1",name_en:"Education",name_sw:"Elimu",slug:"education"},{id:"cat-2",name_en:"Jobs & Employment",name_sw:"Kazi na Ajira",slug:"jobs"},{id:"cat-3",name_en:"Health",name_sw:"Afya",slug:"health"},{id:"cat-4",name_en:"Cost of Living",name_sw:"Gharama ya Maisha",slug:"cost-of-living"},{id:"cat-5",name_en:"Tax",name_sw:"Kodi",slug:"tax"},{id:"cat-6",name_en:"Transport",name_sw:"Usafiri",slug:"transport"},{id:"cat-7",name_en:"Digital Rights",name_sw:"Haki za Dijitali",slug:"digital-rights"},{id:"cat-8",name_en:"Environment",name_sw:"Mazingira",slug:"environment"},{id:"cat-9",name_en:"Housing",name_sw:"Makazi",slug:"housing"},{id:"cat-10",name_en:"Governance",name_sw:"Utawala",slug:"governance"}],as=[{id:"item-1",type:"bill",title_en:"Digital Economy Bill, 2025",title_sw:"Mswada wa Uchumi wa Dijitali, 2025",slug:"digital-economy-bill-2025",description_en:"A bill to regulate the digital economy including gig workers, data protection, and AI governance.",description_sw:"Mswada wa kudhibiti uchumi wa dijitali ikiwemo wafanyakazi wa gig, ulinzi wa data, na utawala wa AI.",stage:"committee",stage_history:[{stage:"draft",date:"2025-01-15"},{stage:"introduced",date:"2025-02-10"},{stage:"committee",date:"2025-03-01"}],introduced_date:"2025-02-10",last_action_date:"2025-03-01",source_primary_name:"Kenya Parliament",source_primary_url:"https://parliament.go.ke",source_urls:[{name:"Kenya Gazette",url:"https://kenyalaw.org"}],official_source_links:[{name:"Parliament Bills Tracker",url:Se.bills_tracker.url},{name:"Kenya Law",url:Se.kenya_law.url}],document_url:"https://www.parliament.go.ke/the-national-assembly/house-business/bills-tracker",constitution_reference:"Article 33 â Freedom of Expression",is_mock:!0,status:"active",categories:["digital-rights","jobs"]},{id:"item-2",type:"bill",title_en:"Youth Employment & Enterprise Fund Bill, 2025",title_sw:"Mswada wa Mfuko wa Ajira na Biashara ya Vijana, 2025",slug:"youth-employment-fund-bill-2025",description_en:"Proposes a new fund to finance youth-led businesses and create job placement programs.",description_sw:"Unapendekeza mfuko mpya wa kufadhili biashara zinazoongozwa n
650a vijana na kuunda programu za uwekaji kazi.",stage:"first_reading",stage_history:[{stage:"draft",date:"2024-11-20"},{stage:"introduced",date:"2025-01-05"},{stage:"committee",date:"2025-01-28"},{stage:"first_reading",date:"2025-02-20"}],introduced_date:"2025-01-05",last_action_date:"2025-02-20",source_primary_name:"Kenya Parliament",source_primary_url:"https://parliament.go.ke",source_urls:[],official_source_links:[{name:"Parliament Bills Tracker",url:Se.bills_tracker.url}],document_url:"https://www.parliament.go.ke/the-national-assembly/house-business/bills-tracker",constitution_reference:"Article 55 â Affirmative Action for Youth",is_mock:!0,status:"active",categories:["jobs","governance"]},{id:"item-3",type:"bill",title_en:"Affordable Housing Levy (Amendment) Bill, 2025",title_sw:"Mswada wa Marekebisho ya Tozo ya Makazi Nafuu, 2025",slug:"affordable-housing-levy-amendment-2025",description_en:"Amends the affordable housing levy to increase transparency and youth access to housing units.",description_sw:"Inarekebisha tozo ya makazi nafuu kuongeza uwazi na ufikiaji wa vijana kwa vitengo vya makazi.",stage:"second_reading",stage_history:[{stage:"draft",date:"2024-09-01"},{stage:"introduced",date:"2024-10-15"},{stage:"committee",date:"2024-12-01"},{stage:"first_reading",date:"2025-01-10"},{stage:"second_reading",date:"2025-02-28"}],introduced_date:"2024-10-15",last_action_date:"2025-02-28",source_primary_name:"National Assembly",source_primary_url:"https://parliament.go.ke",source_urls:[],official_source_links:[{name:"Parliament Bills Tracker",url:Se.bills_tracker.url},{name:"Kenya Law",url:Se.kenya_law.url}],document_url:"https://kenyalaw.org/bills/",constitution_reference:"Article 43(1)(b) â Right to Accessible Housing",is_mock:!0,status:"active",categories:["housing","cost-of-living","tax"]},{id:"item-4",type:"bill",title_en:"Climate Change (Amendment) Bill, 2025",title_sw:"Mswada wa Marekebisho ya Mabadiliko ya Tabianchi, 2025",slug:"climate-change-amendment-2025",description_en:"Introduces carbon credits for youth-led environmental projects and green job incentives.",description_sw:"Inatambulisha mikopo ya kaboni kwa miradi ya mazingira inayoongozwa na vijana na motisha za kazi za kijani.",stage:"draft",stage_history:[{stage:"draft",date:"2025-02-15"}],introduced_date:"2025-02-15",last_action_date:"2025-02-15",source_primary_name:"Senate",source_primary_url:"https://parliament.go.ke",source_urls:[],official_source_links:[{name:"Kenya Law",url:Se.kenya_law.url}],constitution_reference:"Article 42 â Right to a Clean Environment",is_mock:!0,status:"active",categories:["environment","jobs"]},{id:"item-5",type:"bill",title_en:"Social Health Insurance Bill, 2025",title_sw:"Mswada wa Bima ya Afya ya Jamii, 2025",slug:"social-health-insurance-bill-2025",description_en:"Replaces NHIF with a new universal health coverage framework with reduced premiums for youth.",description_sw:"Inabadilisha NHIF na mfumo mpya wa bima ya afya kwa wote na malipo nafuu kwa vijana.",stage:"passed",stage_history:[{stage:"draft",date:"2024-06-01"},{stage:"introduced",date:"2024-08-01"},{stage:"committee",date:"2024-09-15"},{stage:"first_reading",date:"2024-10-20"},{stage:"second_reading",date:"2024-12-05"},{stage:"third_reading",date:"2025-01-15"},{stage:"passed",date:"2025-02-01"}],introduced_date:"2024-08-01",last_action_date:"2025-02-01",source_primary_name:"Kenya Parliament",source_primary_url:"https://parliament.go.ke",source_urls:[],official_source_links:[{name:"Parliament Bills Tracker",url:Se.bills_tracker.url},{name:"Kenya Law",url:Se.kenya_law.url}],document_url:"https://kenyalaw.org/bills/",constitution_reference:"Article 43(1)(a) â Right to Health",is_mock:!0,status:"active",categories:["health","cost-of-living"]},{id:"item-6",type:"bill",title_en:"Public Transport Regulation Bill, 2025",title_sw:"Mswada wa Udhibiti wa Usafiri wa Umma, 2025",slug:"public-transport-regulation-2025",description_en:"Regulates matatu fares and introduces digital ticketing for public transport.",description_sw:"Inadhibiti nauli za matatu na kuanzisha tiketi za dijitali kwa usafiri wa umma.",stage:"introduced",stage_history:[{stage:"draft",date:"2025-01-01"},{stage:"introduced",date:"2025-02-15"}],introduced_date:"2025-02-15",last_action_date:"2025-02-15",source_primary_name:"National Assembly",source_primary_url:"https://parliament.go.ke",source_urls:[],official_source_links:[{name:"Parliament Bills Tracker",url:Se.bills_tracker.url}],is_mock:!0,status:"active",categories:["transport","digital-rights"]},{id:"item-7",type:"bill",title_en:"University Education (Amendment) Bill, 2025",title_sw:"Mswada wa Marekebisho ya Elimu ya Chuo Kikuu, 2025",slug:"university-education-amendment-2025",description_en:"Reforms HELB repayment and introduces income-based repayment for graduates.",description_sw:"Inarekebisha ulipaji wa HELB na kuanzisha ulipaji kulingana na mapato kwa wahitimu.",stage:"committee",stage_history:[{stage:"draft",date:"2024-12-01"},{stage:"introduced",date:"2025-01-20"},{stage:"committee",date:"2025-02-25"}],introduced_date:"2025-01-20",last_action_date:"2025-02-25",source_primary_name:"Senate",source_primary_url:"https://parliament.go.ke",source_urls:[],official_source_links:[{name:"Parliament Bills Tracker",url:Se.bills_tracker.url},{name:"Kenya Law",url:Se.kenya_law.url}],document_url:"https://kenyalaw.org/bills/",constitution_reference:"Article 43(1)(f) â Right to Education",is_mock:!0,status:"active",categories:["education","cost-of-living"]},{id:"item-8",type:"bill",title_en:"Data Protection (Amendment) Bill, 2025",title_sw:"Mswada wa Marekebisho ya Ulinzi wa Data, 2025",slug:"data-protection-amendment-2025",description_en:"Strengthens data privacy laws, regulates AI data collection, and protects minors online.",description_sw:"Inaimarisha sheria za faragha ya data, inadhibiti ukusanyaji wa data ya AI, na inalinda watoto mtandaoni.",stage:"draft",stage_history:[{stage:"draft",date:"2025-02-28"}],introduced_date:"2025-02-28",last_action_date:"2025-02-28",source_primary_name:"Kenya Parliament",source_primary_url:"https://parliament.go.ke",source_urls:[],official_source_links:[{name:"Kenya Law",url:Se.kenya_law.url}],constitution_reference:"Article 31 â Right to Privacy",is_mock:!0,status:"active",categories:["digital-rights","governance"]},{id:"item-9",type:"bill",title_en:"Finance Bill, 2025",title_sw:"Mswada wa Fedha, 2025",slug:"finance-bill-2025",description_en:"Annual finance bill proposing new tax measures including digital service tax increases.",description_sw:"Mswada wa fedha wa kila mwaka unaopendekeza hatua mpya za kodi ikiwa ni pamoja na ongezeko la kodi ya huduma za dijitali.",stage:"first_reading",stage_history:[{stage:"draft",date:"2025-01-10"},{stage:"introduced",date:"2025-02-01"},{stage:"first_reading",date:"2025-02-25"}],introduced_date:"2025-02-01",last_action_date:"2025-02-25",source_primary_name:"National Assembly",source_primary_url:"https://parliament.go.ke",source_urls:[],official_source_links:[{name:"Parliament Bills Tracker",url:Se.bills_tracker.url},{name:"Kenya Law",url:Se.kenya_law.url}],document_url:"https://www.parliament.go.ke/the-national-assembly/house-business/bills-tracker",constitution_reference:"Article 114 â Money Bills",is_mock:!0,status:"active",categories:["tax","cost-of-living"]},{id:"item-10",type:"bill",title_en:"Mental Health Bill, 2025",title_sw:"Mswada wa Afya ya Akili, 2025",slug:"mental-health-bill-2025",description_en:"Establishes a framework for mental health services with special provisions for youth.",description_sw:"Unaweka mfumo wa huduma za afya ya akili na masharti maalum kwa vijana.",stage:"introduced",stage_history:[{stage:"draft",date:"2025-01-05"},{stage:"introduced",date:"2025-02-18"}],introduced_date:"2025-02-18",last_action_date:"2025-02-18",source_primary_name:"Senate",source_primary_url:"https://parliament.go.ke",source_urls:[],official_source_links:[{name:"Parliament Bills Tracker",url:Se.bills_tracker.url}],document_url:"https://www.parliament.go.ke/the-national-assembly/house-business/bills-tracker",constitution_reference:"Article 43(1)(a) â Right to Health",is_mock:!0,status:"active",categories:["health"]},{id:"item-b1",type:"budget",title_en:"Budget Policy Statement 2025/2026",title_sw:"Taarifa ya Sera ya Bajeti 2025/2026",slug:"budget-policy-statement-2025-2026",description_en:"The government's annual budget policy statement outlining spending priorities and revenue projections.",description_sw:"Taarifa ya sera ya bajeti ya serikali ya kila mwaka inayoelezea vipaumbele vya matumizi na makadirio ya mapato.",stage:"committee",stage_history:[{stage:"draft",date:"2025-01-15"},{stage:"introduced",date:"2025-02-01"},{stage:"committee",date:"2025-02-20"}],introduced_date:"2025-02-01",last_action_date:"2025-02-20",source_primary_name:"National Treasury",source_primary_url:"https://treasury.go.ke",source_urls:[],official_source_links:[{name:"National Treasury",url:"https://treasury.go.ke"},{name:"Parliament Bills Tracker",url:Se.bills_tracker.url}],document_url:"https://treasury.go.ke",is_mock:!0,status:"active",categories:["tax","governance"]},{id:"item-b2",type:"budget",title_en:"County Allocation Revenue Bill, 2025",title_sw:"Mswada wa Mgawanyo wa Mapato ya Kaunti, 2025",slug:"county-allocation-revenue-2025",description_en:"Determines how national revenue is shared among the 47 counties.",description_sw:"Inaamua jinsi mapato ya kitaifa yanavyogawanywa kati ya kaunti 47.",stage:"first_reading",stage_history:[{stage:"draft",date:"2025-01-20"},{stage:"introduced",date:"2025-02-05"},{stage:"first_reading",date:"2025-02-28"}],introduced_date:"2025-02-05",last_action_date:"2025-02-28",source_primary_name:"National Treasury",source_primary_url:"https://treasury.go.ke",source_urls:[],official_source_links:[{name:"National Treasury",url:"https://treasury.go.ke"},{name:"Parliament Bills Tracker",url:Se.bills_tracker.url}],constitution_reference:"Article 218 â County Revenue Allocation",is_mock:!0,status:"active",categories:["governance","cost-of-living"]},{id:"item-b3",type:"budget",title_en:"Supplementary Budget Estimates 2024/2025",title_sw:"Makadirio ya Bajeti ya Nyongeza 2024/2025",slug:"supplementary-budget-estimates-2024-2025",description_en:"Revised budget allocations for the current financial year including youth fund additions.",description_sw:"Mgawanyo wa bajeti uliorekebishwa kwa mwaka wa fedha wa sasa ikiwa ni pamoja na nyongeza za mfuko wa vijana.",stage:"passed",stage_history:[{stage:"draft",date:"2024-11-01"},{stage:"introduced",date:"2024-12-01"},{stage:"committee",date:"2025-01-10"},{stage:"first_reading",date:"2025-01-25"},{stage:"passed",date:"2025-02-10"}],introduced_date:"2024-12-01",last_action_date:"2025-02-10",source_primary_name:"National Treasury",source_primary_url:"https://treasury.go.ke",source_urls:[],official_source_links:[{name:"National Treasury",url:"https://treasury.go.ke"}],is_mock:!0,status:"active",categories:["governance","jobs"]},{id:"item-b4",type:"budget",title_en:"National Education Budget Review 2025/2026",title_sw:"Mapitio ya Bajeti ya Elimu ya Kitaifa 2025/2026",slug:"education-budget-review-2025-2026",description_en:"Review of education sector allocations including HELB funding, university capitation, and TVET expansion.",description_sw:"Mapitio ya mgawo wa sekta ya elimu ikiwa ni pamoja na ufadhili wa HELB, ruzuku ya chuo kikuu, na upanuzi wa TVET.",stage:"draft",stage_history:[{stage:"draft",date:"2025-02-25"}],introduced_date:"2025-02-25",last_action_date:"2025-02-25",source_primary_name:"National Treasury",source_primary_url:"https://treasury.go.ke",source_urls:[],official_source_links:[{name:"National Treasury",url:"https://treasury.go.ke"},{name:"Parliament Bills Tracker",url:Se.bills_tracker.url}],document_url:"https://treasury.go.ke",constitution_reference:"Article 43(1)(f) â Right to Education",is_mock:!0,status:"active",categories:["education","governance"]}],uu={"item-1":{id:"sum-1",item_id:"item-1",summary_en:"Regulates gig work, data privacy, and AI governance to protect digital workers and consumers.",summary_sw:"Inadhibiti kazi za gig, faragha ya data, na utawala wa AI kulinda wafanyakazi wa dijitali na watumiaji.",onepager_en:{what_it_is:"A comprehensive bill to regulate Kenya's growing digital economy, covering gig workers, data protection, and artificial intelligence.",what_changes:"Gig workers get minimum wage protections, companies must comply with stricter data rules, AI systems require government approval.",who_affected:"Freelancers, gig workers (Uber, Bolt drivers, online workers), tech companies, and anyone using digital services.",youth_impacts:["Gig workers aged 18-35 will get minimum wage protections","Student data in e-learning platforms will be better protected","New digital skills certification programs to be funded","AI job displacement concerns addressed with retraining provisions"],what_next:"Committee stage ongoing. Public participation deadline: March 15, 2025. Expected second reading: April 2025.",sources:[{name:"Kenya Parliament",url:"https://parliament.go.ke"},{name:"Parliament Bills Tracker",url:Se.bills_tracker.url}]},onepager_sw:{what_it_is:"Mswada wa kina wa kudhibiti uchumi wa dijitali unaokua nchini Kenya, unaoshughulikia wafanyakazi wa gig, ulinzi wa data, na akili bandia.",what_changes:"Wafanyakazi wa gig wanapata ulinzi wa mshahara wa chini, makampuni lazima y
650azingatie sheria kali za data, mifumo ya AI inahitaji idhini ya serikali.",who_affected:"Wafanyakazi huru, wafanyakazi wa gig (madereva wa Uber, Bolt, wafanyakazi wa mtandaoni), makampuni ya teknolojia, na mtu yeyote anayetumia huduma za dijitali.",youth_impacts:["Wafanyakazi wa gig wenye umri wa miaka 18-35 watapata ulinzi wa mshahara wa chini","Data ya wanafunzi katika majukwaa ya e-learning italindwa zaidi","Programu mpya za uthibitisho wa ujuzi wa dijitali zitafadhiliwa","Wasiwasi wa kupoteza kazi kwa AI unashughulikiwa na masharti ya mafunzo upya"],what_next:"Hatua ya kamati inaendelea. Tarehe ya mwisho ya ushiriki wa umma: Machi 15, 2025. Usomaji wa pili unaotarajiwa: Aprili 2025.",sources:[{name:"Bunge la Kenya",url:"https://parliament.go.ke"},{name:"Kifuatiliaji cha Miswada",url:Se.bills_tracker.url}]},excerpt_highlights:[{text_en:'"Every gig worker shall be entitled to a minimum hourly rate as determined by the Digital Economy Board."',text_sw:'"Kila mfanyakazi wa gig atastahili kiwango cha chini cha saa kama inavyoamuliwa na Bodi ya Uchumi wa Dijitali."'},{text_en:'"AI systems deployed in public services shall undergo mandatory impact assessments."',text_sw:'"Mifumo ya AI inayotumika katika huduma za umma itafanyiwa tathmini za lazima za athari."'}],youth_impacts_en:["Gig worker protections","Data privacy for students","Digital skills funding","AI job retraining"],youth_impacts_sw:["Ulinzi wa wafanyakazi wa gig","Faragha ya data kwa wanafunzi","Ufadhili wa ujuzi wa dijitali","Mafunzo upya ya kazi za AI"],confidence_score:.85,generated_at:"2025-03-01T10:00:00Z",model_name:"gemini-2.5-flash"},"item-2":{id:"sum-2",item_id:"item-2",summary_en:"Creates a dedicated fund for youth businesses and job placement with county-level distribution.",summary_sw:"Inaunda mfuko maalum wa biashara za vijana na uwekaji wa kazi na usambazaji wa ngazi ya kaunti.",onepager_en:{what_it_is:"A bill creating a new national fund specifically for financing youth-led businesses and employment programs.",what_changes:"New KSh 10B fund for youth enterprises, county-level distribution, simplified loan applications, mentorship requirements.",who_affected:"Youth aged 18-35, small business owners, county governments, financial institutions.",youth_impacts:["Direct access to startup capital without traditional collateral","Mandatory county-level fund distribution ensures rural youth access","Built-in mentorship and business training programs","Digital application process eliminates bureaucracy"],what_next:"First reading completed. Second reading expected March 2025.",sources:[{name:"Kenya Parliament",url:"https://parliament.go.ke"},{name:"Parliament Bills Tracker",url:Se.bills_tracker.url}]},onepager_sw:{what_it_is:"Mswada wa kuunda mfuko mpya wa kitaifa hasa kwa kufadhili biashara zinazoongozwa na vijana na programu za ajira.",what_changes:"Mfuko mpya wa KSh 10B kwa biashara za vijana, usambazaji wa ngazi ya kaunti, maombi ya mkopo yaliyorahisishwa, mahitaji ya ushauri.",who_affected:"Vijana wenye umri wa miaka 18-35, wamiliki wa biashara ndogo, serikali za kaunti, taasisi za fedha.",youth_impacts:["Ufikiaji wa moja kwa moja wa mtaji wa kuanzisha bila dhamana ya jadi","Usambazaji wa lazima wa mfuko wa ngazi ya kaunti unahakikisha ufikiaji wa vijana wa vijijini","Programu za ushauri na mafunzo ya biashara zilizojengwa ndani","Mchakato wa maombi ya dijitali unaondoa urasimu"],what_next:"Usomaji wa kwanza umekamilika. Usomaji wa pili unatarajiwa Machi 2025.",sources:[{name:"Bunge la Kenya",url:"https://parliament.go.ke"},{name:"Kifuatiliaji cha Miswada",url:Se.bills_tracker.url}]},excerpt_highlights:[{text_en:'"The Fund shall allocate no less than 30% of its annual disbursements to enterprises in rural areas."',text_sw:'"Mfuko utagawa si chini ya 30% ya malipo yake ya kila mwaka kwa biashara katika maeneo ya vijijini."'}],youth_impacts_en:["Startup capital access","Rural youth inclusion","Business mentorship","Digital applications"],youth_impacts_sw:["Ufikiaji wa mtaji wa kuanzisha","Ujumuishaji wa vijana wa vijijini","Ushauri wa biashara","Maombi ya dijitali"],confidence_score:.9,generated_at:"2025-03-01T10:00:00Z",model_name:"gemini-2.5-flash"}},jf=[{id:"evt-1",title:"Digital Economy Bill Public Participation",description:"Public hearing on the Digital Economy Bill. All citizens invited to submit views.",county:"Nairobi",city:"Nairobi CBD",location_text:"Parliament Buildings, Main Hall",start_time:"2025-03-15T09:00:00Z",end_time:"2025-03-15T17:00:00Z",organizer:"National Assembly",event_type:"public_participation",verification_status:"verified",created_at:"2025-02-28T10:00:00Z"},{id:"evt-2",title:"Youth Budget Forum - Mombasa",description:"County-level forum for youth to discu
650ss budget priorities and allocations.",county:"Mombasa",city:"Mombasa",location_text:"Mombasa County Hall",start_time:"2025-03-20T10:00:00Z",end_time:"2025-03-20T16:00:00Z",organizer:"Youth Senate Caucus",event_type:"community_discussion",verification_status:"verified",created_at:"2025-03-01T08:00:00Z"},{id:"evt-3",title:"Finance Bill Town Hall - Kisumu",description:"Open town hall to discuss the Finance Bill 2025 and its impact on youth.",county:"Kisumu",city:"Kisumu",location_text:"Kisumu Social Centre",start_time:"2025-03-22T14:00:00Z",end_time:"2025-03-22T18:00:00Z",organizer:"Civil Society Coalition",event_type:"community_discussion",verification_status:"verified",created_at:"2025-03-02T10:00:00Z"},{id:"evt-4",title:"Housing Levy Protest March",description:"Peaceful march against the Affordable Housing Levy. Starting from Uhuru Park.",county:"Nairobi",city:"Nairobi",location_text:"Uhuru Park to Parliament",start_time:"2025-03-18T08:00:00Z",end_time:"2025-03-18T13:00:00Z",organizer:"Youth Against Housing Levy",event_type:"community_discussion",verification_status:"verified",created_at:"2025-03-01T12:00:00Z"},{id:"evt-5",title:"Mental Health Bill Awareness Walk",description:"Walk to raise awareness about the Mental Health Bill and youth mental health.",county:"Nakuru",city:"Nakuru",location_text:"Nakuru Athletics Club",start_time:"2025-03-25T07:00:00Z",organizer:"Youth Mental Health Kenya",event_type:"informational",verification_status:"verified",created_at:"2025-03-03T09:00:00Z"},{id:"evt-6",title:"Digital Rights Workshop",description:"Learn about your digital rights and how the Data Protection Bill affects you.",county:"Nairobi",city:"Nairobi",location_text:"iHub, Senteu Plaza",start_time:"2025-03-28T10:00:00Z",end_time:"2025-03-28T15:00:00Z",organizer:"KICTANet",event_type:"informational",verification_status:"pending",created_at:"2025-03-04T10:00:00Z"},{id:"evt-7",title:"HELB Repayment Forum",description:"Discussion on HELB reforms and income-based repayment under the new bill.",county:"Kiambu",city:"Thika",location_text:"Mt. Kenya University, Thika Campus",start_time:"2025-04-01T09:00:00Z",end_time:"2025-04-01T13:00:00Z",organizer:"Student Unions Coalition",event_type:"public_participation",verification_status:"pending",created_at:"2025-03-05T08:00:00Z"},{id:"evt-8",title:"Climate Change Youth Summit",description:"Youth-led summit on climate action and the Climate Change Amendment Bill.",county:"Nairobi",city:"Nairobi",location_text:"KICC, Amphitheatre",start_time:"2025-04-05T08:00:00Z",end_time:"2025-04-05T17:00:00Z",organizer:"Green Generation Kenya",event_type:"community_discussion",verification_status:"verified",created_at:"2025-03-01T10:00:00Z"}],aG=[{id:"qa-1",question_en:"What happens when a bill is at the committee stage?",question_sw:"Nini kinatokea mswada unapokuwa katika hatua ya kamati?",answer_en:"At the committee stage, a parliamentary committee reviews the bill in detail. They can invite experts, hold public hearings, and propose amendments. The committee then reports back to the full House with recommendations.",answer_sw:"Katika hatua ya kamati, kamati ya bunge inapitia mswada kwa undani. Wanaweza kualika wataalam, kufanya vikao vya umma, na kupendekeza marekebisho. Kisha kamati inaripoti kwa Bunge kamili na mapendekezo.",related_bill_ids:["item-1","item-7"],reference_links:[{name:"Constitution of Kenya â Article 118",url:Se.constitution.url},{name:"Parliament Bills Tracker",url:Se.bills_tracker.url}],is_verified:!0},{id:"qa-2",question_en:"Can I participate in public hearings for a bill?",question_sw:"Je, ninaweza kushiriki katika vikao vya umma kwa mswada?",answer_en:"Yes! Article 118 of the Constitution guarantees public participation in the legislative process. When a bill is at the committee stage, the public is often invited to submit written memoranda or attend public hearings. Check the Parliament website for schedules.",answer_sw:"Ndiyo! Ibara ya 118 ya Katiba inadhahimisha ushiriki wa umma katika mchakato wa kutunga sheria. Wakati mswada uko katika hatua ya kamati, umma mara nyingi unaalikwa kuwasilisha memoranda za maandishi au kuhudhuria vikao vya umma.",related_bill_ids:["item-3"],reference_links:[{name:"Constitution of Kenya â Article 118",url:Se.constitution.url},{name:"Parliament Bills Tracker",url:Se.bills_tracker.url}],is_verified:!0},{id:"qa-3",question_en:"How does the Finance Bill affect my taxes?",question_sw:"Mswada wa Fedha unaathirije kodi zangu?",answer_en:"The Finance Bill typically introduces changes to VAT, income tax, excise duty, and other levies. For 2025, proposed changes include increased digital service tax and new environmental levies. These directly affect the cost of goods and services.",answer_sw:"Mswada wa Fedha kawaida huleta mabadiliko ya VAT, kodi ya mapato, ushuru wa bidhaa, na tozo nyingine. Kwa 2025, mabadiliko yanayopendekezwa ni pamoja na ongezeko la kodi ya huduma za dijitali na tozo mpya za mazingira.",related_bill_ids:["item-9"],reference_links:[{name:"Kenya Law",url:Se.kenya_law.url},{name:"Constitution â Article 114 (Money Bills)",url:Se.constitution.url}],is_verified:!0},{id:"qa-4",question_en:"What is the Affordable Housing Levy and is it mandatory?",question_sw:"Tozo ya Makazi Nafuu ni nini na je, ni ya lazima?",answer_en:"The Affordable Housing Levy is a 1.5% deduction from gross salary (matched by employers) used to fund affordable housing. It was introduced under the Affordable Housing Act, 2024. The amendment bill seeks to add transparency on how funds are used and improve youth access.",answer_sw:"Tozo ya Makazi Nafuu ni makato ya 1.5% kutoka mshahara ghafi (inayolingana na waajiri) inayotumika kufadhili makazi nafuu. Ilianzishwa chini ya Sheria ya Makazi Nafuu, 2024. Mswada wa marekebisho unalenga kuongeza uwazi wa jinsi fedha zinavyotumika.",related_bill_ids:["item-3"],reference_links:[{name:"Kenya Law",url:Se.kenya_law.url},{name:"Constitution â Article 43(1)(b)",url:Se.constitution.url}],is_verified:!0},{id:"qa-5",question_en:"How will HELB repayment change under the new bill?",question_sw:"Ulipaji wa HELB utabadilishwaje chini ya mswada mpya?",answer_en:"The University Education (Amendment) Bill proposes income-based repayment: graduates earning below KSh 50,
650000/month would pay reduced rates, with a grace period of 1 year after graduation. Self-employed graduates would have flexible schedules.",answer_sw:"Mswada wa Marekebisho ya Elimu ya Chuo Kikuu unapendekeza ulipaji kulingana na mapato: wahitimu wanaopata chini ya KSh 50,000/mwezi watalipa viwango vilivyopunguzwa, na muda wa rehema wa mwaka 1 baada ya kuhitimu.",related_bill_ids:["item-7"],reference_links:[{name:"Parliament Bills Tracker",url:Se.bills_tracker.url},{name:"Constitution â Article 43(1)(f)",url:Se.constitution.url}],is_verified:!0},{id:"qa-6",question_en:"What rights do gig workers have under Kenyan law?",question_sw:"Wafanyakazi wa gig wana haki gani chini ya sheria ya Kenya?",answer_en:"Currently, gig workers have limited protections as they are classified as independent contractors. The Digital Economy Bill seeks to change this by guaranteeing minimum hourly rates, access to social protection, and dispute resolution mechanisms.",answer_sw:"Kwa sasa, wafanyakazi wa gig wana ulinzi mdogo kwani wanainishwa kama wakandarasi huru. Mswada wa Uchumi wa Dijitali unalenga kubadilisha hili kwa kudhamini viwango vya chini vya saa, ufikiaji wa ulinzi wa kijamii, na taratibu za utatuzi wa migogoro.",related_bill_ids:["item-1"],reference_links:[{name:"Kenya Law",url:Se.kenya_law.url},{name:"Constitution â Article 41 (Labour Relations)",url:Se.constitution.url}],is_verified:!0},{id:"qa-7",question_en:"How are county budgets decided?",question_sw:"Bajeti za kaunti zinaamuliwaje?",answer_en:"County budgets are determined through the County Allocation of Revenue Act, based on the formula recommended by the Commission on Revenue Allocation (CRA). The Constitution requires at least 15% of national revenue to go to counties.",answer_sw:"Bajeti za kaunti zinaamuliwa kupitia Sheria ya Mgawanyo wa Mapato ya Kaunti, kulingana na formula inayopendekezwa na Tume ya Mgawanyo wa Mapato (CRA). Katiba inahitaji angalau 15% ya mapato ya kitaifa kwenda kwa kaunti.",related_bill_ids:["item-b2"],reference_links:[{name:"Constitution â Article 203",url:Se.constitution.url},{name:"Parliament Bills Tracker",url:Se.bills_tracker.url}],is_verified:!0},{id:"qa-8",question_en:"What does the Constitution say about youth rights?",question_sw:"Katiba inasema nini kuhusu haki za vijana?",answer_en:"Article 55 of the Constitution specifically addresses youth: the State shall take measures to ensure youth access to relevant education, training, employment, and participation in governance. Article 97 also encourages youth representation in Parliament.",answer_sw:"Ibara ya 55 ya Katiba inashughulikia vijana hasa: Serikali itachukua hatua kuhakikisha vijana wanapata elimu, mafunzo, ajira, na ushiriki katika utawala. Ibara ya 97 pia inahimiza uwakilishi wa vijana Bungeni.",related_bill_ids:["item-2"],reference_links:[{name:"Constitution of Kenya â Article 55",url:Se.constitution.url},{name:"Kenya Law",url:Se.kenya_law.url}],is_verified:!0}];function iG(e){return uu[e]}const rG={draft:"bg-secondary/20 text-secondary",introduced:"bg-info/15 text-info",committee:"bg-info/15 text-info",first_reading:"bg-warning/15 text-warning",second_reading:"bg-warning/15 text-warning",third_reading:"bg-warning/15 text-warning",passed:"bg-success/15 text-success",assent:"bg-primary/15 text-primary"},Vc=({stage:e})=>{const{lang:t}=Re(),n=Eu.find(i=>i.key===e),a=t==="en"?n==null?void 0:n.label_en:n==null?void 0:n.label_sw;return o.jsx("span",{className:ce("stage-badge",rG[e]),children:a})},sG=({history:e,currentStage:t})=>{const{lang:n}=Re(),a=Eu.findIndex(i=>i.key===t);return o.jsx("div",{className:"flex items-center gap-1 overflow-x-auto py-2",children:Eu.map((i,r)=>{const s=e.find(c=>c.stage===i.key),l=r<=a&&s,u=i.key===t;return o.jsxs("div",{className:"flex items-center",children:[o.jsxs("div",{className:"flex flex-col items-center",children:[o.jsx("div",{className:ce("h-3 w-3 rounded-full border-2 transition-colors",l?"border-primary bg-primary":"border-muted-foreground/30 bg-transparent",u&&"ring-2 ring-primary/30 ring-offset-1 ring-offset-background")}),o.jsx("span",{className:ce("mt-1 text-[9px] leading-tight text-center max-w-[50px]",u?"font-bold text-primary":"text-muted-foreground"),children:n==="en"?i.label_en:i.label_sw}),s&&o.jsx("span",{className:"text-[8px] text-muted-foreground",children:new Date(s.date).toLocaleDateString("en-GB",{day:"numeric",month:"short"})})]}),r<Eu.length-1&&o.jsx("div",{className:ce("h-0.5 w-4 mx-0.5",r<a?"bg-primary":"bg-muted-foreground
650/20")})]},i.key)})})},X=p.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,className:ce("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));X.displayName="Card";const hr=p.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,className:ce("flex flex-col space-y-1.5 p-6",e),...t}));hr.displayName="CardHeader";const mr=p.forwardRef(({className:e,...t},n)=>o.jsx("h3",{ref:n,className:ce("text-2xl font-semibold leading-none tracking-tight",e),...t}));mr.displayName="CardTitle";const sv=p.forwardRef(({className:e,...t},n)=>o.jsx("p",{ref:n,className:ce("text-sm text-muted-foreground",e),...t}));sv.displayName="CardDescription";const en=p.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,className:ce("p-6 pt-0",e),...t}));en.displayName="CardContent";const oG=p.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,className:ce("flex items-center p-6 pt-0",e),...t}));oG.displayName="CardFooter";const lG=e=>e?e.replace("https://new.kenyalaw.org","https://kenyalaw.org").replace("http://new.kenyalaw.org","https://kenyalaw.org").replace("http://197.232.9.131","https://www.parliament.go.ke"):"",cn=e=>{const t=lG(e);t&&window.open(t,"_blank","noopener,noreferrer")},hm=({item:e})=>{const{lang:t,t:n}=Re(),a=Mn(),i=iG(e.id),r=t==="en"?e.title_en:e.title_sw,s=i?t==="en"?i.summary_en:i.summary_sw:t==="en"?e.description_en:e.description_sw,l=i?t==="en"?i.youth_impacts_en:i.youth_impacts_sw:[];return o.jsxs(X,{className:"group cursor-pointer border-border/60 p-4 transition-all hover:border-primary/30 hover:shadow-md active:scale-[0.99]",onClick:()=>a(`/item/${e.slug}`),children:[o.jsx("div",{className:"flex items-start justify-between gap-3",children:o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsxs("div",{className:"mb-2 flex flex-wrap items-center gap-2",children:[o.jsx(Vc,{stage:e.stage}),o.jsx("span",{className:"text-[10px] font-medium uppercase tracking-wider text-muted-foreground",children:e.type==="bill"?n("Bill","Mswada"):n("Budget","Bajeti")})]}),o.jsx("h3",{className:"font-heading text-sm font-semibold leading-tight text-foreground group-hover:text-primary transition-colors",children:r}),o.jsx("p",{className:"mt-1.5 line-clamp-2 text-xs leading-relaxed text-muted-foreground",children:s})]})}),l.length>0&&o.jsx("div",{className:"mt-3 flex flex-wrap gap-1.5",children:l.slice(0,3).map((u,c)=>o.jsx("span",{className:"rounded-md bg-accent/10 px-2 py-0.5 text-[10px] font-medium text-accent",children:u},c))}),o.jsxs("div",{className:"mt-3 flex items-center justify-between text-[10px] text-muted-foreground",children:[o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx(Ac,{className:"h-3 w-3"}),e.last_action_date&&!isNaN(new Date(e.last_action_date).getTime())?new Date(e.last_action_date).toLocaleDateString("en-GB",{day:"numeric",month:"short",year:"numeric"}):n("No date","Hakuna tarehe")]}),o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx(Nn,{className:"h-3 w-3"}),e.source_primary_name]})]}),e.official_source_links.length>0&&o.jsx("div",{className:"mt-2 pt-2 border-t border-border/40",children:o.jsxs("button",{type:"button",onClick:u=>{u.stopPropagation(),cn(e.official_source_links[0].url)},className:"inline-flex items-center gap-1 text-[10px] font-medium text-primary hover:underline",children:[o.jsx(Nn,{className:"h-3 w-3"}),n("View official source","Tazama chanzo rasmi")]})})]})},ov=p.createContext({});function lv(e){const t=p.useRef(null);return t.current===null&&(t.current=e()),t.current}const uG=typeof window<"u",oP=uG?p.useLayoutEffect:p.useEffect,_f=p.createContext(null);function uv(e,t){e.indexOf(t)===-1&&e.push(t)}function mm(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const ci=(e,t,n)=>n>t?t:n<e?e:n;let Sf=()=>{},ll=()=>{};const Er={},lP=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function uP(e){return typeof e=="object"&&e!==null}const cP=e=>/^0[^.\s]+$/u.test(e);function dP(e){let t;return()=>(t===void 0&&(t=e()),t)}const ca=e=>e,cG=(e,t)=>n=>t(e(n)),Hc=(...e)=>e.reduce(cG),fc=(e,t,n)=>{const a=t-e;return a===0?1:(n-e)/a};class cv{constructor(){this.subscriptions=[]}add(t){return uv(this.subscriptions,t),()=>mm(this.subscriptions,t)}notify(t,n,a){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,a);else for(let r=0;r<i;r++){const s=this.subscriptions[r];s&&s(t,n,a)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Pn=e=>e*1e3,sa=e=>e/1e3;function hP(e,t){return t?e*(1e3/t):0}const mP=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,dG=1e-7,hG=12;function mG(e,t,n,a,i){let r,s,l=0;do s=t+(n-t)/2,r=mP(s,a,i)-e,r>0?n=s:t=s;while(Math.abs(r)>dG&&++l<hG);return s}function Wc(e,t,n,a){if(e===t&&n===a)return ca;const i=r=>mG(r,0,1,e,n);return r=>r===0||r===1?r:mP(i(r),t,a)}const fP=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,pP=e=>t=>1-e(1-t),gP=Wc(.33,1.53,.69,.99),dv=pP(gP),yP=fP(dv),wP=e=>e>
vendor: 28,548 bytes, line 650
650=1?1:(e*=2)<1?.5*dv(e):.5*(2-Math.pow(2,-10*(e-1))),hv=e=>1-Math.sin(Math.acos(e)),xP=pP(hv),kP=fP(hv),fG=Wc(.42,0,1,1),pG=Wc(0,0,.58,1),vP=Wc(.42,0,.58,1),gG=e=>Array.isArray(e)&&typeof e[0]!="number",bP=e=>Array.isArray(e)&&typeof e[0]=="number",zj={linear:ca,easeIn:fG,easeInOut:vP,easeOut:pG,circIn:hv,circInOut:kP,circOut:xP,backIn:dv,backInOut:yP,backOut:gP,anticipate:wP},yG=e=>typeof e=="string",Fj=e=>{if(bP(e)){ll(e.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[t,n,a,i]=e;return Wc(t,n,a,i)}else if(yG(e))return ll(zj[e]!==void 0,`Invalid easing type '${e}'`,"invalid-easing-type"),zj[e];return e},zd=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],Bj={value:null,addProjectionMetrics:null};function wG(e,t){let n=new Set,a=new Set,i=!1,r=!1;const s=new WeakSet;let l={delta:0,timestamp:0,isProcessing:!1},u=0;function c(d){s.has(d)&&(h.schedule(d),e()),u++,d(l)}const h={schedule:(d,m=!1,f=!1)=>{const g=f&&i?n:a;return m&&s.add(d),g.add(d),d},cancel:d=>{a.delete(d),s.delete(d)},process:d=>{if(l=d,i){r=!0;return}i=!0;const m=n;n=a,a=m,n.forEach(c),t&&Bj.value&&Bj.value.frameloop[t].push(u),u=0,n.clear(),i=!1,r&&(r=!1,h.process(d))}};return h}const xG=40;function jP(e,t){let n=!1,a=!0;const i={delta:0,timestamp:0,isProcessing:!1},r=()=>n=!0,s=zd.reduce((k,j)=>(k[j]=wG(r,t?j:void 0),k),{}),{setup:l,read:u,resolveKeyframes:c,preUpdate:h,update:d,preRender:m,render:f,postRender:y}=s,g=()=>{const k=Er.useManualTiming,j=k?i.timestamp:performance.now();n=!1,k||(i.delta=a?1e3/60:Math.max(Math.min(j-i.timestamp,xG),1)),i.timestamp=j,i.isProcessing=!0,l.process(i),u.process(i),c.process(i),h.process(i),d.process(i),m.process(i),f.process(i),y.process(i),i.isProcessing=!1,n&&t&&(a=!1,e(g))},x=()=>{n=!0,a=!0,i.isProcessing||e(g)};return{schedule:zd.reduce((k,j)=>{const S=s[j];return k[j]=(_,T=!1,E=!1)=>(n||x(),S.schedule(_,T,E)),k},{}),cancel:k=>{for(let j=0;j<zd.length;j++)s[zd[j]].cancel(k)},state:i,steps:s}}const{schedule:et,cancel:Ar,state:Ut,steps:Jp}=jP(typeof requestAnimationFrame<"u"?requestAnimationFrame:ca,!0);let gh;function kG(){gh=void 0}const dn={now:()=>(gh===void 0&&dn.set(Ut.isProcessing||Er.useManualTiming?Ut.timestamp:performance.now()),gh),set:e=>{gh=e,queueMicrotask(kG)}},_P=e=>t=>typeof t=="string"&&t.startsWith(e),SP=_P("--"),vG=_P("var(--"),mv=e=>vG(e)?bG.test(e.split("/*")[0].trim()):!1,bG=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Kj(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const Al={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},pc={...Al,transform:e=>ci(0,1,e)},Fd={...Al,default:1},Au=e=>Math.round(e*1e5)/1e5,fv=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function jG(e){return e==null}const _G=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,pv=(e,t)=>n=>!!(typeof n=="string"&&_G.test(n)&&n.startsWith(e)||t&&!jG(n)&&Object.prototype.hasOwnProperty.call(n,t)),NP=(e,t,n)=>a=>{if(typeof a!="string")return a;const[i,r,s,l]=a.match(fv);return{[e]:parseFloat(i),[t]:parseFloat(r),[n]:parseFloat(s),alpha:l!==void 0?parseFloat(l):1}},SG=e=>ci(0,255,e),Qp={...Al,transform:e=>Math.round(SG(e))},is={test:pv("rgb","red"),parse:NP("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:a=1})=>"rgba("+Qp.transform(e)+", "+Qp.transform(t)+", "+Qp.transform(n)+", "+Au(pc.transform(a))+")"};function NG(e){let t="",n="",a="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),a=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),a=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,a+=a,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(a,16),alpha:i?parseInt(i,16)/255:1}}const mw={test:pv("#"),parse:NG,transform:is.transform},qc=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),qi=qc("deg"),si=qc("%"),ge=qc("px"),CG=qc("vh"),TG=qc("vw"),$j={...si,parse:e=>si.parse(e)/100,transform:e=>si.transform(e*100)},ko={test:pv("hsl","hue"),parse:NP("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:a=1})=>"hsla("+Math.round(e)+", "+si.transform(Au(t))+", "+si.transform(Au(n))+", "+Au(pc.transform(a))+")"},Pt={test:e=>is.test(e)||mw.test(e)||ko.test(e),parse:e=>is.test(e)?is.parse(e):ko.test(e)?ko.parse(e):mw.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?is.transform(e):ko.transform(e),getAnimatableNone:e=>{const t=Pt.parse(e);return t.alpha=0,Pt.transform(t)}},EG=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function AG(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(fv))==null?void 0:t.length)||0)+(((n=e.match(EG))==null?void 0:n.length)||0)>0}const CP="number",TP="color",PG="var",MG="var(",Uj="${}",RG=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function ul(e){const t=e.toString(),n=[],a={color:[],number:[],var:[]},i=[];let r=0;const l=t.replace(RG,u=>(Pt.test(u)?(a.color.push(r),i.push(TP),n.push(Pt.parse(u))):u.startsWith(MG)?(a.var.push(r),i.push(PG),n.push(u)):(a.number.push(r),i.push(CP),n.push(parseFloat(u))),++r,Uj)).split(Uj);return{values:n,split:l,indexes:a,types:i}}function IG(e){return ul(e).values}function EP({split:e,types:t}){const n=e.length;return a=>{let i="";for(let r=0;r<n;r++)if(i+=e[r],a[r]!==void 0){const s=t[r];s===CP?i+=Au(a[r]):s===TP?i+=Pt.transform(a[r]):i+=a[r]}return i}}function OG(e){return EP(ul(e))}const LG=e=>typeof e=="number"?0:Pt.test(e)?Pt.getAnimatableNone(e):e,DG=(e,t)=>typeof e=="number"?t!=null&&t.trim().endsWith("/")?e:0:LG(e);function zG(e){const t=ul(e);return EP(t)(t.values.map((a,i)=>DG(a,t.split[i])))}const Ma={test:AG,parse:IG,createTransformer:OG,getAnimatableNone:zG};function Xp(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function FG({hue:e,saturation:t,lightness:n,alpha:a}){e/=360,t/=100,n/=100;let i=0,r=0,s=0;if(!t)i=r=s=n;else{const l=n<.5?n*(1+t):n+t-n*t,u=2*n-l;i=Xp(u,l,e+1/3),r=Xp(u,l,e),s=Xp(u,l,e-1/3)}return{red:Math.round(i*255),green:Math.round(r*255),blue:Math.round(s*255),alpha:a}}function fm(e,t){return n=>n>0?t:e}const ct=(e,t,n)=>e+(t-e)*n,Zp=(e,t,n)=>{const a=e*e,i=n*(t*t-a)+a;return i<0?0:Math.sqrt(i)},BG=[mw,is,ko],KG=e=>BG.find(t=>t.test(e));function Vj(e){const t=KG(e);if(Sf(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!t)return!1;let n=t.parse(e);return t===ko&&(n=FG(n)),n}const Hj=(e,t)=>{const n=Vj(e),a=Vj(t);if(!n||!a)return fm(e,t);const i={...n};return r=>(i.red=Zp(n.red,a.red,r),i.green=Zp(n.green,a.green,r),i.blue=Zp(n.blue,a.blue,r),i.alpha=ct(n.alpha,a.alpha,r),is.transform(i))},fw=new Set(["none","hidden"]);function $G(e,t){return fw.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function UG(e,t){return n=>ct(e,t,n)}function gv(e){return typeof e=="number"?UG:typeof e=="string"?mv(e)?fm:Pt.test(e)?Hj:WG:Array.isArray(e)?AP:typeof e=="object"?Pt.test(e)?Hj:VG:fm}function AP(e,t){const n=[...e],a=n.length,i=e.map((r,s)=>gv(r)(r,t[s]));return r=>{for(let s=0;s<a;s++)n[s]=i[s](r);return n}}function VG(e,t){const n={...e,...t},a={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(a[i]=gv(e[i])(e[i],t[i]));return i=>{for(const r in a)n[r]=a[r](i);return n}}function HG(e,t){const n=[],a={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){const r=t.types[i],s=e.indexes[r][a[r]],l=e.values[s]??0;n[i]=l,a[r]++}return n}const WG=(e,t)=>{const n=Ma.createTransformer(t),a=ul(e),i=ul(t);return a.indexes.var.length===i.indexes.var.length&&a.indexes.color.length===i.indexes.color.length&&a.indexes.number.length>=i.indexes.number.length?fw.has(e)&&!i.values.length||fw.has(t)&&!a.values.length?$G(e,t):Hc(AP(HG(a,i),i.values),n):(Sf(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),fm(e,t))};function PP(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?ct(e,t,n):gv(e)(e,t)}const qG=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>et.update(t,n),stop:()=>Ar(t),now:()=>Ut.isProcessing?Ut.timestamp:dn.now()}},MP=(e,t,n=10)=>{let a="";const i=Math.max(Math.round(t/n),2);for(let r=0;r<i;r++)a+=Math.round(e(r/(i-1))*1e4)/1e4+", ";return`linear(${a.substring(0,a.length-2)})`},pm=2e4;function yv(e){let t=0;const n=50;let a=e.next(t);for(;!a.done&&t<pm;)t+=n,a=e.next(t);return t>=pm?1/0:t}function GG(e,t=100,n){const a=n({...e,keyframes:[0,t]}),i=Math.min(yv(a),pm);return{type:"keyframes",ease:r=>a.next(i*r).value/t,duration:sa(i)}}const gt={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function pw(e,t){return e*Math.sqrt(1-t*t)}const YG=12;function JG(e,t,n){let a=n;for(let i=1;i<YG;i++)a=a-e(a)/t(a);return a}const eg=.001;function QG({duration:e=gt.duration,bounce:t=gt.bounce,velocity:n=gt.velocity,mass:a=gt.mass}){let i,r;Sf(e<=Pn(gt.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let s=1-t;s=ci(gt.minDamping,gt.maxDamping,s),e=ci(gt.minDuration,gt.maxDuration,sa(e)),s<1?(i=c=>{const h=c*s,d=h*e,m=h-n,f=pw(c,s),y=Math.exp(-d);return eg-m/f*y},r=c=>{const d=c*s*e,m=d*n+n,f=Math.pow(s,2)*Math.pow(c,2)*e,y=Math.exp(-d),g=pw(Math.pow(c,2),s);return(-i(c)+eg>0?-1:1)*((m-f)*y)/g}):(i=c=>{const h=Math.exp(-c*e),d=(c-n)*e+1;return-eg+h*d},r=c=>{const h=Math.exp(-c*e),d=(n-c)*(e*e);return h*d});const l=5/e,u=JG(i,r,l);if(e=Pn(e),isNaN(u))return{stiffness:gt.stiffness,damping:gt.damping,duration:e};{const c=Math.pow(u,2)*a;return{stiffness:c,damping:s*2*Math.sqrt(a*c),duration:e}}}const XG=["duration","bounce"],ZG=["stiffness","damping","mass"];function Wj(e,t){return t.some(n=>e[n]!==void 0)}function eY(e){let t={velocity:gt.velocity,stiffness:gt.stiffness,damping:gt.damping,mass:gt.mass,isResolvedFromDuration:!1,...e};if(!Wj(e,ZG)&&Wj(e,XG))if(t.velocity=0,e.visualDuration){const n=e.visualDuration,a=2*Math.PI/(n*1.2),i=a*a,r=2*ci(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:gt.mass,stiffness:i,damping:r}}else{const n=QG({...e,velocity:0});t={...t,...n,mass:gt.mass},t.isResolvedFromDuration=!0}return t}function gm(e=gt.visualDuration,t=gt.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:a,restDelta:i}=n;const r=n.keyframes[0],s=n.keyframes[n.keyframes.length-1],l={done:!1,value:r},{stiffness:u,damping:c,mass:h,duration:d,velocity:m,isResolvedFromDuration:f}=eY({...n,velocity:-sa(n.velocity||0)}),y=m||0,g=c/(2*Math.sqrt(u*h)),x=s-r,w=sa(Math.sqrt(u/h)),v=Math.abs(x)<5;a||(a=v?gt.restSpeed.granular:gt.restSpeed.default),i||(i=v?gt.restDelta.granular:gt.restDelta.default);let k,j,S,_,T,E;if(g<1)S=pw(w,g),_=(y+g*w*x)/S,k=A=>{const R=Math.exp(-g*w*A);return s-R*(_*Math.sin(S*A)+x*Math.cos(S*A))},T=g*w*_+x*S,E=g*w*x-_*S,j=A=>Math.exp(-g*w*A)*(T*Math.sin(S*A)+E*Math.cos(S*A));else if(g===1){k=R=>s-Math.exp(-w*R)*(x+(y+w*x)*R);const A=y+w*x;j=R=>Math.exp(-w*R)*(w*A*R-y)}else{const A=w*Math.sqrt(g*g-1);k=V=>{const z=Math.exp(-g*w*V),W=Math.min(A*V,300);return s-z*((y+g*w*x)*Math.sinh(W)+A*x*Math.cosh(W))/A};const R=(y+g*w*x)/A,F=g*w*R-x*A,Y=g*w*x-R*A;j=V=>{const z=Math.exp(-g*w*V),W=Math.min(A*V,300);return z*(F*Math.sinh(W)+Y*Math.cosh(W))}}const O={calculatedDuration:f&&d||null,velocity:A=>Pn(j(A)),next:A=>{if(!f&&g<1){const F=Math.exp(-g*w*A),Y=Math.sin(S*A),V=Math.cos(S*A),z=s-F*(_*Y+x*V),W=Pn(F*(T*Y+E*V));return l.done=Math.abs(W)<=a&&Math.abs(s-z)<=i,l.value=l.done?s:z,l}const R=k(A);if(f)l.done=A>=d;else{const F=Pn(j(A));l.done=Math.abs(F)<=a&&Math.abs(s-R)<=i}return l.value=l.done?s:R,l},toString:()=>{const A=Math.min(yv(O),pm),R=MP(F=>O.next(A*F).value,A,30);return A+"ms "+R},toTransition:()=>{}};return O}gm.applyToOptions=e=>{const t=GG(e,100,gm);return e.ease=t.ease,e.duration=Pn(t.duration),e.type="keyframes",e};const tY=5;function RP(e,t,n){const a=Math.max(t-tY,0);return hP(n-e(a),t-a)}function gw({keyframes:e,velocity:t=0,power:n=.8,timeConstant:a=325,bounceDamping:i=10,bounceStiffness:r=500,modifyTarget:s,min:l,max:u,restDelta:c=.5,restSpeed:h}){const d=e[0],m={done:!1,value:d},f=E=>l!==void 0&&E<l||u!==void 0&&E>u,y=E=>l===void 0?u:u===void 0||Math.abs(l-E)<Math.abs(u-E)?l:u;let g=n*t;const x=d+g,w=s===void 0?x:s(x);w!==x&&(g=w-d);const v=E=>-g*Math.exp(-E/a),k=E=>w+v(E),j=E=>{const O=v(E),A=k(E);m.done=Math.abs(O)<=c,m.value=m.done?w:A};let S,_;const T=E=>{f(m.value)&&(S=E,_=gm({keyframes:[m.value,y(m.value)],velocity:RP(k,E,m.value),damping:i,stiffness:r,restDelta:c,restSpeed:h}))};return T(0),{calculatedDuration:null,next:E=>{let O=!1;return!_&&S===void 0&&(O=!0,j(E),T(E)),S!==void 0&&E>=S?_.next(E-S):(!O&&j(E),m)}}}function nY(e,t,n){const a=[],i=n||Er.mix||PP,r=e.length-1;for(let s=0;s<r;s++){let l=i(e[s],e[s+1]);if(t){const u=Array.isArray(t)?t[s]||ca:t;l=Hc(u,l)}a.push(l)}return a}function aY(e,t,{clamp:n=!0,ease:a,mixer:i}={}){const r=e.length;if(ll(r===t.length,"Both input and output ranges must be the same length","range-length"),r===1)return()=>t[0];if(r===2&&t[0]===t[1])return()=>t[1];const s=e[0]===e[1];e[0]>e[r-1]&&(e=[...e].reverse(),t=[...t].reverse());const l=nY(t,a,i),u=l.length,c=h=>{if(s&&h<e[0])return t[0];let d=0;if(u>1)for(;d<e.length-2&&!(h<e[d+1]);d++);const m=fc(e[d],e[d+1],h);return l[d](m)};return n?h=>c(ci(e[0],e[r-1],h)):c}function iY(e,t){const n=e[e.length-1];for(let a=1;a<=t;a++){const i=fc(0,t,a);e.push(ct(n,1,i))}}function rY(e){const t=[0];return iY(t,e.length-1),t}function sY(e,t){return e.map(n=>n*t)}function oY(e,t){return e.map(()=>t||vP).splice(0,e.length-1)}function Pu({duration:e=300,keyframes:t,times:n,ease:a="easeInOut"}){const i=gG(a)?a.map(Fj):Fj(a),r={done:!1,value:t[0]},s=sY(n&&n.length===t.length?n:rY(t),e),l=aY(s,t,{ease:Array.isArray(i)?i:oY(t,i)});return{calculatedDuration:e,next:u=>(r.value=l(u),r.done=u>=e,r)}}const lY=e=>e!==null;function Nf(e,{repeat:t,repeatType:n="loop"},a,i=1){const r=e.filter(lY),l=i<0||t&&n!=="loop"&&t%2===1?0:r.length-1;return!l||a===void 0?r[l]:a}const uY={decay:gw,inertia:gw,tween:Pu,keyframes:Pu,spring:gm};function IP(e){typeof e.type=="string"&&(e.type=uY[e.type])}class wv{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const cY=e=>e/100;class ym extends wv{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{var a,i;const{motionValue:n}=this.options;n&&n.updatedAt!==dn.now()&&this.tick(dn.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(i=(a=this.options).onStop)==null||i.call(a))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;IP(t);const{type:n=Pu,repeat:a=0,repeatDelay:i=0,repeatType:r,velocity:s=0}=t;let{keyframes:l}=t;const u=n||Pu;u!==Pu&&typeof l[0]!="number"&&(this.mixKeyframes=Hc(cY,PP(l[0],l[1])),l=[0,100]);const c=u({...t,keyframes:l});r==="mirror"&&(this.mirroredGenerator=u({...t,keyframes:[...l].reverse(),velocity:-s})),c.calculatedDuration===null&&(c.calculatedDuration=yv(c));const{calculatedDuration:h}=c;this.calculatedDuration=h,this.resolvedDuration=h+i,this.totalDuration=this.resolvedDuration*(a+1)-i,this.generator=c}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:a,totalDuration:i,mixKeyframes:r,mirroredGenerator:s,resolvedDuration:l,calculatedDuration:u}=this;if(this.startTime===null)return a.next(0);const{delay:c=0,keyframes:h,repeat:d,repeatType:m,repeatDelay:f,type:y,onUpdate:g,finalKeyframe:x}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const w=this.currentTime-c*(this.playbackSpeed>=0?1:-1),v=this.playbackSpeed>=0?w<0:w>i;this.currentTime=Math.max(w,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let k=this.currentTime,j=a;if(d){const E=Math.min(this.currentTime,i)/l;let O=Math.floor(E),A=E%1;!A&&E>=1&&(A=1),A===1&&O--,O=Math.min(O,d+1),!!(O%2)&&(m==="reverse"?(A=1-A,f&&(A-=f/l)):m==="mirror"&&(j=s)),k=ci(0,1,A)*l}let S;v?(this.delayState.value=h[0],S=this.delayState):S=j.next(k),r&&!v&&(S.value=r(S.value));let{done:_}=S;!v&&u!==null&&(_=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const T=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&_);return T&&y!==gw&&(S.value=Nf(h,this.options,x,this.speed)),g&&g(S.value),T&&this.finish(),S}then(t,n){return this.finished.then(t,n)}get duration(){return sa(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+sa(t)}get time(){return sa(this.currentTime)}set time(t){t=Pn(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);const n=this.generator.next(t).value;return RP(a=>this.generator.next(a).value,t,n)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;n&&this.driver&&this.updateTime(dn.now()),this.playbackSpeed=t,n&&this.driver&&(this.time=sa(this.currentTime))}play(){var i,r;if(this.isStopped)return;const{driver:t=qG,startTime:n}=this.options;this.driver||(this.driver=t(s=>this.tick(s))),(r=(i=this.options).onPlay)==null||r.call(i);const a=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=a):this.holdTime!==null?this.startTime=a-this.holdTime:this.startTime||(this.startTime=n??a),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(dn.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(t=this.options).onComplete)==null||n.call(t)}cancel(){var t,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(t=this.options).onCancel)==null||n.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),t.observe(this)}}function dY(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const rs=e=>e*180/Math.PI,yw=e=>{const t=rs(Math.atan2(e[1],e[0]));return ww(t)},hY={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:yw,rotateZ:yw,skewX:e=>rs(Math.atan(e[1])),skewY:e=>rs(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},ww=e=>(e=e%360,e<0&&(e+=360),e),qj=yw,Gj=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Yj=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),mY={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Gj,scaleY:Yj,scale:e=>(Gj(e)+Yj(e))/2,rotateX:e=>ww(rs(Math.atan2(e[6],e[5]))),rotateY:e=>ww(rs(Math.atan2(-e[2],e[0]))),rotateZ:qj,rotate:qj,skewX:e=>rs(Math.atan(e[4])),skewY:e=>rs(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function xw(e){return e.includes("scale")?1:0}function kw(e,t){if(!e||e==="none")return xw(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let a,i;if(n)a=mY,i=n;else{const l=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);a=hY,i=l}if(!i)return xw(t);const r=a[t],s=i[1].split(",").map(pY);return typeof r=="function"?r(s):s[r]}const fY=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return kw(n,t)};function pY(e){return parseFloat(e.trim())}const Pl=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ml=new Set(Pl),Jj=e=>e===Al||e===ge,gY=new Set(["x","y","z"]),yY=Pl.filter(e=>!gY.has(e));function wY(e){const t=[];return yY.forEach(n=>{const a=e.getValue(n);a!==void 0&&(t.push([n,a.get()]),a.set(n.startsWith("scale")?1:0))}),t}const fr={width:({x:e},{paddingLeft:t="0",paddingRight:n="0",boxSizing:a})=>{const i=e.max-e.min;return a==="border-box"?i:i-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t="0",paddingBottom:n="0",boxSizing:a})=>{const i=e.max-e.min;return a==="border-box"?i:i-parseFloat(t)-parseFloat(n)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>kw(t,"x"),y:(e,{transform:t})=>kw(t,"y")};fr.translateX=fr.x;fr.translateY=fr.y;const ys=new Set;let vw=!1,bw=!1,jw=!1;function OP(){if(bw){const e=Array.from(ys).filter(a=>a.needsMeasurement),t=new Set(e.map(a=>a.element)),n=new Map;t.forEach(a=>{const i=wY(a);i.length&&(n.set(a,i),a.render())}),e.forEach(a=>a.measureInitialState()),t.forEach(a=>{a.render();const i=n.get(a);i&&i.forEach(([r,s])=>{var l;(l=a.getValue(r))==null||l.set(s)})}),e.forEach(a=>a.measureEndState()),e.forEach(a=>{a.suspendedScrollY!==void 0&&window.scrollTo(0,a.suspendedScrollY)})}bw=!1,vw=!1,ys.forEach(e=>e.complete(jw)),ys.clear()}function LP(){ys.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(bw=!0)})}function xY(){jw=!0,LP(),OP(),jw=!1}class xv{constructor(t,n,a,i,r,s=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=a,this.motionValue=i,this.element=r,this.isAsync=s}scheduleResolve(){this.state="scheduled",this.isAsync?(ys.add(this),vw||(vw=!0,et.read(LP),et.resolveKeyframes(OP))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:a,motionValue:i}=this;if(t[0]===null){const r=i==null?void 0:i.get(),s=t[t.length-1];if(r!==void 0)t[0]=r;else if(a&&n){const l=a.readValue(n,s);l!=null&&(t[0]=l)}t[0]===void 0&&(t[0]=s),i&&r===void 0&&i.set(t[0])}dY(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),ys.delete(this)}cancel(){this.state==="scheduled"&&(ys.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const kY=e=>e.startsWith("--");function DP(e,t,n){kY(t)?e.style.setProperty(t,n):e.style[t]=n}const vY={};function zP(e,t){const n=dP(e);return()=>vY[t]??n()}const bY=zP(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),FP=zP(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),cu=([e,t,n,a])=>`cubic-bezier(${e}, ${t}, ${n}, ${a})`,Qj={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:cu([0,.65,.55,1]),circOut:cu([.55,0,1,.45]),backIn:cu([.31,.01,.66,-.59]),backOut:cu([.33,1.53,.69,.99])};function BP(e,t){if(e)return typeof e=="function"?FP()?MP(e,t):"ease-out":bP(e)?cu(e):Array.isArray(e)?e.map(n=>BP(n,t)||Qj.easeOut):Qj[e]}function jY(e,t,n,{delay:a=0,duration:i=300,repeat:r=0,repeatType:s="loop",ease:l="easeOut",times:u}={},c=void 0){const h={[t]:n};u&&(h.offset=u);const d=BP(l,i);Array.isArray(d)&&(h.easing=d);const m={delay:a,duration:i,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:r+1,direction:s==="reverse"?"alternate":"normal"};return c&&(m.pseudoElement=c),e.animate(h,m)}function KP(e){return typeof e=="function"&&"applyToOptions"in e}function _Y({type:e,...t}){return KP(e)&&FP()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class $P extends wv{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:a,keyframes:i,pseudoElement:r,allowFlatten:s=!1,finalKeyframe:l,onComplete:u}=t;this.isPseudoElement=!!r,this.allowFlatten=s,this.options=t,ll(typeof t.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const c=_Y(t);this.animation=jY(n,a,i,c,r),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!r){const h=Nf(i,this.options,l,this.speed);this.updateMotionValue&&this.updateMotionValue(h),DP(n,a,h),this.animation.cancel()}u==null||u(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,n;(n=(t=this.animation).finish)==null||n.call(t)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var n,a,i;const t=(n=this.options)==null?void 0:n.element;!this.isPseudoElement&&(t!=null&&t.isConnected)&&((i=(a=this.animation).commitStyles)==null||i.call(a))}get duration(){var n,a;const t=((a=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:a.call(n).duration)||0;return sa(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+sa(t)}get time(){return sa(Number(this.animation.currentTime)||0)}set time(t){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Pn(t),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:n,rangeEnd:a,observe:i}){var r;return this.allowFlatten&&((r=this.animation.effect)==null||r.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&bY()?(this.animation.timeline=t,n&&(this.animation.rangeStart=n),a&&(this.animation.rangeEnd=a),ca):i(this)}}const UP={anticipate:wP,backInOut:yP,circInOut:kP};function SY(e){return e in UP}function NY(e){typeof e.ease=="string"&&SY(e.ease)&&(e.ease=UP[e.ease])}const tg=10;class CY extends $P{constructor(t){NY(t),IP(t),super(t),t.startTime!==void 0&&t.autoplay!==!1&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:a,onComplete:i,element:r,...s}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const l=new ym({...s,autoplay:!1}),u=Math.max(tg,dn.now()-this.startTime),c=ci(0,tg,u-tg),h=l.sample(u).value,{name:d}=this.options;r&&d&&DP(r,d,h),n.setWithVelocity(l.sample(Math.max(0,u-c)).value,h,c),l.stop()}}const Xj=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Ma.test(e)||e==="0")&&!e.startsWith("url("));function TY(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function EY(e,t,n,a){const i=e[0];if(i===null)return!1;if(t==="display"||t==="visibility")return!0;const r=e[e.length-1],s=Xj(i,t),l=Xj(r,t);return Sf(s===l,`You are trying to animate ${t} from "${i}" to "${r}". "${s?r:i}" is not an animatable value.`,"value-not-animatable"),!s||!l?!1:TY(e)||(n==="spring"||KP(n))&&a}function _w(e){e.duration=0,e.type="keyframes"}const VP=new Set(["opacity","clipPath","filter","transform"]),AY=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function PY(e){for(let t=0;t<e.length;
650t++)if(typeof e[t]=="string"&&AY.test(e[t]))return!0;return!1}const MY=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),RY=dP(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function IY(e){var d;const{motionValue:t,name:n,repeatDelay:a,repeatType:i,damping:r,type:s,keyframes:l}=e;if(!(((d=t==null?void 0:t.owner)==null?void 0:d.current)instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:h}=t.owner.getProps();return RY()&&n&&(VP.has(n)||MY.has(n)&&PY(l))&&(n!=="transform"||!h)&&!c&&!a&&i!=="mirror"&&r!==0&&s!=="inertia"}const OY=40;class LY extends wv{constructor({autoplay:t=!0,delay:n=0,type:a="keyframes",repeat:i=0,repeatDelay:r=0,repeatType:s="loop",keyframes:l,name:u,motionValue:c,element:h,...d}){var y;super(),this.stop=()=>{var g,x;this._animation&&(this._animation.stop(),(g=this.stopTimeline)==null||g.call(this)),(x=this.keyframeResolver)==null||x.cancel()},this.createdAt=dn.now();const m={autoplay:t,delay:n,type:a,repeat:i,repeatDelay:r,repeatType:s,name:u,motionValue:c,element:h,...d},f=(h==null?void 0:h.KeyframeResolver)||xv;this.keyframeResolver=new f(l,(g,x,w)=>this.onKeyframesResolved(g,x,m,!w),u,c,h),(y=this.keyframeResolver)==null||y.scheduleResolve()}onKeyframesResolved(t,n,a,i){var w,v;this.keyframeResolver=void 0;const{name:r,type:s,velocity:l,delay:u,isHandoff:c,onUpdate:h}=a;this.resolvedAt=dn.now();let d=!0;EY(t,r,s,l)||(d=!1,(Er.instantAnimations||!u)&&(h==null||h(Nf(t,a,n))),t[0]=t[t.length-1],_w(a),a.repeat=0);const f={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>OY?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...a,keyframes:t},y=d&&!c&&IY(f),g=(v=(w=f.motionValue)==null?void 0:w.owner)==null?void 0:v.current;let x;if(y)try{x=new CY({...f,element:g})}catch{x=new ym(f)}else x=new ym(f);x.finished.then(()=>{this.notifyFinished()}).catch(ca),this.pendingTimeline&&(this.stopTimeline=x.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=x}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),xY()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}}function HP(e,t,n,a=0,i=1){const r=Array.from(e).sort((c,h)=>c.sortNodePosition(h)).indexOf(t),s=e.size,l=(s-1)*a;return typeof n=="function"?n(r,s):i===1?r*a:l-r*a}const DY=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function zY(e){const t=DY.exec(e);if(!t)return[,];const[,n,a,i]=t;return[`--${n??a}`,i]}const FY=4;function WP(e,t,n=1){ll(n<=FY,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[a,i]=zY(e);if(!a)return;const r=window.getComputedStyle(t).getPropertyValue(a);if(r){const s=r.trim();return lP(s)?parseFloat(s):s}return mv(i)?WP(i,t,n+1):i}const BY={type:"spring",stiffness:500,damping:25,restSpeed:10},KY=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),$Y={type:"keyframes",duration:.8},UY={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},VY=(e,{keyframes:t})=>t.length>2?$Y:Ml.has(e)?e.startsWith("scale")?KY(t[1]):BY:UY;function qP(e,t){if(e!=null&&e.inherit&&t){const{inherit:n,...a}=e;return{...t,...a}}return e}function kv(e,t){const n=(e==null?void 0:e[t])??(e==null?void 0:e.default)??e;return n!==e?qP(n,e):n}const HY=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function WY(e){for(const t in e)if(!HY.has(t))return!0;return!1}const vv=(e,t,n,a={},i,r)=>
vendor: 52,151 bytes, line 650
650s=>{const l=kv(a,e)||{},u=l.delay||a.delay||0;let{elapsed:c=0}=a;c=c-Pn(u);const h={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...l,delay:-c,onUpdate:m=>{t.set(m),l.onUpdate&&l.onUpdate(m)},onComplete:()=>{s(),l.onComplete&&l.onComplete()},name:e,motionValue:t,element:r?void 0:i};WY(l)||Object.assign(h,VY(e,h)),h.duration&&(h.duration=Pn(h.duration)),h.repeatDelay&&(h.repeatDelay=Pn(h.repeatDelay)),h.from!==void 0&&(h.keyframes[0]=h.from);let d=!1;if((h.type===!1||h.duration===0&&!h.repeatDelay)&&(_w(h),h.delay===0&&(d=!0)),(Er.instantAnimations||Er.skipAnimations||i!=null&&i.shouldSkipAnimations)&&(d=!0,_w(h),h.delay=0),h.allowFlatten=!l.type&&!l.ease,d&&!r&&t.get()!==void 0){const m=Nf(h.keyframes,l);if(m!==void 0){et.update(()=>{h.onUpdate(m),h.onComplete()});return}}return l.isSync?new ym(h):new LY(h)};function Zj(e){const t=[{},{}];return e==null||e.values.forEach((n,a)=>{t[0][a]=n.get(),t[1][a]=n.getVelocity()}),t}function bv(e,t,n,a){if(typeof t=="function"){const[i,r]=Zj(a);t=t(n!==void 0?n:e.custom,i,r)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,r]=Zj(a);t=t(n!==void 0?n:e.custom,i,r)}return t}function ws(e,t,n){const a=e.getProps();return bv(a,t,n!==void 0?n:a.custom,e)}const GP=new Set(["width","height","top","left","right","bottom",...Pl]),e_=30,qY=e=>!isNaN(parseFloat(e));class GY{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=a=>{var r;const i=dn.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(a),this.current!==this.prev&&((r=this.events.change)==null||r.notify(this.current),this.dependents))for(const s of this.dependents)s.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=dn.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=qY(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new cv);const a=this.events[t].add(n);return t==="change"?()=>{a(),et.read(()=>{this.events.change.getSize()||this.stop()})}:a}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,a){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-a}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var t;(t=this.events.change)==null||t.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=dn.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>e_)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,e_);return hP(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var t,n;(t=this.dependents)==null||t.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function cl(e,t){return new GY(e,t)}const Sw=e=>Array.isArray(e);function YY(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,cl(n))}function JY(e){return Sw(e)?e[e.length-1]||0:e}function QY(e,t){const n=ws(e,t);let{transitionEnd:a={},transition:i={},...r}=n||{};r={...r,...a};for(const s in r){const l=JY(r[s]);YY(e,s,l)}}const Ht=e=>!!(e&&e.getVelocity);function XY(e){return!!(Ht(e)&&e.add)}function Nw(e,t){const n=e.getValue("willChange");if(XY(n))return n.add(t);if(!n&&Er.WillChange){const a=new Er.WillChange("auto");e.addValue("willChange",a),a.add(t)}}function jv(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const ZY="framerAppearId",YP="data-"+jv(ZY);function JP(e){return e.props[YP]}function eJ({protectedKeys:e,needsAnimating:t},n){const a=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,a}function QP(e,t,{delay:n=0,transitionOverride:a,type:i}={}){let{transition:r,transitionEnd:s,...l}=t;const u=e.getDefaultTransition();r=r?qP(r,u):u;const c=r==null?void 0:r.reduceMotion;a&&(r=a);const h=[],d=i&&e.animationState&&e.animationState.getState()[i];for(const m in l){const f=e.getValue(m,e.latestValues[m]??null),y=l[m];if(y===void 0||d&&eJ(d,m))continue;const g={delay:n,...kv(r||{},m)},x=f.get();if(x!==void 0&&!f.isAnimating()&&!Array.isArray(y)&&y===x&&!g.velocity){et.update(()=>f.set(y));continue}let w=!1;if(window.MotionHandoffAnimation){const j=JP(e);if(j){const S=window.MotionHandoffAnimation(j,m,et);S!==null&&(g.startTime=S,w=!0)}}Nw(e,m);const v=c??e.shouldReduceMotion;f.start(vv(m,f,y,v&&GP.has(m)?{type:!1}:g,e,w));const k=f.animation;k&&h.push(k)}if(s){const m=()=>et.update(()=>{s&&QY(e,s)});h.length?Promise.all(h).then(m):m()}return h}function Cw(e,t,n={}){var u;const a=ws(e,t,n.type==="exit"?(u=e.presenceContext)==null?void 0:u.custom:void 0);let{transition:i=e.getDefaultTransition()||{}}=a||{};n.transitionOverride&&(i=n.transitionOverride);const r=a?()=>Promise.all(QP(e,a,n)):()=>Promise.resolve(),s=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:h=0,staggerChildren:d,staggerDirection:m}=i;return tJ(e,t,c,h,d,m,n)}:()=>Promise.resolve(),{when:l}=i;if(l){const[c,h]=l==="beforeChildren"?[r,s]:[s,r];return c().then(()=>h())}else return Promise.all([r(),s(n.delay)])}function tJ(e,t,n=0,a=0,i=0,r=1,s){const l=[];for(const u of e.variantChildren)u.notify("AnimationStart",t),l.push(Cw(u,t,{...s,delay:n+(typeof a=="function"?0:a)+HP(e.variantChildren,u,a,i,r)}).then(()=>u.notify("AnimationComplete",t)));return Promise.all(l)}function nJ(e,t,n={}){e.notify("AnimationStart",t);let a;if(Array.isArray(t)){const i=t.map(r=>Cw(e,r,n));a=Promise.all(i)}else if(typeof t=="string")a=Cw(e,t,n);else{const i=typeof t=="function"?ws(e,t,n.custom):t;a=Promise.all(QP(e,i,n))}return a.then(()=>{e.notify("AnimationComplete",t)})}const aJ={test:e=>e==="auto",parse:e=>e},XP=e=>t=>t.test(e),ZP=[Al,ge,si,qi,TG,CG,aJ],t_=e=>ZP.find(XP(e));function iJ(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||cP(e):!0}const rJ=new Set(["brightness","contrast","saturate","opacity"]);function sJ(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[a]=n.match(fv)||[];if(!a)return e;const i=n.replace(a,"");let r=rJ.has(t)?1:0;return a!==n&&(r*=100),t+"("+r+i+")"}const oJ=/\b([a-z-]*)\(.*?\)/gu,Tw={...Ma,getAnimatableNone:e=>{const t=e.match(oJ);return t?t.map(sJ).join(" "):e}},Ew={...Ma,getAnimatableNone:e=>{const t=Ma.parse(e);return Ma.createTransformer(e)(t.map(a=>typeof a=="number"?0:typeof a=="object"?{...a,alpha:1}:a))}},n_={...Al,transform:Math.round},lJ={rotate:qi,rotateX:qi,rotateY:qi,rotateZ:qi,scale:Fd,scaleX:Fd,scaleY:Fd,scaleZ:Fd,skew:qi,skewX:qi,skewY:qi,distance:ge,translateX:ge,translateY:ge,translateZ:ge,x:ge,y:ge,z:ge,perspective:ge,transformPerspective:ge,opacity:pc,originX:$j,originY:$j,originZ:ge},_v={borderWidth:ge,borderTopWidth:ge,borderRightWidth:ge,borderBottomWidth:ge,borderLeftWidth:ge,borderRadius:ge,borderTopLeftRadius:ge,borderTopRightRadius:ge,borderBottomRightRadius:ge,borderBottomLeftRadius:ge,width:ge,maxWidth:ge,height:ge,maxHeight:ge,top:ge,right:ge,bottom:ge,left:ge,inset:ge,insetBlock:ge,insetBlockStart:ge,insetBlockEnd:ge,insetInline:ge,insetInlineStart:ge,insetInlineEnd:ge,padding:ge,paddingTop:ge,paddingRight:ge,paddingBottom:ge,paddingLeft:ge,paddingBlock:ge,paddingBlockStart:ge,paddingBlockEnd:ge,paddingInline:ge,paddingInlineStart:ge,paddingInlineEnd:ge,margin:ge,marginTop:ge,marginRight:ge,marginBottom:ge,marginLeft:ge,marginBlock:ge,marginBlockStart:ge,marginBlockEnd:ge,marginInline:ge,marginInlineStart:ge,marginInlineEnd:ge,fontSize:ge,backgroundPositionX:ge,backgroundPositionY:ge,...lJ,zIndex:n_,fillOpacity:pc,strokeOpacity:pc,numOctaves:n_},uJ={..._v,color:Pt,backgroundColor:Pt,outlineColor:Pt,fill:Pt,stroke:Pt,borderColor:Pt,borderTopColor:Pt,borderRightColor:Pt,borderBottomColor:Pt,borderLeftColor:Pt,filter:Tw,WebkitFilter:Tw,mask:Ew,WebkitMask:Ew},eM=e=>uJ[e],cJ=new Set([Tw,Ew]);function tM(e,t){let n=eM(e);return cJ.has(n)||(n=Ma),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const dJ=new Set(["auto","none","0"]);function hJ(e,t,n){let a=0,i;for(;a<e.length&&!i;){const r=e[a];typeof r=="string"&&!dJ.has(r)&&ul(r).values.length&&(i=e[a]),a++}if(i&&n)for(const r of t)e[r]=tM(n,i)}class mJ extends xv{constructor(t,n,a,i,r){super(t,n,a,i,r,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:a}=this;if(!n||!n.current)return;super.readKeyframes();for(let h=0;h<t.length;h++){let d=t[h];if(typeof d=="string"&&(d=d.trim(),mv(d))){const m=WP(d,n.current);m!==void 0&&(t[h]=m),h===t.length-1&&(this.finalKeyframe=d)}}if(this.resolveNoneKeyframes(),!GP.has(a)||t.length!==2)return;const[i,r]=t,s=t_(i),l=t_(r),u=Kj(i),c=Kj(r);if(u!==c&&fr[a]){this.needsMeasurement=!0;return}if(s!==l)if(Jj(s)&&Jj(l))for(let h=0;h<t.length;h++){const d=t[h];typeof d=="string"&&(t[h]=parseFloat(d))}else fr[a]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,a=[];for(let i=0;i<t.length;i++)(t[i]===null||iJ(t[i]))&&a.push(i);a.length&&hJ(t,a,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:a}=this;if(!t||!t.current)return;a==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=fr[a](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&t.getValue(a,i).jump(i,!1)}measureEndState(){var l;const{element:t,name:n,unresolvedKeyframes:a}=this;if(!t||!t.current)return;const i=t.getValue(n);i&&i.jump(this.measuredOrigin,!1);const r=a.length-1,s=a[r];a[r]=fr[n](t.measureViewportBox(),window.getComputedStyle(t.current)),s!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=s),(l=this.removedTransforms)!=null&&l.length&&this.removedTransforms.forEach(([u,c])=>{t.getValue(u).set(c)}),this.resolveNoneKeyframes()}}function nM(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){const i=document.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(a=>a!=null)}const aM=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function yh(e){return uP(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const{schedule:Sv,cancel:pie}=jP(queueMicrotask,!1),ba={x:!1,y:!1};function iM(){return ba.x||ba.y}function fJ(e){return e==="x"||e==="y"?ba[e]?null:(ba[e]=!0,()=>{ba[e]=!1}):ba.x||ba.y?null:(ba.x=ba.y=!0,()=>{ba.x=ba.y=!1})}function rM(e,t){const n=nM(e),a=new AbortController,i={passive:!0,...t,signal:a.signal};return[n,i,()=>a.abort()]}function pJ(e){return!(e.pointerType==="touch"||iM())}function gJ(e,t,n={}){const[a,i,r]=rM(e,n);return a.forEach(s=>{let l=!1,u=!1,c;const h=()=>{s.removeEventListener("pointerleave",y)},d=x=>{c&&(c(x),c=void 0),h()},m=x=>{l=!1,window.removeEventListener("pointerup",m),window.removeEventListener("pointercancel",m),u&&(u=!1,d(x))},f=()=>{l=!0,window.addEventListener("pointerup",m,i),window.addEventListener("pointercancel",m,i)},y=x=>{if(x.pointerType!=="touch"){if(l){u=!0;return}d(x)}},g=x=>{if(!pJ(x))return;u=!1;const w=t(s,x);typeof w=="function"&&(c=w,s.addEventListener("pointerleave",y,i))};s.addEventListener("pointerenter",g,i),s.addEventListener("pointerdown",f,i)}),r}const sM=(e,t)=>t?e===t?!0:sM(e,t.parentElement):!1,Nv=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,yJ=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function wJ(e){return yJ.has(e.tagName)||e.isContentEditable===!0}const xJ=new Set(["INPUT","SELECT","TEXTAREA"]);function kJ(e){return xJ.has(e.tagName)||e.isContentEditable===!0}const wh=new WeakSet;function a_(e){return t=>{t.key==="Enter"&&e(t)}}function ng(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const vJ=(e,t)=>{const n=e.currentTarget;if(!n)return;const a=a_(()=>{if(wh.has(n))return;ng(n,"down");const i=a_(()=>{ng(n,"up")}),r=()=>ng(n,"cancel");n.addEventListener("keyup",i,t),n.addEventListener("blur",r,t)});n.addEventListener("keydown",a,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",a),t)};function i_(e){return Nv(e)&&!iM()}const r_=new WeakSet;function bJ(e,t,n={}){const[a,i,r]=rM(e,n),s=l=>{const u=l.currentTarget;if(!i_(l)||r_.has(l))return;wh.add(u),n.stopPropagation&&r_.add(l);const c=t(u,l),h=(f,y)=>{window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",m),wh.has(u)&&wh.delete(u),i_(f)&&typeof c=="function"&&c(f,{success:y})},d=f=>{h(f,u===window||u===document||n.useGlobalTarget||sM(u,f.target))},m=f=>{h(f,!1)};window.addEventListener("pointerup",d,i),window.addEventListener("pointercancel",m,i)};return a.forEach(l=>{(n.useGlobalTarget?window:l).addEventListener("pointerdown",s,i),yh(l)&&(l.addEventListener("focus",c=>vJ(c,i)),!wJ(l)&&!l.hasAttribute("tabindex")&&(l.tabIndex=0))}),r}function Cv(e){return uP(e)&&"ownerSVGElement"in e}const xh=new WeakMap;let Gi;const oM=(e,t,n)=>(a,i)=>i&&i[0]?i[0][e+"Size"]:Cv(a)&&"getBBox"in a?a.getBBox()[t]:a[n],jJ=oM("inline","width","offsetWidth"),_J=oM("block","height","offsetHeight");function SJ({target:e,borderBoxSize:t}){var n;(n=xh.get(e))==null||n.forEach(a=>{a(e,{get width(){return jJ(e,t)},get height(){return _J(e,t)}})})}function NJ(e){e.forEach(SJ)}function CJ(){typeof ResizeObserver>"u"||(Gi=new ResizeObserver(NJ))}function TJ(e,t){Gi||CJ();const n=nM(e);return n.forEach(a=>{let i=xh.get(a);i||(i=new Set,xh.set(a,i)),i.add(t),Gi==null||Gi.observe(a)}),()=>{n.forEach(a=>{const i=xh.get(a);i==null||i.delete(t),i!=null&&i.size||Gi==null||Gi.unobserve(a)})}}const kh=new Set;let vo;function EJ(){vo=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};kh.forEach(t=>t(e))},window.addEventListener("resize",vo)}function AJ(e){return kh.add(e),vo||EJ(),()=>{kh.delete(e),!kh.size&&typeof vo=="function"&&(window.removeEventListener("resize",vo),vo=void 0)}}function s_(e,t){return typeof e=="function"?AJ(e):TJ(e,t)}function PJ(e){return Cv(e)&&e.tagName==="svg"}const MJ=[...ZP,Pt,Ma],RJ=e=>MJ.find(XP(e)),o_=()=>({translate:0,scale:1,origin:0,originPoint:0}),bo=()=>({x:o_(),y:o_()}),l_=()=>({min:0,max:0}),It=()=>({x:l_(),y:l_()}),IJ=new WeakMap;function Cf(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function gc(e){return typeof e=="string"||Array.isArray(e)}const Tv=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Ev=["initial",...Tv];function Tf(e){return Cf(e.animate)||Ev.some(t=>gc(e[t]))}function lM(e){return!!(Tf(e)||e.variants)}function OJ(e,t,n){for(const a in t){const i=t[a],r=n[a];if(Ht(i))e.addValue(a,i);else if(Ht(r))e.addValue(a,cl(i,{owner:e}));else if(r!==i)if(e.hasValue(a)){const s=e.getValue(a);s.liveStyle===!0?s.jump(i):s.hasAnimated||s.set(i)}else{const s=e.getStaticValue(a);e.addValue(a,cl(s!==void 0?s:i,{owner:e}))}}for(const a in n)t[a]===void 0&&e.removeValue(a);return t}const Aw={current:null},uM={current:!1},LJ=typeof window<"u";function DJ(){if(uM.current=!0,!!LJ)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Aw.current=e.matches;e.addEventListener("change",t),t()}else Aw.current=!1}const u_=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let wm={};function cM(e){wm=e}function zJ(){return wm}class FJ{scrapeMotionValuesFromProps(t,n,a){return{}}constructor({parent:t,props:n,presenceContext:a,reducedMotionConfig:i,skipAnimations:r,blockInitialAnimation:s,visualState:l},u={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=xv,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const f=dn.now();this.renderScheduledAt<f&&(this.renderScheduledAt=f,et.render(this.render,!1,!0))};const{latestValues:c,renderState:h}=l;this.latestValues=c,this.baseTarget={...c},this.initialValues=n.initial?{...c}:{},this.renderState=h,this.parent=t,this.props=n,this.presenceContext=a,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.skipAnimationsConfig=r,this.options=u,this.blockInitialAnimation=!!s,this.isControllingVariants=Tf(n),this.isVariantNode=lM(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:d,...m}=this.scrapeMotionValuesFromProps(n,{},this);for(const f in m){const y=m[f];c[f]!==void 0&&Ht(y)&&y.set(c[f])}}mount(t){var n,a;if(this.hasBeenMounted)for(const i in this.initialValues)(n=this.values.get(i))==null||n.jump(this.initialValues[i]),this.latestValues[i]=this.initialValues[i];this.current=t,IJ.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((i,r)=>this.bindToMotionValue(r,i)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(uM.current||DJ(),this.shouldReduceMotion=Aw.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(a=this.parent)==null||a.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var t;this.projection&&this.projection.unmount(),Ar(this.notifyUpdate),Ar(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(t=this.parent)==null||t.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const a=this.features[n];a&&(a.unmount(),a.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),n.accelerate&&VP.has(t)&&this.current instanceof HTMLElement){const{factory:s,keyframes:l,times:u,ease:c,duration:h}=n.accelerate,d=new $P({element:this.current,name:t,keyframes:l,times:u,ease:c,duration:Pn(h)}),m=s(d);this.valueSubscriptions.set(t,()=>{m(),d.cancel()});return}const a=Ml.has(t);a&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",s=>{this.latestValues[t]=s,this.props.onUpdate&&et.preRender(this.notifyUpdate),a&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let r;typeof window<"u"&&window.MotionCheckAppearSync&&(r=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{i(),r&&r(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in wm){const n=wm[t];if(!n)continue;const{isEnabled:a,Feature:i}=n;if(!this.features[t]&&i&&a(this.props)&&(this.features[t]=new i(this)),this.features[t]){const r=this.features[t];r.isMounted?r.update():(r.mount(),r.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):It()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let a=0;a<u_.length;a++){const i=u_[a];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const r="on"+i,s=t[r];s&&(this.propEventSubscriptions[i]=this.on(i,s))}this.prevMotionValues=OJ(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const a=this.values.get(t);n!==a&&(a&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let a=this.values.get(t);return a===void 0&&n!==void 0&&(a=cl(n===null?void 0:n,{owner:this}),this.addValue(t,a)),a}readValue(t,n){let a=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return a!=null&&(typeof a=="string"&&(lP(a)||cP(a))?a=parseFloat(a):!RJ(a)&&Ma.test(n)&&(a=tM(t,n)),this.setBaseTarget(t,Ht(a)?a.get():a)),Ht(a)?a.get():a}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var r;const{initial:n}=this.props;let a;if(typeof n=="string"||typeof n=="object"){const s=bv(this.props,n,(r=this.presenceContext)==null?void 0:r.custom);s&&(a=s[t])}if(n&&a!==void 0)return a;const i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!Ht(i)?i:this.initialValues[t]!==void 0&&a===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new cv),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){Sv.render(this.render)}}class dM extends FJ{constructor(){super(...arguments),this.KeyframeResolver=mJ}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){const a=t.style;return a?a[n]:void 0}removeValueFromRenderState(t,{vars:n,style:a}){delete n[t],delete a[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Ht(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class Dr{constructor(t){this.isMounted=!1,this.node=t}update(){}}function hM({top:e,left:t,right:n,bottom:a}){return{x:{min:t,max:n},y:{min:e,max:a}}}function BJ({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function KJ(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),a=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:a.y,right:a.x}}function ag(e){return e===void 0||e===1}function Pw({scale:e,scaleX:t,scaleY:n}){return!ag(e)||!ag(t)||!ag(n)}function Yr(e){return Pw(e)||mM(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function mM(e){return c_(e.x)||c_(e.y)}function c_(e){return e&&e!=="0%"}function xm(e,t,n){const a=e-n,i=t*a;return n+i}function d_(e,t,n,a,i){return i!==void 0&&(e=xm(e,i,a)),xm(e,n,a)+t}function Mw(e,t=0,n=1,a,i){e.min=d_(e.min,t,n,a,i),e.max=d_(e.max,t,n,a,i)}function fM(e,{x:t,y:n}){Mw(e.x,t.translate,t.scale,t.originPoint),Mw(e.y,n.translate,n.scale,n.originPoint)}const h_=.999999999999,m_=1.0000000000001;function $J(e,t,n,a=!1){var l;const i=n.length;if(!i)return;t.x=t.y=1;let r,s;for(let u=0;u<i;u++){r=n[u],s=r.projectionDelta;const{visualElement:c}=r.options;c&&c.props.style&&c.props.style.display==="contents"||(a&&r.options.layoutScroll&&r.scroll&&r!==r.root&&(Xa(e.x,-r.scroll.offset.x),Xa(e.y,-r.scroll.offset.y)),s&&(t.x*=s.x.scale,t.y*=s.y.scale,fM(e,s)),a&&Yr(r.latestValues)&&vh(e,r.latestValues,(l=r.layout)==null?void 0:l.layoutBox))}t.x<m_&&t.x>h_&&(t.x=1),t.y<m_&&t.y>h_&&(t.y=1)}function Xa(e,t){e.min+=t,e.max+=t}function f_(e,t,n,a,i=.5){const r=ct(e.min,e.max,i);Mw(e,t,n,r,a)}function p_(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function vh(e,t,n){const a=n??e;f_(e.x,p_(t.x,a.x),t.scaleX,t.scale,t.originX),f_(e.y,p_(t.y,a.y),t.scaleY,t.scale,t.originY)}function pM(e,t){return hM(KJ(e.getBoundingClientRect(),t))}function UJ(e,t,n){const a=pM(e,n),{scroll:i}=t;return i&&(Xa(a.x,i.offset.x),Xa(a.y,i.offset.y)),a}const VJ={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},HJ=Pl.length;function WJ(e,t,n){let a="",i=!0;for(let r=0;r<HJ;r++){const s=Pl[r],l=e[s];if(l===void 0)continue;let u=!0;if(typeof l=="number")u=l===(s.startsWith("scale")?1:0);else{const c=parseFloat(l);u=s.startsWith("scale")?c===1:c===0}if(!u||n){const c=aM(l,_v[s]);if(!u){i=!1;const h=VJ[s]||s;a+=`${h}(${c}) `}n&&(t[s]=c)}}return a=a.trim(),n?a=n(t,i?"":a):i&&(a="none"),a}function Av(e,t,n){const{style:a,vars:i,transformOrigin:r}=e;let s=!1,l=!1;for(const u in t){const c=t[u];if(Ml.has(u)){s=!0;continue}else if(SP(u)){i[u]=c;continue}else{const h=aM(c,_v[u]);u.startsWith("origin")?(l=!0,r[u]=h):a[u]=h}}if(t.transform||(s||n?a.transform=WJ(t,e.transform,n):a.transform&&(a.transform="none")),l){const{originX:u="50%",originY:c="50%",originZ:h=0}=r;a.transformOrigin=`${u} ${c} ${h}`}}function gM(e,{style:t,vars:n},a,i){const r=e.style;let s;for(s in t)r[s]=t[s];i==null||i.applyProjectionStyles(r,a);for(s in n)r.setProperty(s,n[s])}function g_(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Jl={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(ge.test(e))e=parseFloat(e);else return e;const n=g_(e,t.target.x),a=g_(e,t.target.y);return`${n}% ${a}%`}},qJ={correct:(e,{treeScale:t,projectionDelta:n})=>{const a=e,i=Ma.parse(e);if(i.length>5)return a;const r=Ma.createTransformer(e),s=typeof i[0]!="number"?1:0,l=n.x.scale*t.x,u=n.y.scale*t.y;i[0+s]/=l,i[1+s]/=u;const c=ct(l,u,.5);return typeof i[2+s]=="number"&&(i[2+s]/=c),typeof i[3+s]=="number"&&(i[3+s]/=c),r(i)}},Rw={borderRadius:{...Jl,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Jl,borderTopRightRadius:Jl,borderBottomLeftRadius:Jl,borderBottomRightRadius:Jl,boxShadow:qJ};function yM(e,{layout:t,layoutId:n}){return Ml.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Rw[e]||e==="opacity")}function Pv(e,t,n){var s;const a=e.style,i=t==null?void 0:t.style,r={};if(!a)return r;for(const l in a)(Ht(a[l])||i&&Ht(i[l])||yM(l,e)||((s=n==null?void 0:n.getValue(l))==null?void 0:s.liveStyle)!==void 0)&&(r[l]=a[l]);return r}function GJ(e){return window.getComputedStyle(e)}class YJ extends dM{constructor(){super(...arguments),this.type="html",this.renderInstance=gM}readValueFromInstance(t,n){var a;if(Ml.has(n))return(a=this.projection)!=null&&a.isProjecting?xw(n):fY(t,n);{const i=GJ(t),r=(SP(n)?i.getPropertyValue(n):i[n])||0;return typeof r=="string"?r.trim():r}}measureInstanceViewportBox(t,{transformPagePoint:n}){return pM(t,n)}build(t,n,a){Av(t,n,a.transformTemplate)}scrapeMotionValuesFromProps(t,n,a){return Pv(t,n,a)}}const JJ={offset:"stroke-dashoffset",array:"stroke-dasharray"},QJ={offset:"strokeDashoffset",array:"strokeDasharray"};function XJ(e,t,n=1,a=0,i=!0){e.pathLength=1;const r=i?JJ:QJ;e[r.offset]=`${-a}`,e[r.array]=`${t} ${n}`}const ZJ=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function wM(e,{attrX:t,attrY:n,attrScale:a,pathLength:i,pathSpacing:r=1,pathOffset:s=0,...l},u,c,h){if(Av(e,l,c),u){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:d,style:m}=e;d.transform&&(m.transform=d.transform,delete d.transform),(m.transform||d.transformOrigin)&&(m.transformOrigin=d.transformOrigin??"50% 50%",delete d.transformOrigin),m.transform&&(m.transformBox=(h==null?void 0:h.transformBox)??"fill-box",delete d.transformBox);for(const f of ZJ)d[f]!==void 0&&(m[f]=d[f],delete d[f]);t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),a!==void 0&&(d.scale=a),i!==void 0&&XJ(d,i,r,s,!1)}const xM=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),kM=e=>typeof e=="string"&&e.toLowerCase()==="svg";function eQ(e,t,n,a){gM(e,t,void 0,a);for(const i in t.attrs)e.setAttribute(xM.has(i)?i:jv(i),t.attrs[i])}function vM(e,t,n){const a=Pv(e,t,n);for(const i in e)if(Ht(e[i])||Ht(t[i])){const r=Pl.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;a[r]=e[i]}return a}class tQ extends dM{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=It}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Ml.has(n)){const a=eM(n);return a&&a.default||0}return n=xM.has(n)?n:jv(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,a){return vM(t,n,a)}build(t,n,a){wM(t,n,this.isSVGTag,a.transformTemplate,a.style)}renderInstance(t,n,a,i){eQ(t,n,a,i)}mount(t){this.isSVGTag=kM(t.tagName),super.mount(t)}}const nQ=Ev.length;function bM(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?bM(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<nQ;n++){const a=Ev[n],i=e.props[a];(gc(i)||i===!1)&&(t[a]=i)}return t}function jM(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let a=0;a<n;a++)if(t[a]!==e[a])return!1;return!0}const aQ=[...Tv].reverse(),iQ=Tv.length;function rQ(e){return t=>Promise.all(t.map(({animation:n,options:a})=>nJ(e,n,a)))}function sQ(e){let t=rQ(e),n=y_(),a=!0,i=!1;const r=c=>(h,d)=>{var f;const m=ws(e,d,c==="exit"?(f=e.presenceContext)==null?void 0:f.custom:void 0);if(m){const{transition:y,transitionEnd:g,...x}=m;h={...h,...x,...g}}return h};function s(c){t=c(e)}function l(c){const{props:h}=e,d=bM(e.parent)||{},m=[],f=new Set;let y={},g=1/0;for(let w=0;w<iQ;w++){const v=aQ[w],k=n[v],j=h[v]!==void 0?h[v]:d[v],S=gc(j),_=v===c?k.isActive:null;_===!1&&(g=w);let T=j===d[v]&&j!==h[v]&&S;if(T&&(a||i)&&e.manuallyAnimateOnMount&&(T=!1),k.protectedKeys={...y},!k.isActive&&_===null||!j&&!k.prevProp||Cf(j)||typeof j=="boolean")continue;if(v==="exit"&&k.isActive&&_!==!0){k.prevResolvedValues&&(y={...y,...k.prevResolvedValues});continue}const E=oQ(k.prevProp,j);let O=E||v===c&&k.isActive&&!T&&S||w>g&&S,A=!1;const R=Array.isArray(j)?j:[j];let F=R.reduce(r(v),{});_===!1&&(F={});const{prevResolvedValues:Y={}}=k,V={...Y,...F},z=M=>{O=!0,f.has(M)&&(A=!0,f.delete(M)),k.needsAnimating[M]=!0;const I=e.getValue(M);I&&(I.liveStyle=!1)};for(const M in V){const I=F[M],b=Y[M];if(y.hasOwnProperty(M))continue;let C=!1;Sw(I)&&Sw(b)?C=!jM(I,b):C=I!==b,C?I!=null?z(M):f.add(M):I!==void 0&&f.has(M)?z(M):k.protectedKeys[M]=!0}k.prevProp=j,k.prevResolvedValues=F,k.isActive&&(y={...y,...F}),(a||i)&&e.blockInitialAnimation&&(O=!1);const W=T&&E;O&&(!W||A)&&m.push(...R.map(M=>{const I={type:v};if(typeof M=="string"&&(a||i)&&!W&&e.manuallyAnimateOnMount&&e.parent){const{parent:b}=e,C=ws(b,M);if(b.enteringChildren&&C){const{delayChildren:D}=C.transition||{};I.delay=HP(b.enteringChildren,e,D)}}return{animation:M,options:I}}))}if(f.size){const w={};if(typeof h.initial!="boolean"){const v=ws(e,Array.isArray(h.initial)?h.initial[0]:h.initial);v&&v.transition&&(w.transition=v.transition)}f.forEach(v=>{const k=e.getBaseTarget(v),j=e.getValue(v);j&&(j.liveStyle=!0),w[v]=k??null}),m.push({animation:w})}let x=!!m.length;return a&&(h.initial===!1||h.initial===h.animate)&&!e.manuallyAnimateOnMount&&(x=!1),a=!1,i=!1,x?t(m):Promise.resolve()}function u(c,h){var m;if(n[c].isActive===h)return Promise.resolve();(m=e.variantChildren)==null||m.forEach(f=>{var y;return(y=f.animationState)==null?void 0:y.setActive(c,h)}),n[c].isActive=h;const d=l(c);for(const f in n)n[f].protectedKeys={};return d}return{animateChanges:l,setActive:u,setAnimateFunction:s,getState:()=>n,reset:()=>{n=y_(),i=!0}}}function oQ(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!jM(t,e):!1}function Vr(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function y_(){return{animate:Vr(!0),whileInView:Vr(),whileHover:Vr(),whileTap:Vr(),whileDrag:Vr(),whileFocus:Vr(),exit:Vr()}}function Iw(e,t){e.min=t.min,e.max=t.max}function ka(e,t){Iw(e.x,t.x),Iw(e.y,t.y)}function w_(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const _M=1e-4,lQ=1-_M,uQ=1+_M,SM=.01,cQ=0-SM,dQ=0+SM;function hn(e){return e.max-e.min}function hQ(e,t,n){return Math.abs(e-t)<=n}function x_(e,t,n,a=.5){e.origin=a,e.originPoint=ct(t.min,t.max,e.origin),e.scale=hn(n)/hn(t),e.translate=ct(n.min,n.max,e.origin)-e.originPoint,(e.scale>=lQ&&e.scale<=uQ||isNaN(e.scale))&&(e.scale=1),(e.translate>=cQ&&e.translate<=dQ||isNaN(e.translate))&&(e.translate=0)}function Mu(e,t,n,a){x_(e.x,t.x,n.x,a?a.originX:void 0),x_(e.y,t.y,n.y,a?a.originY:void 0)}function k_(e,t,n,a=0){const i=a?ct(n.min,n.max,a):n.min;e.min=i+t.min,e.max=e.min+hn(t)}function mQ(e,t,n,a){k_(e.x,t.x,n.x,a==null?void 0:a.x),k_(e.y,t.y,n.y,a==null?void 0:a.y)}function v_(e,t,n,a=0){const i=a?ct(n.min,n.max,a):n.min;e.min=t.min-i,e.max=e.min+hn(t)}function km(e,t,n,a){v_(e.x,t.x,n.x,a==null?void 0:a.x),v_(e.y,t.y,n.y,a==null?void 0:a.y)}function b_(e,t,n,a,i){return e-=t,e=xm(e,1/n,a),i!==void 0&&(e=xm(e,1/i,a)),e}function fQ(e,t=0,n=1,a=.5,i,r=e,s=e){if(si.test(t)&&(t=parseFloat(t),t=ct(s.min,s.max,t/100)-s.min),typeof t!="number")return;let l=ct(r.min,r.max,a);e===r&&(l-=t),e.min=b_(e.min,t,n,l,i),e.max=b_(e.max,t,n,l,i)}function j_(e,t,[n,a,i],r,s){fQ(e,t[n],t[a],t[i],t.scale,r,s)}const pQ=["x","scaleX","originX"],gQ=["y","scaleY","originY"];function __(e,t,n,a){j_(e.x,t,pQ,n?n.x:void 0,a?a.x:void 0),j_(e.y,t,gQ,n?n.y:void 0,a?a.y:void 0)}function S_(e){return e.translate===0&&e.scale===1}function NM(e){return S_(e.x)&&S_(e.y)}function N_(e,t){return e.min===t.min&&e.max===t.max}function yQ(e,t){return N_(e.x,t.x)&&N_(e.y,t.y)}function C_(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function CM(e,t){return C_(e.x,t.x)&&C_(e.y,t.y)}function T_(e){return hn(e.x)/hn(e.y)}function E_(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function Wa(e){return[e("x"),e("y")]}function wQ(e,t,n){let a="";const i=e.x.translate/t.x,r=e.y.translate/t.y,s=(n==null?void 0:n.z)||0;if((i||r||s)&&(a=`translate3d(${i}px, ${r}px, ${s}px) `),(t.x!==1||t.y!==1)&&(a+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:c,rotate:h,rotateX:d,rotateY:m,skewX:f,skewY:y}=n;c&&(a=`perspective(${c}px) ${a}`),h&&(a+=`rotate(${h}deg) `),d&&(a+=`rotateX(${d}deg) `),m&&(a+=`rotateY(${m}deg) `),f&&(a+=`skewX(${f}deg) `),y&&(a+=`skewY(${y}deg) `)}const l=e.x.scale*t.x,u=e.y.scale*t.y;return(l!==1||u!==1)&&(a+=`scale(${l}, ${u})`),a||"none"}const TM=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],xQ=TM.length,A_=e=>typeof e=="string"?parseFloat(e):e,P_=e=>typeof e=="number"||ge.test(e);function kQ(e,t,n,a,i,r){i?(e.opacity=ct(0,n.opacity??1,vQ(a)),e.opacityExit=ct(t.opacity??1,0,bQ(a))):r&&(e.opacity=ct(t.opacity??1,n.opacity??1,a));for(let s=0;s<xQ;s++){const l=TM[s];let u=M_(t,l),c=M_(n,l);if(u===void 0&&c===void 0)continue;u||(u=0),c||(c=0),u===0||c===0||P_(u)===P_(c)?(e[l]=Math.max(ct(A_(u),A_(c),a),0),(si.test(c)||si.test(u))&&(e[l]+="%")):e[l]=c}(t.rotate||n.rotate)&&(e.rotate=ct(t.rotate||0,n.rotate||0,a))}function M_(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const vQ=EM(0,.5,xP),bQ=EM(.5,.95,ca);function EM(e,t,n){return a=>a<e?0:a>t?1:n(fc(e,t,a))}function jQ(e,t,n){const a=Ht(e)?e:cl(e);return a.start(vv("",a,t,n)),a.animation}function yc(e,t,n,a={passive:!0}){return e.addEventListener(t,n,a),()=>e.removeEventListener(t,n)}const _Q=(e,t)=>e.depth-t.depth;class SQ{constructor(){this.children=[],this.isDirty=!1}add(t){uv(this.children,t),this.isDirty=!0}remove(t){mm(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(_Q),this.isDirty=!1,this.children.forEach(t)}}function NQ(e,t){const n=dn.now(),a=({timestamp:i})=>{const r=i-n;r>=t&&(Ar(a),e(r-t))};return et.setup(a,!0),()=>Ar(a)}function bh(e){return Ht(e)?e.get():e}class CQ{constructor(){this.members=[]}add(t){uv(this.members,t);for(let n=this.members.length-1;n>=0;n--){const a=this.members[n];if(a===t||a===this.lead||a===this.prevLead)continue;const i=a.instance;(!i||i.isConnected===!1)&&!a.snapshot&&(mm(this.members,a),a.unmount())}t.scheduleRender()}remove(t){if(mm(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){var n;for(let a=this.members.indexOf(t)-1;a>=0;a--){const i=this.members[a];if(i.isPresent!==!1&&((n=i.instance)==null?void 0:n.isConnected)!==!1)return this.promote(i),!0}return!1}promote(t,n){var i;const a=this.lead;if(t!==a&&(this.prevLead=a,this.lead=t,t.show(),a)){a.updateSnapshot(),t.scheduleRender();const{layoutDependency:r}=a.options,{layoutDependency:s}=t.options;(r===void 0||r!==s)&&(t.resumeFrom=a,n&&(a.preserveOpacity=!0),a.snapshot&&(t.snapshot=a.snapshot,t.snapshot.latestValues=a.animationValues||a.latestValues),(i=t.root)!=null&&i.isUpdating&&(t.isLayoutDirty=!0)),t.options.crossfade===!1&&a.hide()}}exitAnimationComplete(){this.members.forEach(t=>{var n,a,i,r,s;(a=(n=t.options).onExitComplete)==null||a.call(n),(s=(i=t.resumingFrom)==null?void 0:(r=i.options).onExitComplete)==null||s.call(r)})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){var t;(t=this.lead)!=null&&t.snapshot&&(this.lead.snapshot=void 0)}}const jh={hasAnimatedSinceResize:!0,hasEverUpdated:!1},ig=["","X","Y","Z"],TQ=1e3;let EQ=0;function rg(e,t,n,a){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),a&&(a[e]=0))}function AM(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=JP(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",et,!(i||r))}const{parent:a}=e;a&&!a.hasCheckedOptimisedAppear&&AM(a)}function PM({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:a,resetTransform:i}){return class{constructor(s={},l=t==null?void 0:t()){this.id=EQ++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(MQ),this.nodes.forEach(zQ),this.nodes.forEach(FQ),this.nodes.forEach(RQ)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=s,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0;for(let u=0;u<this.path.length;u++)this.path[u].shouldResetTransform=!0;this.root===this&&(this.nodes=new SQ)}addEventListener(s,l){return this.eventHandlers.has(s)||this.eventHandlers.set(s,new cv),this.eventHandlers.get(s).add(l)}notifyListeners(s,...l){const u=this.eventHandlers.get(s);u&&u.notify(...l)}hasListeners(s){return this.eventHandlers.has(s)}mount(s){if(this.instance)return;this.isSVG=Cv(s)&&!PJ(s),this.instance=s;const{layoutId:l,layout:u,visualElement:c}=this.options;if(c&&!c.current&&c.mount(s),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(u||l)&&(this.isLayoutDirty=!0),e){let h,d=0;const m=()=>this.root.updateBlockedByResize=!1;et.read(()=>{d=window.innerWidth}),e(s,()=>{const f=window.innerWidth;f!==d&&(d=f,this.root.updateBlockedByResize=!0,h&&h(),h=NQ(m,250),jh.hasAnimatedSinceResize&&(jh.hasAnimatedSinceResize=!1,this.nodes.forEach(O_)))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&c&&(l||u)&&this.addEventListener("didUpdate",({delta:h,hasLayoutChanged:d,hasRelativeLayoutChanged:m,layout:f})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const y=this.options.transition||c.getDefaultTransition()||VQ,{onLayoutAnimationStart:g,onLayoutAnimationComplete:x}=c.getProps(),w=!this.targetLayout||!CM(this.targetLayout,f),v=!d&&m;if(this.options.layoutRoot||this.resumeFrom||v||d&&(w||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const k={...kv(y,"layout"),onPlay:g,onComplete:x};(c.shouldReduceMotion||this.options.layoutRoot)&&(k.delay=0,k.type=!1),this.startAnimation(k),this.setAnimationOrigin(h,v)}else d||O_(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=f})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const s=this.getStack();s&&s.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Ar(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(BQ),this.animationId++)}getTransformTemplate(){const{visualElement:s}=this.options;return s&&s.getProps().transformTemplate}willUpdate(s=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&AM(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let h=0;h<this.path.length;h++){const d=this.path[h];d.shouldResetTransform=!0,(typeof d.latestValues.x=="string"||typeof d.latestValues.y=="string")&&(d.isLayoutDirty=!0),d.updateScroll("snapshot"),d.options.layoutRoot&&d.willUpdate(!1)}const{layoutId:l,layout:u}=this.options;if(l===void 0&&!u)return;const c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),s&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const u=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),u&&this.nodes.forEach(OQ),this.nodes.forEach(R_);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(I_);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(LQ),this.nodes.forEach(DQ),this.nodes.forEach(AQ),this.nodes.forEach(PQ)):this.nodes.forEach(I_),this.clearAllSnapshots();const l=dn.now();Ut.delta=ci(0,1e3/60,l-Ut.timestamp),Ut.timestamp=l,Ut.isProcessing=!0,Jp.update.process(Ut),Jp.preRender.process(Ut),Jp.render.process(Ut),Ut.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Sv.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(IQ),this.sharedNodes.forEach(KQ)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,et.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){et.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!hn(this.snapshot.measuredBox.x)&&!hn(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let u=0;u<this.path.length;u++)this.path[u].updateScroll();const s=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=It()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:l}=this.options;l&&l.notify("LayoutMeasure",this.layout.layoutBox,s?s.layoutBox:void 0)}updateScroll(s="measure"){let l=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===s&&(l=!1),l&&this.instance){const u=a(this.instance);this.scroll={animationId:this.root.animationId,phase:s,isRoot:u,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:u}}}resetTransform(){if(!i)return;const s=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,l=this.projectionDelta&&!NM(this.projectionDelta),u=this.getTransformTemplate(),c=u?u(this.latestValues,""):void 0,h=c!==this.prevTransformTemplateValue;s&&this.instance&&(l||Yr(this.latestValues)||h)&&(i(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(s=!0){const l=this.measurePageBox();let u=this.removeElementScroll(l);return s&&(u=this.removeTransform(u)),HQ(u),{animationId:this.root.animationId,measuredBox:l,layoutBox:u,latestValues:{},source:this.id}}measurePageBox(){var c;const{visualElement:s}=this.options;if(!s)return It();const l=s.measureViewportBox();if(!(((c=this.scroll)==null?void 0:c.wasRoot)||this.path.some(WQ))){const{scroll:h}=this.root;h&&(Xa(l.x,h.offset.x),Xa(l.y,h.offset.y))}return l}removeElementScroll(s){var u;const l=It();if(ka(l,s),(u=this.scroll)!=null&&u.wasRoot)return l;for(let c=0;c<this.path.length;c++){const h=this.path[c],{scroll:d,options:m}=h;h!==this.root&&d&&m.layoutScroll&&(d.wasRoot&&ka(l,s),Xa(l.x,d.offset.x),Xa(l.y,d.offset.y))}return l}applyTransform(s,l=!1,u){var h,d;const c=u||It();ka(c,s);for(let m=0;m<this.path.length;m++){const f=this.path[m];!l&&f.options.layoutScroll&&f.scroll&&f!==f.root&&(Xa(c.x,-f.scroll.offset.x),Xa(c.y,-f.scroll.offset.y)),Yr(f.latestValues)&&vh(c,f.latestValues,(h=f.layout)==null?void 0:h.layoutBox)}return Yr(this.latestValues)&&vh(c,this.latestValues,(d=this.layout)==null?void 0:d.layoutBox),c}removeTransform(s){var u;const l=It();ka(l,s);for(let c=0;c<this.path.length;c++){const h=this.path[c];if(!Yr(h.latestValues))continue;let d;h.instance&&(Pw(h.latestValues)&&h.updateSnapshot(),d=It(),ka(d,h.measurePageBox())),__(l,h.latestValues,(u=h.snapshot)==null?void 0:u.layoutBox,d)}return Yr(this.latestValues)&&__(l,this.latestValues),l}setTargetDelta(s){this.targetDelta=s,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(s){this.options={...this.options,...s,crossfade:s.crossfade!==void 0?s.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Ut.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(s=!1){var f;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const u=!!this.resumingFrom||this!==l;if(!(s||u&&this.isSharedProjectionDirty||this.isProjectionDirty||(f=this.parent)!=null&&f.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:h,layoutId:d}=this.options;if(!this.layout||!(h||d))return;this.resolvedRelativeTargetAt=Ut.timestamp;const m=this.getClosestProjectingParent();m&&this.linkedParentVersion!==m.layoutVersion&&!m.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&m&&m.layout?this.createRelativeTarget(m,this.layout.layoutBox,m.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=It(),this.targetWithTransforms=It()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),mQ(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):ka(this.target,this.layout.layoutBox),fM(this.target,this.targetDelta)):ka(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&m&&!!m.resumingFrom==!!this.resumingFrom&&!m.options.layoutScroll&&m.target&&this.animationProgress!==1?this.createRelativeTarget(m,this.target,m.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||Pw(this.parent.latestValues)||mM(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(s,l,u){this.relativeParent=s,this.linkedParentVersion=s.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=It(),this.relativeTargetOrigin=It(),km(this.relativeTargetOrigin,l,u,this.options.layoutAnchor||void 0),ka(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var y;const s=this.getLead(),l=!!this.resumingFrom||this!==s;let u=!0;if((this.isProjectionDirty||(y=this.parent)!=null&&y.isProjectionDirty)&&(u=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(u=!1),this.resolvedRelativeTargetAt===Ut.timestamp&&(u=!1),u)return;const{layout:c,layoutId:h}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(c||h))return;ka(this.layoutCorrected,this.layout.layoutBox);const d=this.treeScale.x,m=this.treeScale.y;$J(this.layoutCorrected,this.treeScale,this.path,l),s.layout&&!s.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(s.target=s.layout.layoutBox,s.targetWithTransforms=It
vendor: 4,683 bytes, line 650
650());const{target:f}=s;if(!f){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(w_(this.prevProjectionDelta.x,this.projectionDelta.x),w_(this.prevProjectionDelta.y,this.projectionDelta.y)),Mu(this.projectionDelta,this.layoutCorrected,f,this.latestValues),(this.treeScale.x!==d||this.treeScale.y!==m||!E_(this.projectionDelta.x,this.prevProjectionDelta.x)||!E_(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",f))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(s=!0){var l;if((l=this.options.visualElement)==null||l.scheduleRender(),s){const u=this.getStack();u&&u.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=bo(),this.projectionDelta=bo(),this.projectionDeltaWithTransform=bo()}setAnimationOrigin(s,l=!1){const u=this.snapshot,c=u?u.latestValues:{},h={...this.latestValues},d=bo();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!l;const m=It(),f=u?u.source:void 0,y=this.layout?this.layout.source:void 0,g=f!==y,x=this.getStack(),w=!x||x.members.length<=1,v=!!(g&&!w&&this.options.crossfade===!0&&!this.path.some(UQ));this.animationProgress=0;let k;this.mixTargetDelta=j=>{const S=j/1e3;L_(d.x,s.x,S),L_(d.y,s.y,S),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(km(m,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),$Q(this.relativeTarget,this.relativeTargetOrigin,m,S),k&&yQ(this.relativeTarget,k)&&(this.isProjectionDirty=!1),k||(k=It()),ka(k,this.relativeTarget)),g&&(this.animationValues=h,kQ(h,c,this.latestValues,S,v,w)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=S},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(s){var l,u,c;this.notifyListeners("animationStart"),(l=this.currentAnimation)==null||l.stop(),(c=(u=this.resumingFrom)==null?void 0:u.currentAnimation)==null||c.stop(),this.pendingAnimation&&(Ar(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=et.update(()=>{jh.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=cl(0)),this.motionValue.jump(0,!1),this.currentAnimation=jQ(this.motionValue,[0,1e3],{...s,velocity:0,isSync:!0,onUpdate:h=>{this.mixTargetDelta(h),s.onUpdate&&s.onUpdate(h)},onStop:()=>{},onComplete:()=>{s.onComplete&&s.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const s=this.getStack();s&&s.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(TQ),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const s=this.getLead();let{targetWithTransforms:l,target:u,layout:c,latestValues:h}=s;if(!(!l||!u||!c)){if(this!==s&&this.layout&&c&&MM(this.options.animationType,this.layout.layoutBox,c.layoutBox)){u=this.target||It();const d=hn(this.layout.layoutBox.x);u.x.min=s.target.x.min,u.x.max=u.x.min+d;const m=hn(this.layout.layoutBox.y);u.y.min=s.target.y.min,u.y.max=u.y.min+m}ka(l,u),vh(l,h),Mu(this.projectionDeltaWithTransform,this.layoutCorrected,l,h)}}registerSharedNode(s,l){this.sharedNodes.has(s)||this.sharedNodes.set(s,new CQ),this.sharedNodes.get(s).add(l);const c=l.options.initialPromotionConfig;l.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(l):void 0})}isLead(){const s=this.getStack();return s?s.lead===this:!0}getLead(){var l;const{layoutId:s}=this.options;return s?((l=this.getStack())==null?void 0:l.lead)||this:this}getPrevLead(){var l;const{layoutId:s}=this.options;return s?(l=this.getStack())==null?void 0:l.prevLead:void 0}getStack(){const{layoutId:s}=this.options;if(s)return this.root.sharedNodes.get(s)}promote({needsReset:s,transition:l,preserveFollowOpacity:u}={}){const c=this.getStack();c&&c.promote(this,u),s&&(this.projectionDelta=void 0,this.needsReset=!0),l&&this.setOptions({transition:l})}relegate(){const s=this.getStack();return s?s.relegate(this):!1}
vendor: 4,506 bytes, line 650
650resetSkewAndRotation(){const{visualElement:s}=this.options;if(!s)return;let l=!1;const{latestValues:u}=s;if((u.z||u.rotate||u.rotateX||u.rotateY||u.rotateZ||u.skewX||u.skewY)&&(l=!0),!l)return;const c={};u.z&&rg("z",s,c,this.animationValues);for(let h=0;h<ig.length;h++)rg(`rotate${ig[h]}`,s,c,this.animationValues),rg(`skew${ig[h]}`,s,c,this.animationValues);s.render();for(const h in c)s.setStaticValue(h,c[h]),this.animationValues&&(this.animationValues[h]=c[h]);s.scheduleRender()}applyProjectionStyles(s,l){if(!this.instance||this.isSVG)return;if(!this.isVisible){s.visibility="hidden";return}const u=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,s.visibility="",s.opacity="",s.pointerEvents=bh(l==null?void 0:l.pointerEvents)||"",s.transform=u?u(this.latestValues,""):"none";return}const c=this.getLead();if(!this.projectionDelta||!this.layout||!c.target){this.options.layoutId&&(s.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,s.pointerEvents=bh(l==null?void 0:l.pointerEvents)||""),this.hasProjected&&!Yr(this.latestValues)&&(s.transform=u?u({},""):"none",this.hasProjected=!1);return}s.visibility="";const h=c.animationValues||c.latestValues;this.applyTransformsToTarget();let d=wQ(this.projectionDeltaWithTransform,this.treeScale,h);u&&(d=u(h,d)),s.transform=d;const{x:m,y:f}=this.projectionDelta;s.transformOrigin=`${m.origin*100}% ${f.origin*100}% 0`,c.animationValues?s.opacity=c===this?h.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:h.opacityExit:s.opacity=c===this?h.opacity!==void 0?h.opacity:"":h.opacityExit!==void 0?h.opacityExit:0;for(const y in Rw){if(h[y]===void 0)continue;const{correct:g,applyTo:x,isCSSVariable:w}=Rw[y],v=d==="none"?h[y]:g(h[y],c);if(x){const k=x.length;for(let j=0;j<k;j++)s[x[j]]=v}else w?this.options.visualElement.renderState.vars[y]=v:s[y]=v}this.options.layoutId&&(s.pointerEvents=c===this?bh(l==null?void 0:l.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(s=>{var l;return(l=s.currentAnimation)==null?void 0:l.stop()}),this.root.nodes.forEach(R_),this.root.sharedNodes.clear()}}}function AQ(e){e.updateLayout()}function PQ(e){var n;const t=((n=e.resumeFrom)==null?void 0:n.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:a,measuredBox:i}=e.layout,{animationType:r}=e.options,s=t.source!==e.layout.source;if(r==="size")Wa(d=>{const m=s?t.measuredBox[d]:t.layoutBox[d],f=hn(m);m.min=a[d].min,m.max=m.min+f});else if(r==="x"||r==="y"){const d=r==="x"?"y":"x";Iw(s?t.measuredBox[d]:t.layoutBox[d],a[d])}else MM(r,t.layoutBox,a)&&Wa(d=>{const m=s?t.measuredBox[d]:t.layoutBox[d],f=hn(a[d]);m.max=m.min+f,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[d].max=e.relativeTarget[d].min+f)});const l=bo();Mu(l,a,t.layoutBox);const u=bo();s?Mu(u,e.applyTransform(i,!0),t.measuredBox):Mu(u,a,t.layoutBox);const c=!NM(l);let h=!1;if(!e.resumeFrom){const d=e.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:m,layout:f}=d;if(m&&f){const y=e.options.layoutAnchor||void 0,g=It();km(g,t.layoutBox,m.layoutBox,y);const x=It();km(x,a,f.layoutBox,y),CM(g,x)||(h=!0),d.options.layoutRoot&&(e.relativeTarget=x,e.relativeTargetOrigin=g,e.relativeParent=d)}}}e.notifyListeners("didUpdate",{layout:a,snapshot:t,delta:u,layoutDelta:l,hasLayoutChanged:c,hasRelativeLayoutChanged:h})}else if(e.isLead()){const{onExitComplete:a}=e.options;a&&a()}e.options.transition=void 0}function MQ(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function RQ(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function IQ(e){e.clearSnapshot()}function R_(e){e.clearMeasurements()}function OQ(e){e.isLayoutDirty=!0,e.updateLayout()}function I_(e){e.isLayoutDirty=!1}function LQ(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function DQ(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function O_(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function zQ(e){e.resolveTargetDelta()}function FQ(e){e.calcProjection()}
650function BQ(e){e.resetSkewAndRotation()}function KQ(e){e.removeLeadSnapshot()}function L_(e,t,n){e.translate=ct(t.translate,0,n),e.scale=ct(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function D_(e,t,n,a){e.min=ct(t.min,n.min,a),e.max=ct(t.max,n.max,a)}function $Q(e,t,n,a){D_(e.x,t.x,n.x,a),D_(e.y,t.y,n.y,a)}function UQ(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const VQ={duration:.45,ease:[.4,0,.1,1]},z_=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),F_=z_("applewebkit/")&&!z_("chrome/")?Math.round:ca;function B_(e){e.min=F_(e.min),e.max=F_(e.max)}function HQ(e){B_(e.x),B_(e.y)}function MM(e,t,n){return e==="position"||e==="preserve-aspect"&&!hQ(T_(t),T_(n),.2)}function WQ(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const qQ=PM({attachResizeListener:(e,t)=>yc(e,"resize",t),measureScroll:()=>{var e,t;return{x:document.documentElement.scrollLeft||((e=document.body)==null?void 0:e.scrollLeft)||0,y:document.documentElement.scrollTop||((t=document.body)==null?void 0:t.scrollTop)||0}},checkIsScrollRoot:()=>!0}),sg={current:void 0},RM=PM({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!sg.current){const e=new qQ({});e.mount(window),e.setOptions({layoutScroll:!0}),sg.current=e}return sg.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),Mv=p.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function K_(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function GQ(...e){return t=>{let n=!1;const a=e.map(i=>{const r=K_(i,t);return!n&&typeof r=="function"&&(n=!0),r});if(n)return()=>{for(let i=0;i<a.length;i++){const r=a[i];typeof r=="function"?r():K_(e[i],null)}}}}function YQ(...e){return p.useCallback(GQ(...e),e)}class JQ extends p.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(yh(n)&&t.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const a=n.offsetParent,i=yh(a)&&a.offsetWidth||0,r=yh(a)&&a.offsetHeight||0,s=getComputedStyle(n),l=this.props.sizeRef.current;l.height=parseFloat(s.height),l.width=parseFloat(s.width),l.top=n.offsetTop,l.left=n.offsetLeft,l.right=i-l.width-l.left,l.bottom=r-l.height-l.top}return null}componentDidUpdate(){}render(){return this.props.children}}function QQ({children:e,isPresent:t,anchorX:n,anchorY:a,root:i,pop:r}){var m;const s=p.useId(),l=p.useRef(null),u=p.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:c}=p.useContext(Mv),h=((m=e.props)==null?void 0:m.ref)??(e==null?void 0:e.ref),d=YQ(l,h);return p.useInsertionEffect(()=>{const{width:f,height:y,top:g,left:x,right:w,bottom:v}=u.current;if(t||r===!1||!l.current||!f||!y)return;const k=n==="left"?`left: ${x}`:`right: ${w}`,j=a==="bottom"?`bottom: ${v}`:`top: ${g}`;l.current.dataset.motionPopId=s;const S=document.createElement("style");c&&(S.nonce=c);const _=i??document.head;return _.appendChild(S),S.sheet&&S.sheet.insertRule(` 651 [data-motion-pop-id="${s}"] { 652 position: absolute !important; 653 width: ${f}px !important; 654 height: ${y}px !important; 655 ${k}px !important; 656 ${j}px !important; 657 } 658 `),()=>{var T;(T=l.current)==null||T.removeAttribute("data-motion-pop-id"),_.contains(S)&&_.removeChild(S)}},[t]),o.jsx(JQ,{isPresent:t,childRef:l,sizeRef:u,pop:r,children:r===!1?e:p.cloneElement(e,{ref:d})})}const XQ=({children:e,initial:t,isPresent:n,onExitComplete:a,custom:i,presenceAffectsLayout:r,mode:s,anchorX:l,anchorY:u,root:c})=>{const h=lv(ZQ),d=p.useId();let m=!0,f=p.useMemo(()=>(m=!1,{id:d,initial:t,isPresent:n,custom:i,onExitComplete:y=>{h.set(y,!0);for(const g of h.values())if(!g)return;a&&a()},register:y=>(h.set(y,!1),()=>h.delete(y))}),[n,h,a]);return r&&m&&(f={...f}),p.useMemo(()=>{h.forEach((y,g)=>h.set(g,!1))},[n]),p.useEffect(()=>{!n&&!h.size&&a&&a()},[n]),e=o.jsx(QQ,{pop:s==="popLayout",isPresent:n,anchorX:l,anchorY:u,root:c,children:e}),o.jsx(_f.Provider,{value:f,children:e})};function ZQ(){return new Map}function IM(e=!0){const t=p.useContext(_f);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:a,register:i}=t,r=p.useId();p.useEffect(()=>{if(e)return i(r)},[e]);const s=p.useCallback(()=>e&&a&&a(r),[r,a,e]);return!n&&a?[!1,s]:[!0]}const Bd=e=>e.key||"";function $_(e){const t=[];
vendor: 5,780 bytes, line 658
658return p.Children.forEach(e,n=>{p.isValidElement(n)&&t.push(n)}),t}const Rv=({children:e,custom:t,initial:n=!0,onExitComplete:a,presenceAffectsLayout:i=!0,mode:r="sync",propagate:s=!1,anchorX:l="left",anchorY:u="top",root:c})=>{const[h,d]=IM(s),m=p.useMemo(()=>$_(e),[e]),f=s&&!h?[]:m.map(Bd),y=p.useRef(!0),g=p.useRef(m),x=lv(()=>new Map),w=p.useRef(new Set),[v,k]=p.useState(m),[j,S]=p.useState(m);oP(()=>{y.current=!1,g.current=m;for(let E=0;E<j.length;E++){const O=Bd(j[E]);f.includes(O)?(x.delete(O),w.current.delete(O)):x.get(O)!==!0&&x.set(O,!1)}},[j,f.length,f.join("-")]);const _=[];if(m!==v){let E=[...m];for(let O=0;O<j.length;O++){const A=j[O],R=Bd(A);f.includes(R)||(E.splice(O,0,A),_.push(A))}return r==="wait"&&_.length&&(E=_),S($_(E)),k(m),null}const{forceRender:T}=p.useContext(ov);return o.jsx(o.Fragment,{children:j.map(E=>{const O=Bd(E),A=s&&!h?!1:m===j||f.includes(O),R=()=>{if(w.current.has(O))return;if(x.has(O))w.current.add(O),x.set(O,!0);else return;let F=!0;x.forEach(Y=>{Y||(F=!1)}),F&&(T==null||T(),S(g.current),s&&(d==null||d()),a&&a())};return o.jsx(XQ,{isPresent:A,initial:!y.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:r,root:c,onExitComplete:A?void 0:R,anchorX:l,anchorY:u,children:E},O)})})},OM=p.createContext({strict:!1}),U_={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let V_=!1;function eX(){if(V_)return;const e={};for(const t in U_)e[t]={isEnabled:n=>U_[t].some(a=>!!n[a])};cM(e),V_=!0}function LM(){return eX(),zJ()}function tX(e){const t=LM();for(const n in e)t[n]={...t[n],...e[n]};cM(t)}const nX=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function vm(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||nX.has(e)}let DM=e=>!vm(e);function aX(e){typeof e=="function"&&(DM=t=>t.startsWith("on")?!vm(t):e(t))}try{aX(require("@emotion/is-prop-valid").default)}catch{}function iX(e,t,n){const a={};for(const i in e)i==="values"&&typeof e.values=="object"||Ht(e[i])||(DM(i)||n===!0&&vm(i)||!t&&!vm(i)||e.draggable&&i.startsWith("onDrag"))&&(a[i]=e[i]);return a}const Ef=p.createContext({});function rX(e,t){if(Tf(e)){const{initial:n,animate:a}=e;return{initial:n===!1||gc(n)?n:void 0,animate:gc(a)?a:void 0}}return e.inherit!==!1?t:{}}function sX(e){const{initial:t,animate:n}=rX(e,p.useContext(Ef));return p.useMemo(()=>({initial:t,animate:n}),[H_(t),H_(n)])}function H_(e){return Array.isArray(e)?e.join(" "):e}const Iv=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function zM(e,t,n){for(const a in t)!Ht(t[a])&&!yM(a,n)&&(e[a]=t[a])}function oX({transformTemplate:e},t){return p.useMemo(()=>{const n=Iv();return Av(n,t,e),Object.assign({},n.vars,n.style)},[t])}function lX(e,t){const n=e.style||{},a={};return zM(a,n,e),Object.assign(a,oX(e,t)),a}function uX(e,t){const n={},a=lX(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,a.userSelect=a.WebkitUserSelect=a.WebkitTouchCallout="none",a.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=a,n}const FM=()=>({...Iv(),attrs:{}});function cX(e,t,n,a){const i=p.useMemo(()=>{const r=FM();return wM(r,t,kM(a),e.transformTemplate,e.style),{...r.attrs,style:{...r.style}}},[t]);if(e.style){const r={};zM(r,e.style,e),i.style={...r,...i.style}}return i}const dX=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Ov(e){return typeof e!="string"||e.includes("-")?!1:!!(dX.indexOf(e)>-1||/[A-Z]/u.test(e))}function hX(e,t,n,{latestValues:a},i,r=!1,s){const u=(s??Ov(e)?cX:uX)(t,a,i,e),c=iX(t,typeof e=="string",r),h=e!==p.Fragment?{...c,...u,ref:n}:{},{children:d}=t,m=p.useMemo(()=>Ht(d)?d.get():d,[d]);return p.createElement(e,{...h,children:m})}function mX({scrapeMotionValuesFromProps:e,createRenderState:t},n,a,i){return{latestValues:fX(n,a,i,e),renderState:t()}}function fX(e,t,n,a){const i={},r=a(e,{});for(const m in r)i[m]=bh(r[m]);let{initial:s,animate:l}=e;const u=Tf(e),c=lM(e);t&&c&&!u&&e.inherit!==!1&&(s===void 0&&(s=t.initial),l===void 0&&(l=t.animate));let h=n?n.initial===!1:!1;h=h||s===!1;const d=h?l:s;if(d&&typeof d!="boolean"&&!Cf(d)){const m=Array.isArray(d)?d:[d];for(let f=0;f<m.length;f++){const y=bv(e,m[f]);if(y){const{transitionEnd:g,transition:x,...w}=y;for(const v in w){let k=w[v];if(Array.isArray(k)){const j=h?k.length-1:0;k=k[j]}k!==null&&(i[v]=k)}for(const v in g)i[v]=g[v]}}}return i}const BM=e=>(t,n)=>{const a=p.useContext(Ef),i=p.useContext(_f),r=()=>mX(e,t,a,i);return n?r():lv(r)},pX=BM({scrapeMotionValuesFromProps:Pv,createRenderState:Iv}),gX=BM({scrapeMotionValuesFromProps:vM,createRenderState:FM}),yX=Symbol.for("motionComponentSymbol");function wX(e,t,n){const a=p.useRef(n);p.useInsertionEffect(()=>{a.current=n});const i=p.useRef(null);return p.useCallback(r=>{var l;
vendor: 22,188 bytes, line 658
658r&&((l=e.onMount)==null||l.call(e,r));const s=a.current;if(typeof s=="function")if(r){const u=s(r);typeof u=="function"&&(i.current=u)}else i.current?(i.current(),i.current=null):s(r);else s&&(s.current=r);t&&(r?t.mount(r):t.unmount())},[t])}const KM=p.createContext({});function ro(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function xX(e,t,n,a,i,r){var k,j;const{visualElement:s}=p.useContext(Ef),l=p.useContext(OM),u=p.useContext(_f),c=p.useContext(Mv),h=c.reducedMotion,d=c.skipAnimations,m=p.useRef(null),f=p.useRef(!1);a=a||l.renderer,!m.current&&a&&(m.current=a(e,{visualState:t,parent:s,props:n,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:h,skipAnimations:d,isSVG:r}),f.current&&m.current&&(m.current.manuallyAnimateOnMount=!0));const y=m.current,g=p.useContext(KM);y&&!y.projection&&i&&(y.type==="html"||y.type==="svg")&&kX(m.current,n,i,g);const x=p.useRef(!1);p.useInsertionEffect(()=>{y&&x.current&&y.update(n,u)});const w=n[YP],v=p.useRef(!!w&&typeof window<"u"&&!((k=window.MotionHandoffIsComplete)!=null&&k.call(window,w))&&((j=window.MotionHasOptimisedAnimation)==null?void 0:j.call(window,w)));return oP(()=>{f.current=!0,y&&(x.current=!0,window.MotionIsMounted=!0,y.updateFeatures(),y.scheduleRenderMicrotask(),v.current&&y.animationState&&y.animationState.animateChanges())}),p.useEffect(()=>{y&&(!v.current&&y.animationState&&y.animationState.animateChanges(),v.current&&(queueMicrotask(()=>{var S;(S=window.MotionHandoffMarkAsComplete)==null||S.call(window,w)}),v.current=!1),y.enteringChildren=void 0)}),y}function kX(e,t,n,a){const{layoutId:i,layout:r,drag:s,dragConstraints:l,layoutScroll:u,layoutRoot:c,layoutAnchor:h,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:$M(e.parent)),e.projection.setOptions({layoutId:i,layout:r,alwaysMeasureLayout:!!s||l&&ro(l),visualElement:e,animationType:typeof r=="string"?r:"both",initialPromotionConfig:a,crossfade:d,layoutScroll:u,layoutRoot:c,layoutAnchor:h})}function $M(e){if(e)return e.options.allowProjection!==!1?e.projection:$M(e.parent)}function og(e,{forwardMotionProps:t=!1,type:n}={},a,i){a&&tX(a);const r=n?n==="svg":Ov(e),s=r?gX:pX;function l(c,h){let d;const m={...p.useContext(Mv),...c,layoutId:vX(c)},{isStatic:f}=m,y=sX(c),g=s(c,f);if(!f&&typeof window<"u"){bX();const x=jX(m);d=x.MeasureLayout,y.visualElement=xX(e,g,m,i,x.ProjectionNode,r)}return o.jsxs(Ef.Provider,{value:y,children:[d&&y.visualElement?o.jsx(d,{visualElement:y.visualElement,...m}):null,hX(e,c,wX(g,y.visualElement,h),g,f,t,r)]})}l.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const u=p.forwardRef(l);return u[yX]=e,u}function vX({layoutId:e}){const t=p.useContext(ov).id;return t&&e!==void 0?t+"-"+e:e}function bX(e,t){p.useContext(OM).strict}function jX(e){const t=LM(),{drag:n,layout:a}=t;if(!n&&!a)return{};const i={...n,...a};return{MeasureLayout:n!=null&&n.isEnabled(e)||a!=null&&a.isEnabled(e)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}function _X(e,t){if(typeof Proxy>"u")return og;const n=new Map,a=(r,s)=>og(r,s,e,t),i=(r,s)=>a(r,s);return new Proxy(i,{get:(r,s)=>s==="create"?a:(n.has(s)||n.set(s,og(s,void 0,e,t)),n.get(s))})}const SX=(e,t)=>t.isSVG??Ov(e)?new tQ(t):new YJ(t,{allowProjection:e!==p.Fragment});class NX extends Dr{constructor(t){super(t),t.animationState||(t.animationState=sQ(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Cf(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let CX=0;class TX extends Dr{constructor(){super(...arguments),this.id=CX++,this.isExitComplete=!1}update(){var r;if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:a}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===a)return;if(t&&a===!1){if(this.isExitComplete){const{initial:s,custom:l}=this.node.getProps();if(typeof s=="string"){const u=ws(this.node,s,l);if(u){const{transition:c,transitionEnd:h,...d}=u;for(const m in d)(r=this.node.getValue(m))==null||r.jump(d[m])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const i=this.node.animationState.setActive("exit",!t);n&&!t&&i.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const EX={animation:{Feature:NX},exit:{Feature:TX}};function Gc(e){return{point:{x:e.pageX,y:e.pageY}}}const AX=e=>t=>Nv(t)&&e(t,Gc(t));function Ru(e,t,n,a){return yc(e,t,AX(n),a)}const UM=({current:e})=>e?e.ownerDocument.defaultView:null,W_=(e,t)=>Math.abs(e-t);function PX(e,t){const n=W_(e.x,t.x),a=W_(e.y,t.y);return Math.sqrt(n**2+a**2)}const q_=new Set(["auto","scroll"]);class VM{constructor(t,n,{transformPagePoint:a,contextWindow:i=window,dragSnapToOrigin:r=!1,distanceThreshold:s=3,element:l}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=f=>{this.handleScroll(f.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Kd(this.lastRawMoveEventInfo,this.transformPagePoint));const f=lg(this.lastMoveEventInfo,this.history),y=this.startEvent!==null,g=PX(f.offset,{x:0,y:0})>=this.distanceThreshold;if(!y&&!g)return;const{point:x}=f,{timestamp:w}=Ut;this.history.push({...x,timestamp:w});const{onStart:v,onMove:k}=this.handlers;y||(v&&v(this.lastMoveEvent,f),this.startEvent=this.lastMoveEvent),k&&k(this.lastMoveEvent,f)},this.handlePointerMove=(f,y)=>{this.lastMoveEvent=f,this.lastRawMoveEventInfo=y,this.lastMoveEventInfo=Kd(y,this.transformPagePoint),et.update(this.updatePoint,!0)},this.handlePointerUp=(f,y)=>{this.end();const{onEnd:g,onSessionEnd:x,resumeAnimation:w}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&w&&w(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=lg(f.type==="pointercancel"?this.lastMoveEventInfo:Kd(y,this.transformPagePoint),this.history);this.startEvent&&g&&g(f,v),x&&x(f,v)},!Nv(t))return;this.dragSnapToOrigin=r,this.handlers=n,this.transformPagePoint=a,this.distanceThreshold=s,this.contextWindow=i||window;const u=Gc(t),c=Kd(u,this.transformPagePoint),{point:h}=c,{timestamp:d}=Ut;this.history=[{...h,timestamp:d}];const{onSessionStart:m}=n;m&&m(t,lg(c,this.history)),this.removeListeners=Hc(Ru(this.contextWindow,"pointermove",this.handlePointerMove),Ru(this.contextWindow,"pointerup",this.handlePointerUp),Ru(this.contextWindow,"pointercancel",this.handlePointerUp)),l&&this.startScrollTracking(l)}startScrollTracking(t){let n=t.parentElement;for(;n;){const a=getComputedStyle(n);(q_.has(a.overflowX)||q_.has(a.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const n=this.scrollPositions.get(t);if(!n)return;const a=t===window,i=a?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},r={x:i.x-n.x,y:i.y-n.y};r.x===0&&r.y===0||(a?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=r.x,this.lastMoveEventInfo.point.y+=r.y):this.history.length>0&&(this.history[0].x-=r.x,this.history[0].y-=r.y),this.scrollPositions.set(t,i),et.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Ar(this.updatePoint)}}function Kd(e,t){return t?{point:t(e.point)}:e}function G_(e,t){return{x:e.x-t.x,y:e.y-t.y}}function lg({point:e},t){return{point:e,delta:G_(e,HM(t)),offset:G_(e,MX(t)),velocity:RX(t,.1)}}function MX(e){return e[0]}function HM(e){return e[e.length-1]}function RX(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,a=null;const i=HM(e);for(;n>=0&&(a=e[n],!(i.timestamp-a.timestamp>Pn(t)));)n--;if(!a)return{x:0,y:0};a===e[0]&&e.length>2&&i.timestamp-a.timestamp>Pn(t)*2&&(a=e[1]);const r=sa(i.timestamp-a.timestamp);if(r===0)return{x:0,y:0};const s={x:(i.x-a.x)/r,y:(i.y-a.y)/r};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function IX(e,{min:t,max:n},a){return t!==void 0&&e<t?e=a?ct(t,e,a.min):Math.max(e,t):n!==void 0&&e>n&&(e=a?ct(n,e,a.max):Math.min(e,n)),e}function Y_(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function OX(e,{top:t,left:n,bottom:a,right:i}){return{x:Y_(e.x,n,i),y:Y_(e.y,t,a)}}function J_(e,t){let n=t.min-e.min,a=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,a]=[a,n]),{min:n,max:a}}function LX(e,t){return{x:J_(e.x,t.x),y:J_(e.y,t.y)}}function DX(e,t){let n=.5;const a=hn(e),i=hn(t);return i>a?n=fc(t.min,t.max-a,e.min):a>i&&(n=fc(e.min,e.max-i,t.min)),ci(0,1,n)}function zX(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const Ow=.35;function FX(e=Ow){return e===!1?e=0:e===!0&&(e=Ow),{x:Q_(e,"left","right"),y:Q_(e,"top","bottom")}}function Q_(e,t,n){return{min:X_(e,t),max:X_(e,n)}}function X_(e,t){return typeof e=="number"?e:e[t]||0}const BX=new WeakMap;class KX{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=It(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:a}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const r=d=>{n&&this.snapToCursor(Gc(d).point),this.stopAnimation()},s=(d,m)=>{const{drag:f,dragPropagation:y,onDragStart:g}=this.getProps();if(f&&!y&&(this.openDragLock&&this.openDragLock(),this.openDragLock=fJ(f),!this.openDragLock))return;this.latestPointerEvent=d,this.latestPanInfo=m,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Wa(w=>{let v=this.getAxisMotionValue(w).get()||0;if(si.test(v)){const{projection:k}=this.visualElement;if(k&&k.layout){const j=k.layout.layoutBox[w];j&&(v=hn(j)*(parseFloat(v)/100))}}this.originPoint[w]=v}),g&&et.update(()=>g(d,m),!1,!0),Nw(this.visualElement,"transform");const{animationState:x}=this.visualElement;x&&x.setActive("whileDrag",!0)},l=(d,m)=>{this.latestPointerEvent=d,this.latestPanInfo=m;const{dragPropagation:f,dragDirectionLock:y,onDirectionLock:g,onDrag:x}=this.getProps();if(!f&&!this.openDragLock)return;const{offset:w}=m;if(y&&this.currentDirection===null){this.currentDirection=UX(w),this.currentDirection!==null&&g&&g(this.currentDirection);return}this.updateAxis("x",m.point,w),this.updateAxis("y",m.point,w),this.visualElement.render(),x&&et.update(()=>x(d,m),!1,!0)},u=(d,m)=>{this.latestPointerEvent=d,this.latestPanInfo=m,this.stop(d,m),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{const{dragSnapToOrigin:d}=this.getProps();(d||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:h}=this.getProps();this.panSession=new VM(t,{onSessionStart:r,onStart:s,onMove:l,onSessionEnd:u,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:h,distanceThreshold:a,contextWindow:UM(this.visualElement),element:this.visualElement.current})}stop(t,n){const a=t||this.latestPointerEvent,i=n||this.latestPanInfo,r=this.isDragging;if(this.cancel(),!r||!i||!a)return;const{velocity:s}=i;this.startAnimation(s);const{onDragEnd:l}=this.getProps();l&&et.postRender(()=>l(a,i))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:a}=this.getProps();!a&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,n,a){const{drag:i}=this.getProps();if(!a||!$d(t,i,this.currentDirection))return;const r=this.getAxisMotionValue(t);let s=this.originPoint[t]+a[t];this.constraints&&this.constraints[t]&&(s=IX(s,this.constraints[t],this.elastic[t])),r.set(s)}resolveConstraints(){var r;const{dragConstraints:t,dragElastic:n}=this.getProps(),a=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(r=this.visualElement.projection)==null?void 0:r.layout,i=this.constraints;t&&ro(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&a?this.constraints=OX(a.layoutBox,t):this.constraints=!1,this.elastic=FX(n),i!==this.constraints&&!ro(t)&&a&&this.constraints&&!this.hasMutatedConstraints&&Wa(s=>{this.constraints!==!1&&this.getAxisMotionValue(s)&&(this.constraints[s]=zX(a.layoutBox[s],this.constraints[s]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!ro(t))return!1;const a=t.current;ll(a!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const r=UJ(a,i.root,this.visualElement.getTransformPagePoint());let s=LX(i.layout.layoutBox,r);if(n){const l=n(BJ(s));this.hasMutatedConstraints=!!l,l&&(s=hM(l))}return s}startAnimation(t){const{drag:n,dragMomentum:a,dragElastic:i,dragTransition:r,dragSnapToOrigin:s,onDragTransitionEnd:l}=this.getProps(),u=this.constraints||{},c=Wa(h=>{if(!$d(h,n,this.currentDirection))return;let d=u&&u[h]||{};(s===!0||s===h)&&(d={min:0,max:0});const m=i?200:1e6,f=i?40:1e7,y={type:"inertia",velocity:a?t[h]:0,bounceStiffness:m,bounceDamping:f,timeConstant:750,restDelta:1,restSpeed:10,...r,...d};return this.startAxisValueAnimation(h,y)});return Promise.all(c).then(l)}startAxisValueAnimation(t,n){const a=this.getAxisMotionValue(t);return Nw(this.visualElement,t),a.start(vv(t,a,0,n,this.visualElement,!1))}stopAnimation(){Wa(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,a=this.visualElement.getProps(),i=a[n];return i||this.visualElement.getValue(t,(a.initial?a.initial[t]:void 0)||0)}snapToCursor(t){Wa(n=>{const{drag:a}=this.getProps();if(!$d(n,a,this.currentDirection))return;const{projection:i}=this.visualElement,r=this.getAxisMotionValue(n);if(i&&i.layout){const{min:s,max:l}=i.layout.layoutBox[n],u=r.get()||0;r.set(t[n]-ct(s,l,.5)+u)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:a}=this.visualElement;if(!ro(n)||!a||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Wa(s=>{const l=this.getAxisMotionValue(s);if(l&&this.constraints!==!1){const u=l.get();i[s]=DX({min:u,max:u},this.constraints[s])}});const{transformTemplate:r}=this.visualElement.getProps();this.visualElement.current.style.transform=r?r({},""):"none",a.root&&a.root.updateScroll(),a.updateLayout(),this.constraints=!1,this.resolveConstraints(),Wa(s=>{if(!$d(s,t,null))return;const l=this.getAxisMotionValue(s),{min:u,max:c}=this.constraints[s];l.set(ct(u,c,i[s]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;BX.set(this.visualElement,this);const t=this.visualElement.current,n=Ru(t,"pointerdown",c=>{const{drag:h,dragListener:d=!0}=this.getProps(),m=c.target,f=m!==t&&kJ(m);h&&d&&!f&&this.start(c)});let a;const i=()=>{const{dragConstraints:c}=this.getProps();ro(c)&&c.current&&(this.constraints=this.resolveRefConstraints(),a||(a=$X(t,c.current,()=>this.scalePositionWithinConstraints())))},{projection:r}=this.visualElement,s=r.addEventListener("measure",i);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),et.read(i);const l=yc(window,"resize",()=>this.scalePositionWithinConstraints()),u=r.addEventListener("didUpdate",({delta:c,hasLayoutChanged:h})=>{this.isDragging&&h&&(Wa(d=>{const m=this.getAxisMotionValue(d);m&&(this.originPoint[d]+=c[d].translate,m.set(m.get()+c[d].translate))}),this.visualElement.render())});return()=>{l(),n(),s(),u&&u(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:a=!1,dragPropagation:i=!1,dragConstraints:r=!1,dragElastic:s=Ow,dragMomentum:l=!0}=t;return{...t,drag:n,dragDirectionLock:a,dragPropagation:i,dragConstraints:r,dragElastic:s,dragMomentum:l}}}function Z_(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function $X(e,t,n){const a=s_(e,Z_(n)),i=s_(t,Z_(n));return()=>{a(),i()}}function $d(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function UX(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class VX extends Dr{constructor(t){super(t),this.removeGroupControls=ca,this.removeListeners=ca,this.controls=new KX(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||ca}update(){const{dragControls:t}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};t!==n&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const ug=e=>(t,n)=>{e&&et.update(()=>e(t,n),!1,!0)};class HX extends Dr{constructor(){super(...arguments),this.removePointerDownListener=ca}onPointerDown(t){this.session=new VM(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:UM(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:a,onPanEnd:i}=this.node.getProps();return{onSessionStart:ug(t),onStart:ug(n),onMove:ug(a),onEnd:(r,s)=>{delete this.session,i&&et.postRender(()=>i(r,s))}}}mount(){this.removePointerDownListener=Ru(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let cg=!1;class WX extends p.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:a,layoutId:i}=this.props,{projection:r}=t;r&&(n.group&&n.group.add(r),a&&a.register&&i&&a.register(r),cg&&r.root.didUpdate(),r.addEventListener("animationComplete",()=>{this.safeToRemove()}),r.setOptions({...r.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),jh.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:a,drag:i,isPresent:r}=this.props,{projection:s}=a;return s&&(s.isPresent=r,t.layoutDependency!==n&&s.setOptions({...s.options,layoutDependency:n}),cg=!0,i||t.layoutDependency!==n||n===void 0||t.isPresent!==r?s.willUpdate():this.safeToRemove(),t.isPresent!==r&&(r?s.promote():s.relegate()||et.postRender(()=>{const l=s.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:t,layoutAnchor:n}=this.props,{projection:a}=t;a&&(a.options.layoutAnchor=n,a.root.didUpdate(),Sv.postRender(()=>{!a.currentAnimation&&a.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:a}=this.props,{projection:i}=t;cg=!0,i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),a&&a.deregister&&a.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function WM(e){const[t,n]=IM(),a=p.useContext(ov);return o.jsx(WX,{...e,layoutGroup:a,switchLayoutGroup:p.useContext(KM),isPresent:t,safeToRemove:n})}const qX={pan:{Feature:HX},drag:{Feature:VX,ProjectionNode:RM,MeasureLayout:WM}};function eS(e,t,n){const{props:a}=e;e.animationState&&a.whileHover&&e.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,r=a[i];r&&et.postRender(()=>r(t,Gc(t)))}class GX extends Dr{mount(){const{current:t}=this.node;t&&(this.unmount=gJ(t,(n,a)=>(eS(this.node,a,"Start"),i=>eS(this.node,i,"End"))))}unmount(){}}class YX extends Dr{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Hc(yc(this.node.current,"focus",()=>this.onFocus()),yc(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function tS(e,t,n){const{props:a}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&a.whileTap&&e.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),r=a[i];r&&et.postRender(()=>r(t,Gc(t)))}class JX extends Dr{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:a}=this.node.props;this.unmount=bJ(t,(i,r)=>(tS(this.node,r,"Start"),(s,{success:l})=>tS(this.node,s,l?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(a==null?void 0:a.tap)===!1})}unmount(){}}const Lw=new WeakMap,dg=new WeakMap,QX=e=>{const t=Lw.get(e.target);t&&t(e)},XX=e=>{e.forEach(QX)};function ZX({root:e,...t}){const n=e||document;dg.has(n)||dg.set(n,{});const a=dg.get(n),i=JSON.stringify(t);return a[i]||(a[i]=new IntersectionObserver(XX,{root:e,...t})),a[i]}function eZ(e,t,n){const a=ZX(t);return Lw.set(e,n),a.observe(e),()=>{Lw.delete(e),a.unobserve(e)}}const tZ={some:0,all:1};
658class nZ extends Dr{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var u;(u=this.stopObserver)==null||u.call(this);const{viewport:t={}}=this.node.getProps(),{root:n,margin:a,amount:i="some",once:r}=t,s={root:n?n.current:void 0,rootMargin:a,threshold:typeof i=="number"?i:tZ[i]},l=c=>{const{isIntersecting:h}=c;if(this.isInView===h||(this.isInView=h,r&&!h&&this.hasEnteredView))return;h&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",h);const{onViewportEnter:d,onViewportLeave:m}=this.node.getProps(),f=h?d:m;f&&f(c)};this.stopObserver=eZ(this.node.current,s,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(aZ(t,n))&&this.startObserver()}unmount(){var t;(t=this.stopObserver)==null||t.call(this),this.hasEnteredView=!1,this.isInView=!1}}function aZ({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const iZ={inView:{Feature:nZ},tap:{Feature:JX},focus:{Feature:YX},hover:{Feature:GX}},rZ={layout:{ProjectionNode:RM,MeasureLayout:WM}},sZ={...EX,...iZ,...qX,...rZ},Le=_X(sZ,SX),oZ="/assets/haki-icon-Fq9W6G72.jpeg",lZ=()=>{const{t:e,lang:t}=Re(),[n,a]=p.useState("newest"),[i,r]=p.useState(null),{data:s=[],isLoading:l}=iv("bill"),u=s.filter(d=>!i||d.categories.some(m=>m.toLowerCase()===i.toLowerCase())),c=[...u].sort((d,m)=>{if(n==="trending"){const f=y=>(y.click_count||0)*2+(y.follower_count||0)*3+(y.post_count||0)*4;return f(m)-f(d)}return new Date(m.last_action_date).getTime()-new Date(d.last_action_date).getTime()}),h=Eu.map(d=>({stage:d,items:u.filter(m=>m.stage===d.key).sort((m,f)=>new Date(f.last_action_date).getTime()-new Date(m.last_action_date).getTime())})).filter(d=>d.items.length>0);return o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"relative overflow-hidden rounded-2xl h-32",children:[o.jsx("img",{src:oZ,alt:"",className:"absolute inset-0 w-full h-full object-cover"}),o.jsx("div",{className:"absolute inset-0 bg-primary/70"}),o.jsx("div",{className:"relative flex items-center justify-center h-full",children:o.jsx("h1",{className:"font-heading text-2xl font-extrabold text-primary-foreground drop-shadow-lg",children:e("Bills & Amendments","Miswada na Marekebisho")})})]}),o.jsx("div",{className:"flex gap-2",children:["newest","trending","stage"].map(d=>o.jsx("button",{onClick:()=>a(d),className:`chip ${n===d?"chip-active":""}`,children:d==="newest"?e("Newest","Mpya"):d==="trending"?e("Trending","Mwenendo"):e("By Stage","Kwa Hatua")},d))}),o.jsxs("div",{className:"flex gap-2 overflow-x-auto pb-1 scrollbar-none",children:[o.jsx("button",{onClick:()=>r(null),className:`chip flex-shrink-0 ${i?"":"chip-active"}`,children:e("All","Zote")}),rv.map(d=>o.jsx("button",{onClick:()=>r(d.slug),className:`chip flex-shrink-0 ${i===d.slug?"chip-active":""}`,children:t==="en"?d.name_en:d.name_sw},d.id))]}),l?o.jsx("div",{className:"flex items-center justify-center py-12",children:o.jsx(Be,{className:"h-6 w-6 animate-spin text-primary"})}):u.length===0?o.jsx("p",{className:"text-center text-muted-foreground py-8",children:e("No bills found","Hakuna miswada iliyopatikana")}):n==="stage"?o.jsx("div",{className:"space-y-6",children:h.map(({stage:d,items:m})=>o.jsxs("section",{className:"space-y-2",children:[o.jsxs("div",{className:"flex items-baseline justify-between sticky top-0 bg-background/95 backdrop-blur py-1 z-10",children:[o.jsx("h2",{className:"font-heading text-sm font-bold uppercase tracking-wide text-primary",children:t==="en"?d.label_en:d.label_sw}),o.jsx("span",{className:"text-xs text-muted-foreground",children:m.length})]}),o.jsx("div",{className:"space-y-3",children:m.map(f=>o.jsx(Le.div,{initial:{opacity:0,y:5},animate:{opacity:1,y:0},children:o.jsx(hm,{item:f})},f.id))})]},d.key))}):o.jsx("div",{className:"space-y-3",children:c.map(d=>o.jsx(Le.div,{initial:{opacity:0,y:5},animate:{opacity:1,y:0},children:o.jsx(hm,{item:d})},d.id))})]})},Lv="/assets/kenya-crowd-CqPE9aL5.jpeg",uZ=()=>{const{t:e,lang:t}=Re(),{data:n=[],isLoading:a}=iv("budget");return o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"relative overflow-hidden rounded-2xl h-32",children:[o.jsx("img",{src:Lv,alt:"",className:"absolute inset-0 w-full h-full object-cover"}),o.jsx("div",{className:"absolute inset-0 bg-primary/70"}),o.jsxs("div",{className:"relative h-full flex flex-col justify-center px-5",children:[o.jsx("h1",{className:"font-heading text-xl font-bold text-primary-foreground",children:e("Budget Proposals","Mapendekezo ya Bajeti")}
658),o.jsx("p",{className:"text-xs text-primary-foreground/80 mt-1",children:e("Budget Policy Statements and other budget documents.","Taarifa za Sera ya Bajeti na nyaraka nyingine za bajeti.")})]})]}),o.jsx("p",{className:"text-xs text-muted-foreground",children:e("Budget Policy Statements and other budget documents.","Taarifa za Sera ya Bajeti na nyaraka nyingine za bajeti.")}),o.jsxs("div",{className:"flex gap-2 overflow-x-auto pb-1 scrollbar-none",children:[o.jsxs(Q,{size:"sm",variant:"outline",className:"text-[10px] h-8 flex-shrink-0",onClick:()=>cn("https://treasury.go.ke"),children:[o.jsx(yl,{className:"h-3 w-3"}),e("View Treasury Source","Tazama Chanzo cha Hazina")]}),o.jsxs(Q,{size:"sm",variant:"outline",className:"text-[10px] h-8 flex-shrink-0",onClick:()=>cn(Se.bills_tracker.url),children:[o.jsx(La,{className:"h-3 w-3"}),e("View Official Document","Tazama Hati Rasmi")]})]}),o.jsx(Ue,{to:"/my-money",className:"block",children:o.jsx(X,{className:"p-4 bg-gradient-to-br from-accent/15 to-primary/10 border-accent/30 hover:border-accent/60 hover:shadow-lg transition-all",children:o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"h-10 w-10 rounded-xl bg-accent/20 flex items-center justify-center flex-shrink-0",children:o.jsx(Ss,{className:"h-5 w-5 text-accent-foreground"})}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("p",{className:"font-heading font-bold text-sm text-foreground",children:e("See how this affects your pocket","Tazama athari kwa mfuko wako")}),o.jsx("p",{className:"text-[11px] text-muted-foreground mt-0.5",children:e("Open the personal policy impact simulator","Fungua kifaa cha athari za sera")})]}),o.jsx(Kn,{className:"h-4 w-4 text-muted-foreground flex-shrink-0"})]})})}),a?o.jsx("div",{className:"flex items-center justify-center py-12",children:o.jsx(Be,{className:"h-6 w-6 animate-spin text-primary"})}):n.length===0?o.jsx("p",{className:"text-center text-muted-foreground py-8",children:e("No budget documents found","Hakuna nyaraka za bajeti zilizopatikana")}):o.jsx("div",{className:"space-y-3",children:n.map(i=>o.jsx(Le.div,{initial:{opacity:0,y:5},animate:{opacity:1,y:0},children:o.jsx(hm,{item:i})},i.id))})]})},cZ="modulepreload",dZ=function(e){return"/"+e},nS={},Es=function(t,n,a){let i=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),l=(s==null?void 0:s.nonce)||(s==null?void 0:s.getAttribute("nonce"));i=Promise.allSettled(n.map(u=>{if(u=dZ(u),u in nS)return;nS[u]=!0;const c=u.endsWith(".css"),h=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${h}`))return;const d=document.createElement("link");if(d.rel=c?"stylesheet":cZ,c||(d.as="script"),d.crossOrigin="",d.href=u,l&&d.setAttribute("nonce",l),document.head.appendChild(d),c)return new Promise((m,f)=>{d.addEventListener("load",m),d.addEventListener("error",()=>f(new Error(`Unable to preload CSS for ${u}`)))})}))}function r(s){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=s,window.dispatchEvent(l),!l.defaultPrevented)throw s}return i.then(s=>{for(const l of s||[])l.status==="rejected"&&r(l.reason);return t().catch(r)})};function hZ(e){return bl({queryKey:["item-summary",e],queryFn:async()=>{const{data:t,error:n}=await te.from("public_item_summaries").select("*").eq("item_id",e).maybeSingle();if(n)throw n;return t?{id:t.id,item_id:t.item_id,summary_en:t.summary_en||"",summary_sw:t.summary_sw||"",onepager_en:t.onepager_en,onepager_sw:t.onepager_sw,excerpt_highlights:t.excerpt_highlights||[],youth_impacts_en:t.youth_impacts_en||[],youth_impacts_sw:t.youth_impacts_sw||[],confidence_score:t.confidence_score||0,generated_at:t.generated_at||"",model_name:""}:null},enabled:!!e})}const mZ=e=>{const{user:t}
658=Rt(),[n,a]=p.useState(!1),[i,r]=p.useState(0),[s,l]=p.useState(!1);return p.useEffect(()=>{e&&(te.from("bill_follows").select("id",{count:"exact",head:!0}).eq("item_id",e).then(({count:c})=>r(c||0)),t&&te.from("bill_follows").select("id").eq("item_id",e).eq("user_id",t.id).maybeSingle().then(({data:c})=>a(!!c)))},[e,t]),{isFollowing:n,followerCount:i,toggleFollow:async()=>{if(!(!t||!e||s)){l(!0);try{n?(await te.from("bill_follows").delete().eq("item_id",e).eq("user_id",t.id),a(!1),r(c=>Math.max(0,c-1))):(await te.from("bill_follows").insert({item_id:e,user_id:t.id}),a(!0),r(c=>c+1),rP("bill_follow",{refType:"item",refId:e}))}finally{l(!1)}}},loading:s,requiresAuth:!t}};var Af="Tabs",[fZ,yie]=Yt(Af,[uf]),qM=uf(),[pZ,Dv]=fZ(Af),GM=p.forwardRef((e,t)=>{const{__scopeTabs:n,value:a,onValueChange:i,defaultValue:r,orientation:s="horizontal",dir:l,activationMode:u="automatic",...c}=e,h=Sl(l),[d,m]=ma({prop:a,onChange:i,defaultProp:r??"",caller:Af});return o.jsx(pZ,{scope:n,baseId:la(),value:d,onValueChange:m,orientation:s,dir:h,activationMode:u,children:o.jsx(we.div,{dir:h,"data-orientation":s,...c,ref:t})})});GM.displayName=Af;var YM="TabsList",JM=p.forwardRef((e,t)=>{const{__scopeTabs:n,loop:a=!0,...i}=e,r=Dv(YM,n),s=qM(n);return o.jsx(FT,{asChild:!0,...s,orientation:r.orientation,dir:r.dir,loop:a,children:o.jsx(we.div,{role:"tablist","aria-orientation":r.orientation,...i,ref:t})})});JM.displayName=YM;var QM="TabsTrigger",XM=p.forwardRef((e,t)=>{const{__scopeTabs:n,value:a,disabled:i=!1,...r}=e,s=Dv(QM,n),l=qM(n),u=tR(s.baseId,a),c=nR(s.baseId,a),h=a===s.value;return o.jsx(BT,{asChild:!0,...l,focusable:!i,active:h,children:o.jsx(we.button,{type:"button",role:"tab","aria-selected":h,"aria-controls":c,"data-state":h?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:u,...r,ref:t,onMouseDown:ue(e.onMouseDown,d=>{!i&&d.button===0&&d.ctrlKey===!1?s.onValueChange(a):d.preventDefault()}),onKeyDown:ue(e.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&s.onValueChange(a)}),onFocus:ue(e.onFocus,()=>{const d=s.activationMode!=="manual";!h&&!i&&d&&s.onValueChange(a)})})})});XM.displayName=QM;var ZM="TabsContent",eR=p.forwardRef((e,t)=>{const{__scopeTabs:n,value:a,forceMount:i,children:r,...s}=e,l=Dv(ZM,n),u=tR(l.baseId,a),c=nR(l.baseId,a),h=a===l.value,d=p.useRef(h);return p.useEffect(()=>{const m=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(m)},[]),o.jsx(fa,{present:i||h,children:({present:m})=>o.jsx(we.div,{"data-state":h?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":u,hidden:!m,id:c,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:d.current?"0s":void 0},children:m&&r})})});eR.displayName=ZM;function tR(e,t){return`${e}-trigger-${t}`}function nR(e,t){return`${e}-content-${t}`}var gZ=GM,aR=JM,iR=XM,rR=eR;const Yc=gZ,Rl=p.forwardRef(({className:e,...t},n)=>o.jsx(aR,{ref:n,className:ce("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));Rl.displayName=aR.displayName;const Gn=p.forwardRef(({className:e,...t},n)=>o.jsx(iR,{ref:n,className:ce("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",e),...t}));Gn.displayName=iR.displayName;const Ra=p.forwardRef(({className:e,...t},n)=>o.jsx(rR,{ref:n,className:ce("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Ra.displayName=rR.displayName;const yZ={informational:{icon:Zx,label_en:"Informational",label_sw:"Taarifa",color:"bg-info/15 text-info"},public_participation:{icon:my,label_en:"Public Participation",label_sw:"Ushiriki wa Umma",color:"bg-primary/15 text-primary"},community_discussion:{icon:Ns,label_en:"Community Discussion",label_sw:"Mjadala wa Jamii",color:"bg-secondary/15 text-secondary"}},zv=({event:e})=>{const{lang:t}=Re(),n=e.verification_status==="verified",a=new Date(e.start_time)<new Date,i=yZ[e.event_type];return o.jsxs(X,{className:ce("p-4 border-border/60 transition-all",a&&"opacity-60"),children:[o.jsx("div",{className:"flex items-start justify-between gap-2",children:o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsxs("div",{className:"mb-1.5 flex flex-wrap items-center gap-2",children:[n?o.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-success/15 px-2 py-0.5 text-[10px] font-bold text-success",children:[o.jsx(oi,{className:"h-3 w-3"})," Verified"]}):o.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-warning/15 px-2 py-0.5 text-[10px] font-bold text-warning",children:[o.jsx(Ac,{className:"h-3 w-3"})," Pending"]}),o.jsxs("span",{className:ce("inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[10px] font-bold",i.color),children:[o.jsx(i.icon,{className:"h-3 w-3"}),t==="en"?i.label_en:i.label_sw]})]}),o.jsx("h3",{className:"font-heading text-sm font-semibold leading-tight text-foreground",children:e.title}),o.jsx("p",{className:"mt-1 line-clamp-2 text-xs text-muted-foreground",children:e.description})]})}),o.jsxs("div",{className:"mt-3 space-y-1.5 text-xs text-muted-foreground",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(lD,{className:"h-3.5 w-3.5 text-primary"}),new Date(e.start_time).toLocaleDateString("en-GB",{weekday:"short",day:"numeric",month:"short",year:"numeric"})," · ",new Date(e.start_time).toLocaleTimeString("en-GB",{hour:"2-digit",minute:"2-digit"})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Pc,{className:"h-3.5 w-3.5 text-accent"}),e.location_text," · ",e.city,", ",e.county]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Si,{className:"h-3.5 w-3.5 text-secondary"}),e.organizer]})]})]})},wZ=e=>{const{user:t}
658=Rt(),[n,a]=p.useState([]),[i,r]=p.useState(!0),s=p.useCallback(async()=>{if(!e)return;r(!0);const{data:h}=await te.from("forum_posts").select("*").eq("item_id",e).order("created_at",{ascending:!1});if(!h){r(!1);return}const d=h.map(g=>g.id),{data:m}=await te.from("post_reactions").select("post_id, reaction").in("post_id",d.length?d:["_"]);let f={};if(t&&d.length){const{data:g}=await te.from("post_reactions").select("post_id, reaction").eq("user_id",t.id).in("post_id",d);g==null||g.forEach(x=>{f[x.post_id]=x.reaction})}const y={};m==null||m.forEach(g=>{y[g.post_id]||(y[g.post_id]={thumbsUp:0,heart:0}),g.reaction==="thumbsUp"&&y[g.post_id].thumbsUp++,g.reaction==="heart"&&y[g.post_id].heart++}),a(h.map(g=>({...g,reactions:y[g.id]||{thumbsUp:0,heart:0},userReaction:f[g.id]||null}))),r(!1)},[e,t]);return p.useEffect(()=>{s()},[s]),p.useEffect(()=>{if(!e)return;const h=te.channel(`forum-${e}`).on("postgres_changes",{event:"*",schema:"public",table:"forum_posts",filter:`item_id=eq.${e}`},()=>{s()}).subscribe();return()=>{te.removeChannel(h)}},[e,s]),{posts:n,loading:i,createPost:async(h,d)=>{var g;if(!t||!e)return;const{data:m}=await te.from("profiles").select("display_name").eq("user_id",t.id).maybeSingle(),{data:f}=await te.from("user_roles").select("role").eq("user_id",t.id).eq("role","legal").maybeSingle();await te.from("forum_posts").insert({item_id:e,author_id:t.id,author_name:(m==null?void 0:m.display_name)||((g=t.email)==null?void 0:g.split("@")[0])||"User",author_role:f?"legal":"citizen",content:h,reply_to:d||null,is_legal_guidance:!!f});const{awardCivicPoints:y}=await Es(async()=>{const{awardCivicPoints:x}=await Promise.resolve().then(()=>ol);return{awardCivicPoints:x}},void 0);y("forum_post",{refType:"item",refId:e})},toggleReaction:async(h,d)=>{if(!t)return;const m=n.find(f=>f.id===h);m&&(m.userReaction===d?await te.from("post_reactions").delete().eq("post_id",h).eq("user_id",t.id):m.userReaction?await te.from("post_reactions").update({reaction:d}).eq("post_id",h).eq("user_id",t.id):await te.from("post_reactions").insert({post_id:h,user_id:t.id,reaction:d}),s())},deletePost:async h=>{await te.from("forum_posts").delete().eq("id",h)},refresh:s}},Ia=p.forwardRef(({className:e,...t},n)=>o.jsx("textarea",{className:ce("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm r
658ing-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...t}));Ia.displayName="Textarea";function Wt(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function xZ(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}const Ud=43200,aS=1440;let kZ={};function vZ(){return kZ}function iS(e){const t=Wt(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function _h(e,t){const n=Wt(e),a=Wt(t),i=n.getTime()-a.getTime();return i<0?-1:i>0?1:i}function bZ(e){return xZ(e,Date.now())}function jZ(e,t){const n=Wt(e),a=Wt(t),i=n.getFullYear()-a.getFullYear(),r=n.getMonth()-a.getMonth();return i*12+r}function _Z(e){return t=>{const a=(e?Math[e]:Math.trunc)(t);return a===0?0:a}}function SZ(e,t){return+Wt(e)-+Wt(t)}function NZ(e){const t=Wt(e);return t.setHours(23,59,59,999),t}function CZ(e){const t=Wt(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function TZ(e){const t=Wt(e);return+NZ(t)==+CZ(t)}function EZ(e,t){const n=Wt(e),a=Wt(t),i=_h(n,a),r=Math.abs(jZ(n,a));let s;if(r<1)s=0;else{n.getMonth()===1&&n.getDate()>27&&n.setDate(30),n.setMonth(n.getMonth()-i*r);let l=_h(n,a)===-i;TZ(Wt(e))&&r===1&&_h(e,a)===1&&(l=!1),s=i*(r-Number(l))}return s===0?0:s}function AZ(e,t,n){const a=SZ(e,t)/1e3;return _Z(n==null?void 0:n.roundingMethod)(a)}const PZ={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},MZ=(e,t,n)=>{let a;const i=PZ[e];return typeof i=="string"?a=i:t===1?a=i.one:a=i.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+a:a+" ago":a};function hg(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const RZ={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},IZ={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},OZ={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},LZ={date:hg({formats:RZ,defaultWidth:"full"}),time:hg({formats:IZ,defaultWidth:"full"}),dateTime:hg({formats:OZ,defaultWidth:"full"})},DZ={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},zZ=(e,t,n,a)=>DZ[e];function Ql(e){return(t,n)=>{const a=n!=null&&n.context?String(n.context):"standalone";let i;if(a==="formatting"&&e.formattingValues){const s=e.defaultFormattingWidth||e.defaultWidth,l=n!=null&&n.width?String(n.width):s;i=e.formattingValues[l]||e.formattingValues[s]}else{const s=e.defaultWidth,l=n!=null&&n.width?String(n.width):e.defaultWidth;i=e.values[l]||e.values[s]}const r=e.argumentCallback?e.argumentCallback(t):t;return i[r]}}const FZ={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},BZ={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},KZ={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},$Z={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Frid
658ay","Saturday"]},UZ={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},VZ={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},HZ=(e,t)=>{const n=Number(e),a=n%100;if(a>20||a<10)switch(a%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},WZ={ordinalNumber:HZ,era:Ql({values:FZ,defaultWidth:"wide"}),quarter:Ql({values:BZ,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Ql({values:KZ,defaultWidth:"wide"}),day:Ql({values:$Z,defaultWidth:"wide"}),dayPeriod:Ql({values:UZ,defaultWidth:"wide",formattingValues:VZ,defaultFormattingWidth:"wide"})};function Xl(e){return(t,n={})=>{const a=n.width,i=a&&e.matchPatterns[a]||e.matchPatterns[e.defaultMatchWidth],r=t.match(i);if(!r)return null;const s=r[0],l=a&&e.parsePatterns[a]||e.parsePatterns[e.defaultParseWidth],u=Array.isArray(l)?GZ(l,d=>d.test(s)):qZ(l,d=>d.test(s));let c;c=e.valueCallback?e.valueCallback(u):u,c=n.valueCallback?n.valueCallback(c):c;const h=t.slice(s.length);return{value:c,rest:h}}}function qZ(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function GZ(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function YZ(e){return(t,n={})=>{const a=t.match(e.matchPattern);if(!a)return null;const i=a[0],r=t.match(e.parsePattern);if(!r)return null;let s=e.valueCallback?e.valueCallback(r[0]):r[0];s=n.valueCallback?n.valueCallback(s):s;const l=t.slice(i.length);return{value:s,rest:l}}}const JZ=/^(\d+)(th|st|nd|rd)?/i,QZ=/\d+/i,XZ={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},ZZ={any:[/^b/i,/^(a|c)/i]},eee={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},tee={any:[/1/i,/2/i,/3/i,/4/i]},nee={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},aee={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},iee={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},ree={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},see={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},oee={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},lee={ordinalNumber:YZ({matchPattern:JZ,parsePattern:QZ,valueCallback:e=>parseInt(e,10)}),era:Xl({matchPatterns:XZ,defaultMatchWidth:"wide",parsePatterns:ZZ,defaultParseWidth:"any"}),quarter:Xl({matchPatterns:eee,defaultMatchWidth:"wide",parsePatterns:tee,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Xl({matchPatterns:nee,defaultMatchWidth:"wide",parsePatterns:aee,defaultParseWidth:"any"}),day:Xl({matchPatterns:iee,defaultMatchWidth:"wide",parsePatterns:ree,defaultParseWidth:"any"}),dayPeriod:Xl({matchPatterns:see,defaultMatchWidth:"any",parsePatterns:oee,defaultParseWidth:"any"})},uee={code:"en-US",formatDistance:MZ,formatLong:LZ,formatRelative:zZ,localize:WZ,match:lee,options:{weekStartsOn:0,firstWeekContainsDate:1}};function cee(e,t,n){const a=vZ(),i=(n==null?void 0:n.locale)??a.locale??uee,r=2520,s=_h(e,t);if(isNaN(s))throw new RangeError("Invalid time value");const l=Object.assign({},n,{addSuffix:n==null?void 0:n.addSuffix,comparison:s});let u,c;s>0?(u=Wt(t),c=Wt(e)):(u=Wt(e),c=Wt(t));const h=AZ(c,u),d=(iS(c)-iS(u))/1e3,m=Math.round((h-d)/60);let f;if(m<2)return n!=null&&n.includeSeconds?h<5?i.formatDistance("lessThanXSeconds",5,l):h<10?i.formatDistance("lessThanXSeconds",10,l):h<20?i.formatDistance("lessThanXSeconds",20,l):h<40?i.formatDistance("halfAMinute",0,l):h<60?i.formatDistance("lessThanXMinutes",1,l):i.formatDistance("xMinutes",1,l):m===0?i.formatDistance("lessThanXMinutes",1,l):i.formatDistance("xMinutes",m,l);if(m<45)return i.formatDistance("xMinutes",m,l);if(m<90)return i.formatDistance("aboutXHours",1,l);if(m<aS){const y=Math.round(m/60);return i.formatDistance("aboutXHours",y,l)}else{if(m<r)return i.formatDistance("xDays",1,l);if(m<Ud){const y=Math.round(m/aS);return i.formatDistance("xDays",y,l)}else if(m<Ud*2)return f=Math.round(m/Ud),i.formatDistance("aboutXMonths",f,l)}if(f=EZ(c,u),f<12){const y=Math.round(m/Ud);return i.formatDistance("xMonths",y,l)}else{const y=f%12,g=Math.trunc(f/12);return y<3?i.formatDistance("aboutXYears",g,l):y<9?i.formatDistance("overXYears",g,l):i.formatDistance("almostXYears",g+1,l)}}function bm(e,t){return cee(e,bZ(e),t)}const dee=e=>{const[t,n]=p.useState({}),a=Array.from(new Set(e.filter(Boolean))).sort(),i=a.join(",");return p.useEffect(()=>{if(a.length===0){n({});return}let r=!1;return(async()=>{const{data:s,error:l}=await te.rpc("get_public_avatars",{_user_ids:a});if(r||l||!s)return;const u={};
658s.forEach(c=>{u[c.user_id]={display_name:c.display_name,avatar_url:c.avatar_url}}),n(u)})(),()=>{r=!0}},[i]),t},hee=({itemId:e})=>{const{t}=Re(),{user:n}=Rt(),{posts:a,loading:i,createPost:r,toggleReaction:s,deletePost:l}=wZ(e),u=dee(a.map(k=>k.author_id)),[c,h]=p.useState(""),[d,m]=p.useState(null),[f,y]=p.useState(!1),g=async()=>{!c.trim()||f||(y(!0),await r(c.trim(),d||void 0),h(""),m(null),y(!1))},x=a.filter(k=>!k.reply_to),w=k=>a.filter(j=>j.reply_to===k),v=({post:k,isReply:j=!1})=>{var S,_;return o.jsxs("div",{className:`${j?"ml-6 border-l-2 border-muted pl-3":""}`,children:[o.jsxs(X,{className:`p-3 space-y-2 ${k.is_legal_guidance?"border-primary/30 bg-primary/5":""}`,children:[o.jsxs("div",{className:"flex items-start justify-between gap-2",children:[o.jsxs("div",{className:"flex items-start gap-2 min-w-0",children:[o.jsx(zs,{name:((S=u[k.author_id])==null?void 0:S.display_name)||k.author_name,url:(_=u[k.author_id])==null?void 0:_.avatar_url,className:"h-7 w-7 shrink-0 mt-0.5",fallbackTextClass:"text-[10px]"}),o.jsx("div",{className:"min-w-0",children:o.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[o.jsx("span",{className:"text-xs font-semibold",children:k.author_name}),k.is_legal_guidance&&o.jsxs("span",{className:"flex items-center gap-0.5 rounded-full bg-primary/10 px-2 py-0.5 text-[9px] font-medium text-primary",children:[o.jsx(Ft,{className:"h-2.5 w-2.5"}),t("Legal","Kisheria")]}),o.jsx("span",{className:"text-[10px] text-muted-foreground",children:bm(new Date(k.created_at),{addSuffix:!0})})]})})]}),(n==null?void 0:n.id)===k.author_id&&o.jsx("button",{onClick:()=>l(k.id),className:"text-muted-foreground hover:text-destructive shrink-0",children:o.jsx(Mc,{className:"h-3 w-3"})})]}),o.jsx("p",{className:"text-xs text-foreground leading-relaxed",children:k.content}),o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsxs("button",{onClick:()=>n&&s(k.id,"thumbsUp"),className:`flex items-center gap-1 text-[10px] ${k.userReaction==="thumbsUp"?"text-primary font-semibold":"text-muted-foreground"}`,children:[o.jsx(zD,{className:"h-3 w-3"})," ",k.reactions.thumbsUp||""]}),o.jsxs("button",{onClick:()=>n&&s(k.id,"heart"),className:`flex items-center gap-1 text-[10px] ${k.userReaction==="heart"?"text-destructive font-semibold":"text-muted-foreground"}`,children:[o.jsx(g2,{className:"h-3 w-3"})," ",k.reactions.heart||""]}),!j&&n&&o.jsxs("button",{onClick:()=>m(d===k.id?null:k.id),className:"flex items-center gap-1 text-[10px] text-muted-foreground hover:text-primary",children:[o.jsx(MD,{className:"h-3 w-3"})," ",t("Reply","Jibu")]})]})]}),d===k.id&&o.jsxs("div",{className:"ml-6 mt-2 flex gap-2",children:[o.jsx(Ia,{value:c,onChange:T=>h(T.target.value),placeholder:t("Write a reply...","Andika jibu..."),className:"text-xs min-h-[60px]"}),o.jsx(Q,{size:"sm",onClick:g,disabled:f||!c.trim(),children:f?o.jsx(Be,{className:"h-3 w-3 animate-spin"}):o.jsx(Vn,{className:"h-3 w-3"})})]}),w(k.id).map(T=>o.jsx(v,{post:T,isReply:!0},T.id))]})};return o.jsxs(X,{className:"p-4 space-y-4",children:[o.jsxs("h2",{className:"font-heading text-sm font-bold flex items-center gap-2",children:[o.jsx(Ns,{className:"h-4 w-4"}),t("Discussion","Mjadala")," (",a.length,")"]}),n?!d&&o.jsxs("div",{className:"space-y-2",children:[o.jsx(Ia,{value:c,onChange:k=>h(k.target.value),placeholder:t("Share your thoughts on this bill...","Shiriki mawazo yako kuhusu mswada huu..."),className:"text-xs min-h-[70px]"}),o.jsxs(Q,{size:"sm",onClick:g,disabled:f||!c.trim(),className:"text-xs",children:[f?o.jsx(Be,{className:"h-3 w-3 animate-spin mr-1"}):o.jsx(Vn,{className:"h-3 w-3 mr-1"}),t("Post","Chapisha")]})]}):o.jsx("p",{className:"text-xs text-muted-foreground text-center py-2",children:t("Sign in to join the discussion","Ingia ili kushiriki mjadala")}),i?o.jsx("div",{className:"flex justify-center py-4",children:o.jsx(Be,{className:"h-5 w-5 animate-spin text-primary"})}):x.length===0?o.jsx("p",{className:"text-xs text-muted-foreground text-center py-4",children:t("No discussions yet. Be the first to comment!","Hakuna mjadala bado. Kuwa wa kwanza kutoa maoni!")}):o.jsx("div",{className:"space-y-3",children:x.map(k=>o.jsx(v,{post:k},k.id))})]})},Xs={vat:16,fuel:12,housing:5,paye:10,health:2.75};function mee(e=[]){const t=e.map(a=>a.toLowerCase()),n=(...a)=>a.some(i=>t.some(r=>r.includes(i)));return n("tax","finance","revenue","vat")?{vat:Xs.vat+2,paye:Xs.paye+2,focus:"vat"}:n("energy","fuel","petrol","transport","roads")?{fuel:Xs.fuel+8,focus:"fuel"}:n("housing","land","rent")?{housing:Xs.housing+5,focus:"housing"}:n("health","sha","nhif","medical")?{health:Xs.health+1.5,focus:"health"}:n("education","labour","labor","employment","wage")?{paye:Xs.paye+1.5,focus:"paye"}:{focus:"vat"}}function fee(e,t=[]){const n=mee(t),a=new URLSearchParams;return n.vat!==void 0&&a.set("vat",String(n.vat)),n.fuel!==void 0&&a.set("fuel",String(n.fuel)),n.housing!==void 0&&a.set("housing",String(n.housing)),n.paye!==void 0&&a.set("paye",String(n.paye)),n.health!==void 0&&a.set("health",String(n.health)),n.focus&&a.set("focus",n.focus),e&&a.set("bill",e.slice(0,120)),`/my-money?${a.toString()}`}const pee=(e,t)=>
658({draft:[{id:"draft-read",level:"inform",title:t("Read the draft summary","Soma muhtasari wa rasimu"),description:t("Quick plain-language summary of the draft.","Muhtasari mfupi wa rasimu kwa lugha rahisi."),eta:"2m",privacy:"public",ctas:[{type:"open_summary",label:t("Read summary","Soma muhtasari")}]},{id:"draft-share",level:"inform",title:t("Share for early awareness","Shiriki kwa ufahamu wa mapema"),description:t("Share a short summary with your community.","Shiriki muhtasari mfupi na jamii yako."),eta:"1m",privacy:"public",ctas:[{type:"share",label:t("Share","Shiriki")}]},{id:"draft-forum",level:"engage",title:t("Discuss the draft","Jadili rasimu"),description:t("Join the forum and share your thoughts.","Jiunge na jukwaa na ushiriki mawazo yako."),eta:"10m",privacy:"pseudonymous",ctas:[{type:"open_forum",label:t("Join discussion","Jiunge na mjadala")}]},{id:"draft-memo",level:"act",title:t("Prepare a memorandum","Andaa memoranda"),description:t("Draft a formal memorandum for public participation.","Andaa memoranda rasmi kwa ushiriki wa umma."),eta:"60m",privacy:"private",ctas:[{type:"request_lawyer_review",label:t("Request review","Omba ukaguzi")}]}],introduced:[{id:"intro-read",level:"inform",title:t("Read the one-pager","Soma muhtasari"),description:t("Quick plain-language summary (2 mins).","Muhtasari mfupi kwa lugha rahisi (dakika 2)."),eta:"2m",privacy:"public",ctas:[{type:"open_summary",label:t("Read summary","Soma muhtasari")}]},{id:"intro-share",level:"inform",title:t("Share a short summary","Shiriki muhtasari mfupi"),description:t("Share via WhatsApp, Twitter or other platforms.","Shiriki kupitia WhatsApp, Twitter au majukwaa mengine."),eta:"1m",privacy:"public",ctas:[{type:"share",label:t("Share","Shiriki")}]},{id:"intro-forum",level:"engage",title:t("Join the bill forum","Jiunge na jukwaa la mswada"),description:t("Ask a focused question (pseudonymous option).","Uliza swali mahususi (chaguo la utambulisho fiche)."),eta:"10m",privacy:"pseudonymous",ctas:[{type:"open_forum",label:t("Join discussion","Jiunge na mjadala")}]},{id:"intro-petition",level:"act",title:t("Start a petition (draft)","Anza ombi (rasimu)"),description:t("Create a petition draft and request lawyer review.","Tengeneza rasimu ya ombi na uombe ukaguzi wa wakili."),eta:"30m",privacy:"private",ctas:[{type:"request_lawyer_review",label:t("Start petition","Anza ombi")}]},{id:"intro-lawyer",level:"act",title:t("Request a lawyer review","Omba ukaguzi wa wakili"),description:t("Submit a private request for legal guidance (optional anonymity).","Tuma ombi la faragha la mwongozo wa kisheria (utambulisho fiche wa hiari)."),eta:"15m",privacy:"private",ctas:[{type:"request_lawyer_review",label:t("Request review","Omba ukaguzi")}]}],committee:[{id:"comm-read",level:"inform",title:t("Follow committee reports","Fuatilia ripoti za kamati"),description:t("Read committee findings and recommendations.","Soma matokeo na mapendekezo ya kamati."),eta:"5m",privacy:"public",ctas:[{type:"open_summary",label:t("Read summary","Soma muhtasari")}]},{id:"comm-submit",level:"engage",title:t("Submit written memoranda","Wasilisha memoranda"),description:t("Submit your views formally to the committee.","Wasilisha maoni yako rasmi kwa kamati."),eta:"30m",privacy:"pseudonymous",ctas:[{type:"open_forum",label:t("Submit views","Wasilisha maoni")}]},{id:"comm-hearing",level:"act",title:t("Attend public hearings","Hudhuria vikao vya umma"),description:t("Prepare and testify at committee hearings.","Jiandae na ushuhudie katika vikao vya kamati."),eta:"120m",privacy:"private",ctas:[{type:"request_lawyer_review",label:t("Get legal help","Pata msaada wa kisheria")}]}],first_reading:[{id:"fr-read",level:"inform",title:t("Read the bill as introduced","Soma mswada uliowasilishwa"),description:t("Understand the bill text presented to parliament.","Elewa maandishi ya mswada uliowasilishwa bungeni."),eta:"5m",privacy:"public",ctas:[{type:"open_summary",label:t("Read summary","Soma muhtasari")}]},{id:"fr-discuss",level:"engage",title:t("Discuss with civic groups","Jadili na vikundi vya kiraia"),description:t("Join the forum to share perspectives.","Jiunge na jukwaa kushiriki mitazamo."),eta:"15m",privacy:"pseudonymous",ctas:[{type:"open_forum",label:t("Join discu
658ssion","Jiunge na mjadala")}]},{id:"fr-write",level:"act",title:t("Write to your representative","Andikia mwakilishi wako"),description:t("Send a formal letter to your MP with your position.","Tuma barua rasmi kwa mbunge wako na msimamo wako."),eta:"30m",privacy:"private",ctas:[{type:"request_lawyer_review",label:t("Get help writing","Pata msaada wa kuandika")}]}],second_reading:[{id:"sr-amend",level:"inform",title:t("Review proposed amendments","Pitia marekebisho yanayopendekezwa"),description:t("Understand what changes are being proposed.","Elewa mabadiliko yanayopendekezwa."),eta:"5m",privacy:"public",ctas:[{type:"open_summary",label:t("Read summary","Soma muhtasari")}]},{id:"sr-coalition",level:"engage",title:t("Join support or opposition","Jiunge na kuunga au kupinga"),description:t("Connect with coalitions and civic groups.","Ungana na muungano na vikundi vya kiraia."),eta:"15m",privacy:"pseudonymous",ctas:[{type:"open_forum",label:t("Join discussion","Jiunge na mjadala")}]},{id:"sr-organize",level:"act",title:t("Organize community discussion","Panga mjadala wa jamii"),description:t("Host or join a community discussion event.","Andaa au jiunge na tukio la mjadala wa jamii."),eta:"60m",privacy:"private",ctas:[{type:"share",label:t("Share event","Shiriki tukio")}]}],third_reading:[{id:"tr-final",level:"inform",title:t("Understand the final version","Elewa toleo la mwisho"),description:t("Review the final version before the vote.","Pitia toleo la mwisho kabla ya kura."),eta:"5m",privacy:"public",ctas:[{type:"open_summary",label:t("Read summary","Soma muhtasari")}]},{id:"tr-appeal",level:"engage",title:t("Make final appeals","Fanya rufaa za mwisho"),description:t("Contact legislators before the final vote.","Wasiliana na wabunge kabla ya kura ya mwisho."),eta:"15m",privacy:"pseudonymous",ctas:[{type:"open_forum",label:t("Discuss","Jadili")}]},{id:"tr-mobilize",level:"act",title:t("Mobilize community","Hamasisha jamii"),description:t("Rally community support or opposition before the vote.","Hamasisha msaada au upinzani wa jamii kabla ya kura."),eta:"30m",privacy:"private",ctas:[{type:"share",label:t("Share & mobilize","Shiriki na hamasisha")}]}],passed:[{id:"pass-read",level:"inform",title:t("Review the passed version","Pitia toleo lililopitishwa"),description:t("Understand the law as passed by parliament.","Elewa sheria iliyopitishwa na bunge."),eta:"5m",privacy:"public",ctas:[{type:"open_summary",label:t("Read summary","Soma muhtasari")}]},{id:"pass-educate",level:"engage",title:t("Share what the new law means","Shiriki sheria mpya inamaanisha nini"),description:t("Help your community understand the new law.","Saidia jamii yako kuelewa sheria mpya."),eta:"10m",privacy:"public",ctas:[{type:"share",label:t("Share","Shiriki")}]},{id:"pass-monitor",level:"act",title:t("Monitor implementation","Fuatilia utekelezaji"),description:t("Track if the government implements the law properly.","Fuatilia kama serikali inatekeleza sheria ipasavyo."),eta:"30m",privacy:"private",ctas:[{type:"open_forum",label:t("Report progress","Ripoti maendeleo")}]}],assent:[{id:"assent-rights",level:"inform",title:t("Know your new rights","Jua haki zako mpya"),description:t("The bill is now law â understand your rights and obligations.","Mswada sasa ni sheria â elewa haki na wajibu wako."),eta:"5m",privacy:"public",ctas:[{type:"open_summary",label:t("Read summary","Soma muhtasari")}]},{id:"assent-educate",level:"engage",title:t("Educate others","Elimisha wengine"),description:t("Help spread awareness about the new law.","Saidia kueneza ufahamu kuhusu sheria mpya."),eta:"10m",privacy:"public",ctas:[{type:"share",label:t("Share","Shiriki")}]},{id:"assent-hold",level:"act",title:t("Hold government accountable","Uwajibishe serikali"),description:t("Monitor and report on implementation progress.","Fuatilia na ripoti maendeleo ya utekelezaji."),eta:"30m",privacy:"private",ctas:[{type:"open_forum",label:t("Report","Ripoti")}]}]})[e]||[],gee=e=>e==="public"?o.jsx(Zm,{className:"h-3 w-3"}):e==="pseudonymous"?o.jsx(Ai,{className:"h-3 w-3"}):o.jsx(jD,{className:"h-3 w-3"}),yee=e=>e==="public"?"bg-green-100 text-green-800":e==="pseudonymous"?"bg-yellow-100 text-yellow-800":"bg-red-100 text-red-800",wee=()=>{const{slug:e}=YB(),{lang:t,t:n}=Re(),[a,i]=p.useState(!1),r=Mn(),{data:s,isLoading:l}=nG(e||""),{data:u}=hZ(s==null?void 0:s.id),{isFollowing:c,followerCount:h,toggleFollow:d,requiresAuth:m}=mZ(s==null?void 0:s.id);if(p.useEffect(()=>{s!=null&&s.id&&(Es(async()=>{const{awardCivicPoints:j}=await Promise.resolve().then(()=>ol);return{awardCivicPoints:j}},void 0).then(({awardCivicPoints:j})=>{j("bill_view",{refType:"item",refId:s.id})}),Es(async()=>{const{supabase:j}=await Promise.resolve().then(()=>B8);return{supabase:j}},void 0).then(({supabase:j})=>{j.rpc("increment_item_click",{_item_id:s.id})}))},[s==null?void 0:s.id]),l)return o.jsx("div",{className:"flex items-center justify-center py-12",children:o.jsx("div",{className:"h-6 w-6 animate-spin rounded-full border-2 border-primary border-t-transparent"})});if(!s)return o.jsx("div",{className:"py-12 text-center text-muted-foreground",children:n("Item not found","Kipengele hakijapatikana")});const f=u?t==="en"?u.onepager_en:u.onepager_sw:null,y=(u==null?void 0:u.excerpt_highlights)||[],g=u?t==="en"?u.youth_impacts_en:u.youth_impacts_sw:[],x=jf.filter(j=>j.verification_status==="verified").slice(0,2),w=rv.filter(j=>s.categories.includes(j.slug)),v=pee(s.stage,n),k=async()=>{const j=t==="en"?s.title_en:s.title_sw,S=window.location.href,_={title:j,text:j,url:S};if(typeof navigator<"u"&&typeof navigator.share=="function")try{if(!navigator.canShare||navigator.canShare(_)){await navigator.share(_);return}}catch(T){if((T==null?void 0:T.name)==="AbortError")return}try{await navigator.clipboard.writeText(`${j} â ${S}`),nn.success(n("Link copied to clipboard","Kiungo kimenakiliwa"))}catch{nn.error(n("Could not copy link","Imeshindwa kunakili kiungo"))}};return o.jsxs("div",{className:"space-y-5",children:[o.jsxs(Le.div,{initial:{opacity:0,y:10}
658,animate:{opacity:1,y:0},children:[o.jsxs("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:[o.jsx(Vc,{stage:s.stage}),o.jsx("span",{className:"text-[10px] font-medium uppercase tracking-wider text-muted-foreground",children:s.type==="bill"?n("Bill","Mswada"):n("Budget","Bajeti")}),w.map(j=>o.jsx("span",{className:"rounded-full bg-muted px-2 py-0.5 text-[10px] font-medium text-muted-foreground",children:t==="en"?j.name_en:j.name_sw},j.id))]}),o.jsx("h1",{className:"font-heading text-lg font-bold leading-tight",children:t==="en"?s.title_en:s.title_sw}),o.jsxs("p",{className:"mt-1 text-xs text-muted-foreground",children:[n("Source:","Chanzo:")," ",s.source_primary_name]}),s.constitution_reference&&o.jsxs("p",{className:"mt-0.5 text-[10px] text-primary font-medium",children:["ð ",s.constitution_reference]}),o.jsx("div",{className:"mt-4 overflow-x-auto",children:o.jsx(sG,{history:s.stage_history,currentStage:s.stage})})]}),o.jsxs("div",{className:"flex gap-2",children:[o.jsxs(Q,{variant:c?"default":"outline",size:"sm",onClick:d,className:"flex-1 text-xs",children:[o.jsx(g2,{className:`h-3.5 w-3.5 ${c?"fill-current":""}`}),c?n("Following","Inafuatiliwa"):n("Follow","Fuatilia"),h>0&&o.jsxs("span",{className:"ml-1 text-[10px]",children:["(",h,")"]})]}),o.jsxs(Q,{variant:"outline",size:"sm",onClick:k,className:"flex-1 text-xs",children:[o.jsx(LD,{className:"h-3.5 w-3.5"}),n("Share","Shiriki")]}),o.jsxs(Q,{variant:"outline",size:"sm",className:"text-xs",onClick:()=>cn(s.type==="bill"?Se.bills_tracker.url:Se.parliament.url),children:[o.jsx(Jn,{className:"h-3.5 w-3.5"}),n("View Official","Rasmi")]})]}),o.jsx(Ue,{to:fee(t==="en"?s.title_en:s.title_sw,s.categories),className:"block",children:o.jsx(X,{className:"p-3 bg-gradient-to-br from-accent/15 to-primary/10 border-accent/30 hover:border-accent/60 hover:shadow-md transition-all",children:o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"h-9 w-9 rounded-xl bg-accent/20 flex items-center justify-center flex-shrink-0",children:o.jsx(Ss,{className:"h-4 w-4 text-accent-foreground"})}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("p",{className:"font-heading font-bold text-xs text-foreground",children:n("See impact on pesa yangu","Tazama athari kwa mfuko wangu")}),o.jsx("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:n("Open the simulator with this bill pre-loaded","Fungua kifaa na mswada huu ukiwa tayari")})]}),o.jsx(Kn,{className:"h-4 w-4 text-muted-foreground flex-shrink-0"})]})})}),f?o.jsx(X,{id:"summary-section",className:"overflow-hidden",children:o.jsxs("details",{className:"group",children:[o.jsxs("summary",{className:"cursor-pointer list-none p-4 flex items-center justify-between gap-3 hover:bg-muted/30 transition-colors",children:[o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[o.jsx("h2",{className:"font-heading text-sm font-bold text-primary truncate",children:n("ð One-Page Briefing","ð Muhtasari wa Ukurasa Mmoja")}),o.jsx("span",{className:"text-[10px] text-muted-foreground flex-shrink-0",children:n("Tap to read","Bonyeza kusoma")})]}),o.jsx(Kn,{className:"h-4 w-4 text-muted-foreground flex-shrink-0 transition-transform group-open:rotate-90"})]}),o.jsxs("div",{className:"px-4 pb-4 space-y-4 border-t border-border/50 pt-4",children:[o.jsxs("div",{children:[o.jsx("h3",{className:"text-xs font-bold text-foreground mb-1",children:n("What it is","Ni nini")}),o.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:f.what_it_is})]}),o.jsxs("div",{children:[o.jsx("h3",{className:"text-xs font-bold text-foreground mb-1",children:n("What changes","Kinachobadilika")}),o.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:f.what_changes})]}),o.jsxs("div",{children:[o.jsx("h3",{className:"text-xs font-bold text-foreground mb-1",children:n("Who is affected","Nani anaathirika")}),o.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:f.who_affected})]}),o.jsxs("div",{children:[o.jsx("h3",{className:"text-xs font-bold text-foreground mb-1",children:n("Youth Impacts","Athari kwa Vijana")}),o.jsx("ul",{className:"space-y-1.5",children:f.youth_impacts.map((j,S)=>o.jsxs("li",{className:"flex items-start gap-2 text-xs text-muted-foreground",children:[o.jsx("span",{className:"mt-1 h-1.5 w-1.5 flex-shrink-0 rounded-full bg-accent"}),j]},S))})]}),o.jsxs("div",{children:[o.jsx("h3",{className:"text-xs font-bold text-foreground mb-1",children:n("What happens next","Kinachofuata")}),o.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:f.what_next})]}),o.jsxs("div",{children:[o.jsx("h3",{className:"text-xs font-bold text-foreground mb-1",children:n("Sources","Vyanzo")}),o.jsx("div",{className:"space-y-1",children:f.sources.map((j,S)=>o.jsxs("button",{type:"button",onClick:()=>cn(j.url),className:"flex items-center gap-1 text-xs text-primary hover:underline text-left",children:[o.jsx(Nn,{className:"h-3 w-3"}),j.name]},S))})]}
658),u&&o.jsxs("p",{className:"text-[10px] text-muted-foreground/60",children:[n("AI confidence:","Uhakika wa AI:")," ",Math.round(u.confidence_score*100),"% · ",u.model_name]})]})]})}):o.jsxs(X,{id:"summary-section",className:"p-4",children:[o.jsx("p",{className:"text-xs text-muted-foreground",children:t==="en"?s.description_en:s.description_sw}),o.jsx("p",{className:"mt-2 text-[10px] text-muted-foreground/60 italic",children:n("AI summary not yet generated.","Muhtasari wa AI bado haujatengenezwa.")})]}),g.length>0&&o.jsxs("div",{children:[o.jsx("h2",{className:"font-heading text-sm font-bold mb-2",children:n("Youth Impact Tags","Alama za Athari kwa Vijana")}),o.jsx("div",{className:"flex flex-wrap gap-2",children:g.map((j,S)=>o.jsx("span",{className:"rounded-lg bg-accent/10 px-3 py-1.5 text-xs font-medium text-accent",children:j},S))})]}),y.length>0&&o.jsxs("div",{children:[o.jsxs("button",{onClick:()=>i(!a),className:"flex w-full items-center justify-between rounded-lg bg-muted px-4 py-3 text-xs font-semibold",children:[n("Excerpt Highlights","Dondoo Muhimu")," (",y.length,")",a?o.jsx(Qx,{className:"h-4 w-4"}):o.jsx(Ec,{className:"h-4 w-4"})]}),a&&o.jsx("div",{className:"mt-2 space-y-2",children:y.map((j,S)=>o.jsx(X,{className:"border-l-2 border-l-primary p-3",children:o.jsx("p",{className:"text-xs italic text-muted-foreground leading-relaxed",children:t==="en"?j.text_en:j.text_sw})},S))})]}),o.jsxs(X,{className:"p-4 space-y-3 border-primary/20 bg-primary/5",children:[o.jsxs("h2",{className:"font-heading text-sm font-bold text-primary flex items-center gap-2",children:[o.jsx(my,{className:"h-4 w-4"}),n("What You Can Do Now","Unachoweza Kufanya Sasa")]}),o.jsx("p",{className:"text-[10px] text-muted-foreground",children:n(`This bill is at the "${s.stage}" stage. Here's how you can get involved:`,`Mswada huu uko katika hatua ya "${s.stage}". Hivi ndivyo unavyoweza kushiriki:`)})]}),o.jsxs(Yc,{defaultValue:"inform",className:"w-full",children:[o.jsxs(Rl,{className:"w-full",children:[o.jsxs(Gn,{value:"inform",className:"flex-1 text-xs gap-1",children:[o.jsx(_D,{className:"h-3 w-3"}),n("Inform","Fahamu")]}),o.jsxs(Gn,{value:"engage",className:"flex-1 text-xs gap-1",children:[o.jsx(Si,{className:"h-3 w-3"}),n("Engage","Shiriki")]}),o.jsxs(Gn,{value:"act",className:"flex-1 text-xs gap-1",children:[o.jsx(my,{className:"h-3 w-3"}),n("Act","Chukua Hatua")]})]}),["inform","engage","act"].map(j=>o.jsx(Ra,{value:j,children:o.jsx("div",{className:"space-y-3",children:v.filter(S=>S.level===j).map(S=>o.jsxs(X,{className:"p-3 space-y-2",children:[o.jsxs("div",{className:"flex items-start justify-between gap-2",children:[o.jsx("h3",{className:"text-xs font-semibold",children:S.title}),o.jsxs("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:[o.jsxs("span",{className:"flex items-center gap-0.5 text-[9px] text-muted-foreground",children:[o.jsx(Ac,{className:"h-2.5 w-2.5"})," ",S.eta]}),o.jsxs("span",{className:`flex items-center gap-0.5 text-[9px] px-1.5 py-0.5 rounded-full ${yee(S.privacy)}`,children:[gee(S.privacy),S.privacy]})]})]}),o.jsx("p",{className:"text-[11px] text-muted-foreground",children:S.description}),o.jsx("div",{className:"flex flex-wrap gap-2 pt-1",children:S.ctas.map(_=>o.jsxs(Q,{size:"sm",variant:j==="act"?"default":"outline",className:"text-[10px] h-7 gap-1",onClick:()=>{var T;if(_.type==="open_summary"){const E=document.getElementById("summary-section"),O=E==null?void 0:E.querySelector("details");O&&!O.open&&(O.open=!0),setTimeout(()=>E==null?void 0:E.scrollIntoView({behavior:"smooth",block:"start"}),50)}else _.type==="share"?k():_.type==="open_forum"?(T=document.getElementById("forum-section"))==null||T.scrollIntoView({behavior:"smooth"}):_.type==="request_lawyer_review"&&r("/ask-lawyer")},children:[o.jsx(Kn,{className:"h-3 w-3"}),_.label]},_.type))})]},S.id))})},j))]}),o.jsxs(X,{className:"p-4 space-y-4",children:[o.jsxs("h2",{className:"font-heading text-sm font-bold flex items-center gap-2",children:["ð ",n("Sources & References","Vyanzo na Marejeleo")]}),s.official_source_links.length>0&&o.jsxs("div",{className:"space-y-1.5",children:[o.jsx("p",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground",children:n("Primary Sources","Vyanzo Vikuu")}),s.official_source_links.map((j,S)=>o.jsxs("button",{type:"button",onClick:()=>cn(j.url),className:"flex items-center gap-2 text-xs text-primary hover:underline text-left",children:[o.jsx(Nn,{className:"h-3 w-3"}),j.name]},S))]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsx("p",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground",children:n("Legal Reference","Marejeleo ya Kisheria")}),o.jsxs("button",{type:"button",onClick:()=>cn(Se.constitution.url),className:"flex items-center gap-2 text-xs text-primary hover:underline text-left",children:[o.jsx(La,{className:"h-3 w-3"}),t==="en"?Se.constitution.name:Se.constitution.name_sw]}),s.constitution_reference&&o.jsxs("p",{className:"text-[10px] text-muted-foreground ml-5",children:["â³ ",s.constitution_reference]})]}),o.jsxs("div",{className:"flex flex-wrap gap-2",children:[o.jsxs(Q,{size:"sm",variant:"outline",className:"text-[10px] h-8",onClick:()=>cn(s.type==="bill"?Se.bills_tracker.url:Se.parliament.url),children:[o.jsx(Jn,{className:"h-3 w-3"}),n("View Official Bill","Tazama Mswada Rasmi")]}),o.jsxs(Q,{size:"sm",variant:"outline",className:"text-[10px] h-8",onClick:()=>cn(Se.kenya_law.url),children:[o.jsx(Ft,{className:"h-3 w-3"}),n("Read Full Law Text","Soma Sheria Kamili")]}),o.jsxs(Q,{size:"sm",variant:"outline",className:"text-[10px] h-8",onClick:()=>cn(Se.constitution.url),children:[o.jsx(La,{className:"h-3 w-3"}),n("Open Constitution","Fungua Katiba")]}),s.document_url&&o.jsxs(Q,{size:"sm",variant:"ghost",className:"text-[10px] h-8 text-muted-foreground",onClick:()=>cn(s.document_url),children:[o.jsx(Nn,{className:"h-3 w-3"}),n("Try direct link","Jaribu kiungo cha moja kwa moja")]})]}),s.document_url&&o.jsx("p",{className:"text-[10px] text-muted-foreground italic",children:n("Note: links open outside the preview so official websites can load correctly.","Kumbuka: viungo hufunguka nje ya hakikisho ili tovuti rasmi zipakie vizuri.")})]}),o.jsx("div",{id:"forum-section",children:o.jsx(hee,{itemId:s.id})}),o.jsxs("div",{children:[o.jsx("h2",{className:"font-heading text-sm font-bold mb-2",children:n("Related Events","Matukio Husika")}),o.jsx("div",{className:"space-y-3",children:x.map(j=>o.jsx(zv,{event:j},j.id))})]})]})},xee=()=>{const{t:e,lang:t}=Re(),{toast:n}=Zn(),[a,i]=p.useState(""),[r,s]=p.useState(!1),[l,u]=p.useState({title:"",description:"",county:"",city:"",location:"",date:"",time:"",organizer:"",contact:""}),c=jf.filter(d=>d.verification_status==="verified").filter(d=>!a||d.county===a).sort((d,m)=>new Date(d.start_time).getTime()-new Date(m.start_time).getTime()),h=d=>{d.preventDefault(),n({title:e("Event submitted!","Tukio limewasilishwa!"),description:e("Your event will be reviewed by our moderators.","Tukio lako litakaguliwa na wasimamizi wetu.")}),s(!1),u({title:"",description:"",county:"",city:"",location:"",date:"",time:"",organizer:"",contact:""})};return o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("h1",{className:"font-heading text-xl font-bold",children:e("Events & Actions","Matukio na Vitendo")}),o.jsxs(Q,{size:"sm",variant:"outline",onClick:()=>s(!r),className:"text-xs",children:[o.jsx(ek,{className:"h-3.5 w-3.5"}),e("Submit","Wasilisha")]})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Pc,{className:"h-4 w-4 text-accent flex-shrink-0"}),o.jsxs("select",{value:a,onChange:d=>i(d.target.value),className:"flex-1 rounded-lg border border-input bg-card px-3 py-2 text-xs text-foreground focus:outline-none focus:ring-2 focus:ring-primary/30",children:[o.jsx("option",{value:"",children:e("All Counties","Kaunti Zote")}),hw.map(d=>o.jsx("option",{value:d,children:d},d))]})]}),r&&o.jsx(Le.div,{initial:{opacity:0,height:0}
658,animate:{opacity:1,height:"auto"},children:o.jsxs(X,{className:"p-4",children:[o.jsx("h2",{className:"font-heading text-sm font-bold mb-3",children:e("Submit an Event","Wasilisha Tukio")}),o.jsxs("form",{onSubmit:h,className:"space-y-3",children:[o.jsx("input",{placeholder:e("Event title","Kichwa cha tukio"),value:l.title,onChange:d=>u({...l,title:d.target.value}),required:!0,className:"w-full rounded-lg border border-input bg-background px-3 py-2 text-xs focus:outline-none focus:ring-2 focus:ring-primary/30"}),o.jsx("textarea",{placeholder:e("Description","Maelezo"),value:l.description,onChange:d=>u({...l,description:d.target.value}),required:!0,rows:3,className:"w-full rounded-lg border border-input bg-background px-3 py-2 text-xs focus:outline-none focus:ring-2 focus:ring-primary/30"}),o.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[o.jsxs("select",{value:l.county,onChange:d=>u({...l,county:d.target.value}),required:!0,className:"rounded-lg border border-input bg-background px-3 py-2 text-xs focus:outline-none focus:ring-2 focus:ring-primary/30",children:[o.jsx("option",{value:"",children:e("County","Kaunti")}),hw.map(d=>o.jsx("option",{value:d,children:d},d))]}),o.jsx("input",{placeholder:e("City","Mji"),value:l.city,onChange:d=>u({...l,city:d.target.value}),required:!0,className:"rounded-lg border border-input bg-background px-3 py-2 text-xs focus:outline-none focus:ring-2 focus:ring-primary/30"})]}),o.jsx("input",{placeholder:e("Location details","Maelezo ya eneo"),value:l.location,onChange:d=>u({...l,location:d.target.value}),required:!0,className:"w-full rounded-lg border border-input bg-background px-3 py-2 text-xs focus:outline-none focus:ring-2 focus:ring-primary/30"}),o.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[o.jsx("input",{type:"date",value:l.date,onChange:d=>u({...l,date:d.target.value}),required:!0,className:"rounded-lg border border-input bg-background px-3 py-2 text-xs focus:outline-none focus:ring-2 focus:ring-primary/30"}),o.jsx("input",{type:"time",value:l.time,onChange:d=>u({...l,time:d.target.value}),required:!0,className:"rounded-lg border border-input bg-background px-3 py-2 text-xs focus:outline-none focus:ring-2 focus:ring-primary/30"})]}),o.jsx("input",{placeholder:e("Organizer name","Jina la mpangaji"),value:l.organizer,onChange:d=>u({...l,organizer:d.target.value}),required:!0,className:"w-full rounded-lg border border-input bg-background px-3 py-2 text-xs focus:outline-none focus:ring-2 focus:ring-primary/30"}),o.jsx("input",{placeholder:e("Contact (optional)","Mawasiliano (si lazima)"),value:l.contact,onChange:d=>u({...l,contact:d.target.value}),className:"w-full rounded-lg border border-input bg-background px-3 py-2 text-xs focus:outline-none focus:ring-2 focus:ring-primary/30"}),o.jsxs(Q,{type:"submit",size:"sm",className:"w-full text-xs",children:[o.jsx(Vn,{className:"h-3.5 w-3.5"}),e("Submit for Review","Wasilisha kwa Ukaguzi")]})]})]})}),o.jsx("div",{className:"space-y-3",children:c.length===0?o.jsx("p",{className:"py-8 text-center text-sm text-muted-foreground",children:e("No events found for this county.","Hakuna matukio yaliyopatikana kwa kaunti hii.")}):c.map(d=>o.jsx(Le.div,{initial:{opacity:0,y:5},animate:{opacity:1,y:0},children:o.jsx(zv,{event:d})},d.id))})]})};var Pf="Collapsible",[kee,sR]=Yt(Pf),[vee,Fv]=kee(Pf),oR=p.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:a,defaultOpen:i,disabled:r,onOpenChange:s,...l}=e,[u,c]=ma({prop:a,defaultProp:i??!1,onChange:s,caller:Pf});return o.jsx(vee,{scope:n,disabled:r,contentId:la(),open:u,onOpenToggle:p.useCallback(()=>c(h=>!h),[c]),children:o.jsx(we.div,{"data-state":Kv(u),"data-disabled":r?"":void 0,...l,ref:t})})});oR.displayName=Pf;var lR="CollapsibleTrigger",uR=p.forwardRef((e,t)=>{const{__scopeCollapsible:n,...a}=e,i=Fv(lR,n);return o.jsx(we.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":Kv(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...a,ref:t,onClick:ue(e.onClick,i.onOpenToggle)})});uR.displayName=lR;var Bv="CollapsibleContent",cR=p.forwardRef((e,t)=>
vendor: 4,124 bytes, line 658
658{const{forceMount:n,...a}=e,i=Fv(Bv,e.__scopeCollapsible);return o.jsx(fa,{present:n||i.open,children:({present:r})=>o.jsx(bee,{...a,ref:t,present:r})})});cR.displayName=Bv;var bee=p.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:a,children:i,...r}=e,s=Fv(Bv,n),[l,u]=p.useState(a),c=p.useRef(null),h=Pe(t,c),d=p.useRef(0),m=d.current,f=p.useRef(0),y=f.current,g=s.open||l,x=p.useRef(g),w=p.useRef(void 0);return p.useEffect(()=>{const v=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(v)},[]),St(()=>{const v=c.current;if(v){w.current=w.current||{transitionDuration:v.style.transitionDuration,animationName:v.style.animationName},v.style.transitionDuration="0s",v.style.animationName="none";const k=v.getBoundingClientRect();d.current=k.height,f.current=k.width,x.current||(v.style.transitionDuration=w.current.transitionDuration,v.style.animationName=w.current.animationName),u(a)}},[s.open,a]),o.jsx(we.div,{"data-state":Kv(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!g,...r,ref:h,style:{"--radix-collapsible-content-height":m?`${m}px`:void 0,"--radix-collapsible-content-width":y?`${y}px`:void 0,...e.style},children:g&&i})});function Kv(e){return e?"open":"closed"}var jee=oR,_ee=uR,See=cR,Fa="Accordion",Nee=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[$v,Cee,Tee]=pl(Fa),[Mf,wie]=Yt(Fa,[Tee,sR]),Uv=sR(),dR=ne.forwardRef((e,t)=>{const{type:n,...a}=e,i=a,r=a;return o.jsx($v.Provider,{scope:e.__scopeAccordion,children:n==="multiple"?o.jsx(Mee,{...r,ref:t}):o.jsx(Pee,{...i,ref:t})})});dR.displayName=Fa;var[hR,Eee]=Mf(Fa),[mR,Aee]=Mf(Fa,{collapsible:!1}),Pee=ne.forwardRef((e,t)=>{const{value:n,defaultValue:a,onValueChange:i=()=>{},collapsible:r=!1,...s}=e,[l,u]=ma({prop:n,defaultProp:a??"",onChange:i,caller:Fa});return o.jsx(hR,{scope:e.__scopeAccordion,value:ne.useMemo(()=>l?[l]:[],[l]),onItemOpen:u,onItemClose:ne.useCallback(()=>r&&u(""),[r,u]),children:o.jsx(mR,{scope:e.__scopeAccordion,collapsible:r,children:o.jsx(fR,{...s,ref:t})})})}),Mee=ne.forwardRef((e,t)=>{const{value:n,defaultValue:a,onValueChange:i=()=>{},...r}=e,[s,l]=ma({prop:n,defaultProp:a??[],onChange:i,caller:Fa}),u=ne.useCallback(h=>l((d=[])=>[...d,h]),[l]),c=ne.useCallback(h=>l((d=[])=>d.filter(m=>m!==h)),[l]);return o.jsx(hR,{scope:e.__scopeAccordion,value:s,onItemOpen:u,onItemClose:c,children:o.jsx(mR,{scope:e.__scopeAccordion,collapsible:!0,children:o.jsx(fR,{...r,ref:t})})})}),[Ree,Rf]=Mf(Fa),fR=ne.forwardRef((e,t)=>{const{__scopeAccordion:n,disabled:a,dir:i,orientation:r="vertical",...s}=e,l=ne.useRef(null),u=Pe(l,t),c=Cee(n),d=Sl(i)==="ltr",m=ue(e.onKeyDown,f=>{var E;if(!Nee.includes(f.key))return;const y=f.target,g=c().filter(O=>{var A;return!((A=O.ref.current)!=null&&A.disabled)}),x=g.findIndex(O=>O.ref.current===y),w=g.length;if(x===-1)return;f.preventDefault();let v=x;const k=0,j=w-1,S=()=>{v=x+1,v>j&&(v=k)},_=()=>{v=x-1,v<k&&(v=j)};switch(f.key){case"Home":v=k;break;case"End":v=j;break;case"ArrowRight":r==="horizontal"&&(d?S():_());break;case"ArrowDown":r==="vertical"&&S();break;case"ArrowLeft":r==="horizontal"&&(d?_():S());break;case"ArrowUp":r==="vertical"&&_();break}const T=v%w;(E=g[T].ref.current)==null||E.focus()});return o.jsx(Ree,{scope:n,disabled:a,direction:i,orientation:r,children:o.jsx($v.Slot,{scope:n,children:o.jsx(we.div,{...s,"data-orientation":r,ref:u,onKeyDown:a?void 0:m})})})}),jm="AccordionItem",[Iee,Vv]=Mf(jm),pR=ne.forwardRef((e,t)=>{const{__scopeAccordion:n,value:a,...i}=e,r=Rf(jm,n),s=Eee(jm,n),l=Uv(n),u=la(),c=a&&s.value.includes(a)||!1,h=r.disabled||e.disabled;return o.jsx(Iee,{scope:n,open:c,disabled:h,triggerId:u,children:o.jsx(jee,{"data-orientation":r.orientation,"data-state":vR(c),...l,...i,ref:t,disabled:h,open:c,onOpenChange:d=>{d?s.onItemOpen(a):s.onItemClose(a)}})})});pR.displayName=jm;var gR="AccordionHeader",yR=ne.forwardRef((e,t)=>{const{__scopeAccordion:n,...a}=e,i=Rf(Fa,n),r=Vv(gR,n);return o.jsx(we.h3,{"data-orientation":i.orientation,"data-state":vR(r.open),"data-disabled":r.disabled?"":void 0,...a,ref:t})});yR.displayName=gR;var Dw="AccordionTrigger",wR=ne.forwardRef((e,t)=>
658{const{__scopeAccordion:n,...a}=e,i=Rf(Fa,n),r=Vv(Dw,n),s=Aee(Dw,n),l=Uv(n);return o.jsx($v.ItemSlot,{scope:n,children:o.jsx(_ee,{"aria-disabled":r.open&&!s.collapsible||void 0,"data-orientation":i.orientation,id:r.triggerId,...l,...a,ref:t})})});wR.displayName=Dw;var xR="AccordionContent",kR=ne.forwardRef((e,t)=>{const{__scopeAccordion:n,...a}=e,i=Rf(Fa,n),r=Vv(xR,n),s=Uv(n);return o.jsx(See,{role:"region","aria-labelledby":r.triggerId,"data-orientation":i.orientation,...s,...a,ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});kR.displayName=xR;function vR(e){return e?"open":"closed"}var Oee=dR,Lee=pR,Dee=yR,bR=wR,jR=kR;const If=Oee,Jc=p.forwardRef(({className:e,...t},n)=>o.jsx(Lee,{ref:n,className:ce("border-b",e),...t}));Jc.displayName="AccordionItem";const Qc=p.forwardRef(({className:e,children:t,...n},a)=>o.jsx(Dee,{className:"flex",children:o.jsxs(bR,{ref:a,className:ce("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",e),...n,children:[t,o.jsx(Ec,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));Qc.displayName=bR.displayName;const Xc=p.forwardRef(({className:e,children:t,...n},a)=>o.jsx(jR,{ref:a,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...n,children:o.jsx("div",{className:ce("pb-4 pt-0",e),children:t})}));Xc.displayName=jR.displayName;const Zl=(e=0)=>({initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:e,duration:.3}}),zee=()=>{const{t:e,lang:t}=Re(),n=Mn(),{toast:a}=Zn(),[i,r]=p.useState(""),[s,l]=p.useState(""),u=aG.filter(h=>{if(!i)return!0;const d=i.toLowerCase();return h.question_en.toLowerCase().includes(d)||h.question_sw.toLowerCase().includes(d)||h.answer_en.toLowerCase().includes(d)||h.answer_sw.toLowerCase().includes(d)}),c=()=>{s.trim()&&(a({title:e("Question submitted!","Swali limewasilishwa!"),description:e("Our team will review and answer your question.","Timu yetu itapitia na kujibu swali lako.")}),l(""))};return o.jsxs("div",{className:"space-y-5",children:[o.jsxs(Le.div,{...Zl(),children:[o.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[o.jsx(Ft,{className:"h-5 w-5 text-primary"}),o.jsx("h1",{className:"font-heading text-xl font-bold",children:e("Legal Q&A","Maswali ya Kisheria")})]}),o.jsx("p",{className:"text-xs text-muted-foreground",children:e("Get verified answers to common legal questions about bills and budgets.","Pata majibu yaliyothibitishwa kwa maswali ya kawaida ya kisheria kuhusu miswada na bajeti.")})]}),o.jsx(Le.div,{...Zl(.05),children:o.jsxs(X,{className:"p-4 space-y-3",children:[o.jsxs("h2",{className:"font-heading text-sm font-bold flex items-center gap-2",children:[o.jsx(Vn,{className:"h-4 w-4 text-primary"}),e("Ask a Question","Uliza Swali")]}),o.jsx("textarea",{rows:2,value:s,onChange:h=>l(h.target.value),placeholder:e("Type your legal question here...","Andika swali lako la kisheria hapa..."),className:"w-full rounded-lg border border-input bg-background px-3 py-2 text-xs placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-primary/30 resize-none"}),o.jsxs(Q,{size:"sm",onClick:c,className:"text-xs",children:[o.jsx(Vn,{className:"h-3.5 w-3.5"}),e("Submit Question","Wasilisha Swali")]})]})}),o.jsxs(Le.div,{...Zl(.1),className:"relative",children:[o.jsx(k2,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),o.jsx("input",{type:"text",placeholder:e("Search questions...","Tafuta maswali..."),value:i,onChange:h=>r(h.target.value),className:"w-full rounded-xl border border-input bg-card py-3 pl-10 pr-4 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-primary/30"})]}),o.jsxs(Le.div,{...Zl(.15),children:[o.jsxs("h2",{className:"font-heading text-sm font-bold mb-3 flex items-center gap-2",children:[o.jsx(oi,{className:"h-4 w-4 text-success"}),e("Verified Answers","Majibu Yaliyothibitishwa")," (",u.length,")"]}),o.jsx(If,{type:"single",collapsible:!0,className:"space-y-2",children:u.map(h=>{const d=as.filter(m=>h.related_bill_ids.includes(m.id));return o.jsxs(Jc,{value:h.id,className:"rounded-xl border border-border bg-card overflow-hidden",children:[o.jsx(Qc,{className:"px-4 text-xs font-heading font-semibold text-foreground text-left hover:no-underline",children:o.jsxs("span",{className:"flex items-start gap-2",children:[o.jsx(Ft,{className:"h-3.5 w-3.5 mt-0.5 text-primary flex-shrink-0"}),t==="en"?h.question_en:h.question_sw]})}),o.jsxs(Xc,{className:"px-4 pb-4 space-y-3",children:[o.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:t==="en"?h.answer_en:h.answer_sw}),d.length>0&&o.jsxs("div",{className:"space-y-1.5",children:[o.jsx("p",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground",children:e("Related Bills","Miswada Husika")}),o.jsx("div",{className:"flex flex-wrap gap-1.5",children:d.map(m=>o.jsxs("button",{onClick:()=>n(`/item/${m.slug}`),className:"inline-flex items-center gap-1 rounded-lg bg-primary/10 px-2 py-1 text-[10px] font-medium text-primary hover:bg-primary/20 transition-colors",children:[o.jsx(Jn,{className:"h-3 w-3"}),t==="en"?m.title_en:m.title_sw]},m.id))})]}),o.jsxs("div",{className:"space-y-1",children:[o.jsx("p",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground",children:e("Legal References","Marejeleo ya Kisheria")}),h.reference_links.map((m,f)=>o.jsxs("button",{type:"button",onClick:()=>cn(m.url),className:"flex items-center gap-1.5 text-[11px] text-primary hover:underline",children:[o.jsx(Nn,{className:"h-3 w-3"}),m.name]},f))]}),h.is_verified&&o.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-success/15 px-2 py-0.5 text-[10px] font-bold text-success",children:[o.jsx(oi,{className:"h-3 w-3"})," ",e("Verified","Imethibitishwa")]})]})]}
658,h.id)})})]}),o.jsxs(Le.div,{...Zl(.2),className:"space-y-3",children:[o.jsxs("h2",{className:"font-heading text-sm font-bold flex items-center gap-2",children:[o.jsx(La,{className:"h-4 w-4 text-primary"}),e("Reference Law","Rejelea Sheria")]}),o.jsxs("div",{className:"grid grid-cols-1 gap-2",children:[o.jsx("button",{type:"button",onClick:()=>cn(Se.constitution.url),className:"text-left",children:o.jsxs(X,{className:"p-3 flex items-center gap-3 hover:bg-muted/50 transition-colors",children:[o.jsx("div",{className:"flex h-9 w-9 items-center justify-center rounded-lg bg-primary/10",children:o.jsx(La,{className:"h-4 w-4 text-primary"})}),o.jsxs("div",{className:"flex-1",children:[o.jsx("p",{className:"text-xs font-bold text-foreground",children:e("Constitution of Kenya","Katiba ya Kenya")}),o.jsx("p",{className:"text-[10px] text-muted-foreground",children:e("Read the full constitution","Soma katiba kamili")})]}),o.jsx(Nn,{className:"h-4 w-4 text-muted-foreground"})]})}),o.jsx("button",{type:"button",onClick:()=>cn(Se.kenya_law.url),className:"text-left",children:o.jsxs(X,{className:"p-3 flex items-center gap-3 hover:bg-muted/50 transition-colors",children:[o.jsx("div",{className:"flex h-9 w-9 items-center justify-center rounded-lg bg-secondary/15",children:o.jsx(Ft,{className:"h-4 w-4 text-secondary"})}),o.jsxs("div",{className:"flex-1",children:[o.jsx("p",{className:"text-xs font-bold text-foreground",children:e("Kenya Law Database","Hifadhidata ya Sheria ya Kenya")}),o.jsx("p",{className:"text-[10px] text-muted-foreground",children:e("Browse all bills and acts","Vinjari miswada na sheria zote")})]}),o.jsx(Nn,{className:"h-4 w-4 text-muted-foreground"})]})}),o.jsx("button",{type:"button",onClick:()=>cn(Se.bills_tracker.url),className:"text-left",children:o.jsxs(X,{className:"p-3 flex items-center gap-3 hover:bg-muted/50 transition-colors",children:[o.jsx("div",{className:"flex h-9 w-9 items-center justify-center rounded-lg bg-info/15",children:o.jsx(Jn,{className:"h-4 w-4 text-info"})}),o.jsxs("div",{className:"flex-1",children:[o.jsx("p",{className:"text-xs font-bold text-foreground",children:e("Parliament Bills Tracker","Kifuatiliaji cha Miswada")}),o.jsx("p",{className:"text-[10px] text-muted-foreground",children:e("Track bill progress officially","Fuatilia maendeleo ya mswada rasmi")})]}),o.jsx(Nn,{className:"h-4 w-4 text-muted-foreground"})]})})]})]})]})},Fee=()=>{const{t:e,lang:t}=Re(),[n,a]=p.useState([]),[i,r]=p.useState([]),[s,l]=p.useState("");p.useEffect(()=>{a(JSON.parse(localStorage.getItem("click-followed")||"[]")),r(JSON.parse(localStorage.getItem("click-categories")||"[]")),l(localStorage.getItem("click-county")||"")},[]);const u=as.filter(f=>n.includes(f.slug)),c=as.filter(f=>i.length>0&&f.categories.some(y=>i.includes(y))),h=jf.filter(f=>f.verification_status==="verified"&&(!s||f.county===s)),d=[...new Map([...u,...c].map(f=>[f.id,f])).values()].sort((f,y)=>new Date(y.last_action_date).getTime()-new Date(f.last_action_date).getTime()),m=n.length>0||i.length>0||s;return o.jsxs("div",{className:"space-y-5",children:[o.jsx("h1",{className:"font-heading text-xl font-bold",children:e("My Feed","Mlisho Wangu")}),m?o.jsxs(o.Fragment,{children:[d.length>0&&o.jsxs("div",{className:"space-y-3",children:[o.jsx("h2",{className:"font-heading text-sm font-bold",children:e("Your Items","Vipengele Vyako")}),d.map(f=>o.jsx(Le.div,{initial:{opacity:0,y:5},animate:{opacity:1,y:0},children:o.jsx(hm,{item:f})},f.id))]}),h.length>0&&o.jsxs("div",{className:"space-y-3",children:[o.jsxs("h2",{className:"font-heading text-sm font-bold",children:[e("Events near you","Matukio karibu nawe")," ",s&&`(${s})`]}),h.slice(0,5).map(f=>o.jsx(Le.div,{initial:{opacity:0,y:5},animate:{opacity:1,y:0},children:o.jsx(zv,{event:f})},f.id))]})]}):o.jsxs("div",{className:"rounded-2xl bg-muted p-6 text-center",children:[o.jsx("p",{className:"text-sm font-medium",children:e("Set up your preferences!","Weka mapendekezo yako!")}),o.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:e("Follow bills, pick categories, and select your county in Settings to get a personalized feed.","Fuatilia miswada, chagua kategoria, na uchague kaunti yako katika Mipangilio kupata mlisho wa kibinafsi.")})]})]})}
658,ft=p.forwardRef(({className:e,type:t,...n},a)=>o.jsx("input",{type:t,className:ce("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:a,...n}));ft.displayName="Input";const Bee=()=>{const{user:e}=Rt(),[t,n]=p.useState(null),[a,i]=p.useState(!0);p.useEffect(()=>{if(!e){i(!1);return}te.from("verification_requests").select("*").eq("user_id",e.id).order("created_at",{ascending:!1}).limit(1).maybeSingle().then(({data:l})=>{n(l),i(!1)})},[e]);const r=async(l,u)=>{if(!e)return null;const c=l.name.split(".").pop(),h=`${e.id}/${u}_${Date.now()}.${c}`,{error:d}=await te.storage.from("verification-docs").upload(h,l,{upsert:!0});return d?(console.error("Upload error:",d),null):h};return{request:t,loading:a,submitRequest:async(l,u)=>{if(!e)return;const c={};if(u){if(u.practicingCert){const m=await r(u.practicingCert,"practicing_certificate");m&&(c.practicing_certificate=m)}if(u.idPhoto){const m=await r(u.idPhoto,"id_photo");m&&(c.id_photo=m)}if(u.firmLetter){const m=await r(u.firmLetter,"firm_letter");m&&(c.firm_letter=m)}}const{data:h,error:d}=await te.from("verification_requests").insert({user_id:e.id,message:l,documents:c}).select().single();return!d&&h&&n(h),{data:h,error:d}}}},Kee=()=>{const[e,t]=p.useState([]),[n,a]=p.useState(!0),i=async()=>{a(!0);const{data:l}=await te.from("verification_requests").select("*").order("created_at",{ascending:!1});if(l){const u=[...new Set(l.map(d=>
658d.user_id))],{data:c}=await te.from("profiles").select("user_id, email, display_name").in("user_id",u.length?u:["_"]),h={};c==null||c.forEach(d=>{h[d.user_id]=d}),t(l.map(d=>{var m;return{...d,email:((m=h[d.user_id])==null?void 0:m.email)||"Unknown"}}))}a(!1)};return p.useEffect(()=>{i()},[]),{requests:e,loading:n,approveRequest:async(l,u)=>{await te.from("verification_requests").update({status:"approved",handled_at:new Date().toISOString()}).eq("id",l),await te.from("user_roles").insert({user_id:u,role:"legal"}),i()},rejectRequest:async l=>{await te.from("verification_requests").update({status:"rejected",handled_at:new Date().toISOString()}).eq("id",l),i()},refresh:i}},$ee=()=>{const{t:e,lang:t}=Re(),{toast:n}=Zn(),{user:a,signOut:i}=Rt(),r=Mn(),{request:s,loading:l,submitRequest:u}=Bee(),{url:c,displayName:h,uploading:d,upload:m,remove:f}=wf(),y=p.useRef(null),[g,x]=p.useState(""),[w,v]=p.useState(!1),[k,j]=p.useState(null),[S,_]=p.useState(null),[T,E]=p.useState(null),O=p.useRef(null),A=p.useRef(null),R=p.useRef(null),[F,Y]=p.useState(()=>localStorage.getItem("click-county")||""),[V,z]=p.useState(()=>JSON.parse(localStorage.getItem("click-categories")||"[]")),[W,B]=p.useState(!1),[M,I]=p.useState(""),[b,C]=p.useState(!1),[D,N]=p.useState(!1);p.useEffect(()=>{a&&(C(!0),te.from("profiles").select("display_name").eq("user_id",a.id).maybeSingle().then(({data:q})=>{I((q==null?void 0:q.display_name)||""),C(!1)}))},[a]);const J=async()=>{if(!a)return;const q=M.trim();if(q.length<2||q.length>50){n({title:e("Invalid name","Jina batili"),description:e("Name must be 2â50 characters.","Jina lazima liwe herufi 2â50."),variant:"destructive"});return}N(!0);const{error:ae}=await te.from("profiles").update({display_name:q}).eq("user_id",a.id);N(!1),n(ae?{title:e("Error","Hitilafu"),description:ae.message,variant:"destructive"}:{title:e("Display name saved!","Jina la kuonyesha limehifadhiwa!"),description:e("This is how you appear on the leaderboard.","Hivi ndivyo unavyoonekana kwenye orodha ya viongozi.")})},re=q=>{z(ae=>ae.includes(q)?ae.filter(de=>de!==q):[...ae,q])},ee=()=>{localStorage.setItem("click-county",F),localStorage.setItem("click-categories",JSON.stringify(V)),n({title:e("Settings saved!","Mipangilio imehifadhiwa!"),description:e("Your preferences have been updated.","Mapendekezo yako yameboreshwa.")})},G=async()=>{if("Notification"in window){const q=await Notification.requestPermission();B(q==="granted"),q==="granted"&&n({title:e("Notifications enabled!","Arifa zimewashwa!")})}},ie=async()=>{await i(),r("/welcome")};return o.jsxs("div",{className:"space-y-5",children:[o.jsx("h1",{className:"font-heading text-xl font-bold",children:e("Settings","Mipangilio")}),a&&o.jsxs(X,{className:"p-4 space-y-3",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(uD,{className:"h-4 w-4 text-primary"}),o.jsx("h2",{className:"font-heading text-sm font-bold",children:e("Profile Picture","Picha ya Wasifu")}),o.jsxs("span",{className:"text-[10px] text-muted-foreground",children:["(",e("optional","si lazima"),")"]})]}),o.jsx("p",{className:"text-xs text-muted-foreground",children:e("Add a photo or avatar that shows up on the leaderboard, in your civic score widget, and when you chat with Haki.","Ongeza picha au avatar inayoonekana kwenye ubao wa viongozi, kwenye alama yako ya uraia, na unapozungumza na Haki.")}),o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx(zs,{name:h||M||"Citizen",url:c,className:"h-16 w-16 shrink-0 ring-2 ring-primary/20",fallbackTextClass:"text-lg"}),o.jsxs("div",{className:"flex flex-col gap-1.5 flex-1 min-w-0",children:[o.jsx("input",{ref:y,type:"file",accept:"image/*",className:"hidden",onChange:async q=>{var Ce;const ae=(Ce=q.target.files)==null?void 0:Ce[0];if(!ae)return;const{url:de,error:me}=await m(ae);me?n({title:e("Upload failed","Upakiaji umeshindwa"),description:me,variant:"destructive"}):de&&n({title:e("Profile picture updated!","Picha ya wasifu imesasishwa!"),description:e("Your new avatar is now visible across CLICK.","Avatar yako mpya inaonekana kote CLICK.")}),y.current&&(y.current.value="")}}),o.jsxs(Q,{size:"sm",variant:"outline",className:"text-xs justify-start",disabled:d,onClick:()=>{var q;return(q=y.current)==null?void 0:q.click()},children:[d?o.jsx(Be,{className:"h-3.5 w-3.5 animate-spin"}):o.jsx(bu,{className:"h-3.5 w-3.5"}),c?e("Change picture","Badilisha picha"):e("Upload picture","Pakia picha")]}),c&&o.jsxs(Q,{size:"sm",variant:"ghost",className:"text-xs justify-start text-destructive hover:text-destructive",disabled:d,onClick:async()=>{const{error:q}=await f();n(q?{title:e("Error","Hitilafu"),description:q,variant:"destructive"}:{title:e("Profile picture removed","Picha ya wasifu imeondolewa")})},children:[o.jsx(Mc,{className:"h-3.5 w-3.5"}),e("Remove","Ondoa")]})]})]}),o.jsx("p",{className:"text-[10px] text-muted-foreground",children:e("JPG, PNG or WEBP â max 5 MB.","JPG, PNG au WEBP â kiwango cha juu MB 5.")})]}),a&&o.jsxs(X,{className:"p-4 space-y-3",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(ef,{className:"h-4 w-4 text-primary"}),o.jsx("h2",{className:"font-heading text-sm font-bold",children:e("Display Name","Jina la Kuonyesha")})]}),o.jsx("p",{className:"text-xs text-muted-foreground",children:e('This is the name shown on the leaderboard. Leave blank to appear as "Anonymous Citizen".','Hili ni jina linaloonyeshwa kwenye orodha ya viongozi. Acha tupu ili uonekane kama "Raia Asiyejulikana".')}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx(ft,{value:M,onChange:q=>I(q.target.value),placeholder:e("e.g. Asha M.","mfano Asha M."),maxLength:50,disabled:b,className:"text-xs h-9"}),o.jsxs(Q,{size:"sm",onClick:J,disabled:D||b,className:"text-xs",children:[D?o.jsx(Be,{className:"h-3.5 w-3.5 animate-spin"}):o.jsx(gy,{className:"h-3.5 w-3.5"}),e("Save","Hifadhi")]})]})]}),o.jsxs(X,{className:"p-4 space-y-3",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Pc,{className:"h-4 w-4 text-accent"}),o.jsx("h2",{className:"font-heading text-sm font-bold",children:e("Your County","Kaunti Yako")})]}),o.jsxs("select",{value:F,onChange:q=>Y(q.target.value),className:"w-full rounded-lg border border-input bg-background px-3 py-2 text-xs focus:outline-none focus:ring-2 focus:ring-primary/30",children:[o.jsx("option",{value:"",children:e("Select county...","Chagua kaunti...")}),hw.map(q=>o.jsx("option",{value:q,children:q},q))]})]}),o.jsxs(X,{className:"p-4 space-y-3",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(DD,{className:"h-4 w-4 text-secondary"}),o.jsx("h2",{className:"font-heading text-sm font-bold",children:e("Follow Categories","Fuatilia Kategoria")})]}),o.jsx("div",{className:"flex flex-wrap gap-2",children:rv.map(q=>o.jsx("button",{onClick:()=>re(q.slug),className:`chip ${V.includes(q.slug)?"chip-active":""}`,children:t==="en"?q.name_en:q.name_sw},q.id))})]}),o.jsxs(X,{className:"p-4 space-y-3",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(j0,{className:"h-4 w-4 text-primary"}),o.jsx("h2",{className:"font-heading text-sm font-bold",children:e("Notifications","Arifa")})]}),o.jsx("p",{className:"text-xs text-muted-foreground",children:e("Get notified about new bills, stage changes, and events in your county.","Pata arifa kuhusu miswada mipya, mabadiliko ya hatua, na matukio katika kaunti yako.")}),o.jsxs(Q,{size:"sm",variant:"outline",onClick:G,className:"text-xs",children:[o.jsx(j0,{className:"h-3.5 w-3.5"}),W?e("Notifications enabled","Arifa zimewashwa"):e("Enable notifications","Wezesha arifa")]})]}),a&&o.jsxs(X,{className:"p-4 space-y-3",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Ft,{className:"h-4 w-4 text-primary"}),o.jsx("h2",{className:"font-heading text-sm font-bold",children:e("Legal Professional Verification","Uthibitishaji wa Mtaalamu wa Sheria")})]}),l?o.jsx(Be,{className:"h-4 w-4 animate-spin text-primary"}):s?o.jsxs("div",{className:"flex items-center gap-2",children:[s.status==="pending"&&o.jsx(Ac,{className:"h-4 w-4 text-warning"}),s.status==="approved"&&o.jsx(oi,{className:"h-4 w-4 text-success"}),s.status==="rejected"&&o.jsx(Qu,{className:"h-4 w-4 text-destructive"}),o.jsx("span",{className:"text-xs font-medium capitalize",children:s.status}),s.status==="approved"&&o.jsx(Ue,{to:"/lawyer",className:"text-xs text-primary underline ml-2",children:e("Go to Dashboard","Nenda Dashibodi")})]}):o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"text-xs text-muted-foreground",children:e("Request to be verified as a legal professional to provide guidance on bills.","Omba kuthibitishwa kama mtaalamu wa sheria ili kutoa mwongozo kuhu
658su miswada.")}),o.jsxs("div",{className:"space-y-2",children:[o.jsxs("div",{children:[o.jsxs("label",{className:"text-xs font-medium block mb-1",children:[e("Practicing Certificate","Cheti cha Kufanya Kazi")," ",o.jsx("span",{className:"text-destructive",children:"*"})]}),o.jsx("input",{ref:O,type:"file",accept:".pdf,.jpg,.jpeg,.png",className:"hidden",onChange:q=>{var ae;return j(((ae=q.target.files)==null?void 0:ae[0])||null)}}),o.jsxs(Q,{variant:"outline",size:"sm",className:"text-xs w-full justify-start",onClick:()=>{var q;return(q=O.current)==null?void 0:q.click()},children:[o.jsx(bu,{className:"h-3 w-3 mr-1.5"}),k?k.name:e("Upload practicing certificate (PDF/Image)","Pakia cheti cha kufanya kazi (PDF/Picha)")]})]}),o.jsxs("div",{children:[o.jsxs("label",{className:"text-xs font-medium block mb-1",children:[e("ID Document","Kitambulisho")," ",o.jsx("span",{className:"text-destructive",children:"*"})]}),o.jsx("input",{ref:A,type:"file",accept:".pdf,.jpg,.jpeg,.png",className:"hidden",onChange:q=>{var ae;return _(((ae=q.target.files)==null?void 0:ae[0])||null)}}),o.jsxs(Q,{variant:"outline",size:"sm",className:"text-xs w-full justify-start",onClick:()=>{var q;return(q=A.current)==null?void 0:q.click()},children:[o.jsx(bu,{className:"h-3 w-3 mr-1.5"}),S?S.name:e("Upload ID (Passport/National ID)","Pakia kitambulisho (Paspoti/Kitambulisho cha Taifa)")]})]}),o.jsxs("div",{children:[o.jsx("label",{className:"text-xs font-medium block mb-1",children:e("Firm Letter (optional)","Barua ya Kampuni (si lazima)")}),o.jsx("input",{ref:R,type:"file",accept:".pdf,.jpg,.jpeg,.png",className:"hidden",onChange:q=>{var ae;return E(((ae=q.target.files)==null?void 0:ae[0])||null)}}),o.jsxs(Q,{variant:"outline",size:"sm",className:"text-xs w-full justify-start",onClick:()=>{var q;return(q=R.current)==null?void 0:q.click()},children:[o.jsx(Jn,{className:"h-3 w-3 mr-1.5"}),T?T.name:e("Upload firm/good standing letter (optional)","Pakia barua ya kampuni (si lazima)")]})]})]}),o.jsx(Ia,{value:g,onChange:q=>x(q.target.value),placeholder:e("Describe your legal qualifications...","Eleza sifa zako za kisheria..."),className:"text-xs min-h-[60px]"}),o.jsxs(Q,{size:"sm",className:"text-xs",disabled:w||!g.trim()||!k||!S,onClick:async()=>{v(!0);const{error:q}=await u(g.trim(),{practicingCert:k||void 0,idPhoto:S||void 0,firmLetter:T||void 0})||{};q?n({title:e("Error","Hitilafu"),description:q.message,variant:"destructive"}):(n({title:e("Verification request submitted!","Ombi la uthibitishaji limewasilishwa!")}),j(null),_(null),E(null),x("")),v(!1)},children:[w&&o.jsx(Be,{className:"h-3 w-3 animate-spin mr-1"}),e("Submit Request","Wasilisha Ombi")]})]})]}),o.jsxs(Q,{onClick:ee,className:"w-full text-xs",children:[o.jsx(gy,{className:"h-3.5 w-3.5"}),e("Save Preferences","Hifadhi Mapendekezo")]}),a&&o.jsxs(Q,{variant:"outline",onClick:ie,className:"w-full text-xs text-destructive hover:text-destructive",children:[o.jsx(fy,{className:"h-3.5 w-3.5"}),e("Sign Out","Ondoka")]}),o.jsxs("div",{className:"space-y-2 pt-2",children:[o.jsx(Ue,{to:"/help",children:o.jsxs(X,{className:"p-4 flex items-center gap-3 hover:bg-muted/50 transition-colors cursor-pointer",children:[o.jsx(m2,{className:"h-4 w-4 text-primary"}),o.jsxs("div",{children:[o.jsx("h3",{className:"font-heading text-xs font-bold",children:e("Help & Support","Msaada na Usaidizi")}),o.jsx("p",{className:"text-[10px] text-muted-foreground",children:e("Guides, contact, and report issues","Miongozo, mawasiliano, na ripoti matatizo")})]})]})}),o.jsx(Ue,{to:"/about",children:o.jsxs(X,{className:"p-4 flex items-center gap-3 hover:bg-muted/50 transition-colors cursor-pointer",children:[o.jsx(Zx,{className:"h-4 w-4 text-accent"}),o.jsxs("div",{children:[o.jsx("h3",{className:"font-heading text-xs font-bold",children:e("About CLICK","Kuhusu CLICK")}),o.jsx("p",{className:"text-[10px] text-muted-foreground",children:e("The story behind the platform","Hadithi nyuma ya jukwaa")})]})]})}),o.jsx(Ue,{to:"/privacy-policy",children:o.jsxs(X,{className:"p-4 flex items-center gap-3 hover:bg-muted/50 transition-colors cursor-pointer",children:[o.jsx(Ai,{className:"h-4 w-4 text-primary"}),o.jsxs("div",{children:[o.jsx("h3",{className:"font-heading text-xs font-bold",children:e("Privacy Policy","Sera ya Faragha")}),o.jsx("p",{className:"text-[10px] text-muted-foreground",children:e("How we collect, use, and protect your data","Jinsi tunavyokusanya, kutumia, na kulinda data yako")})]})]})}),o.jsx(Ue,{to:"/terms-of-service",children:o.jsxs(X,{className:"p-4 flex items-center gap-3 hover:bg-muted/50 transition-colors cursor-pointer",children:[o.jsx(p2,{className:"h-4 w-4 text-accent"}),o.jsxs("div",{children:[o.jsx("h3",{className:"font-heading text-xs font-bold",children:e("Terms of Service","Masharti ya Huduma")}),o.jsx("p",{className:"text-[10px] text-muted-foreground",children:e("Rules for using CLICK","Sheria za kutumia CLICK")})]})]})})]})]})},Uee=()=>{const{t:e}=Re();return o.jsxs("div",{className:"space-y-5 pb-8",children:[o.jsxs(Ue,{to:"/settings",className:"inline-flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[o.jsx(tl,{className:"h-3.5 w-3.5"}),e("Back to Settings","Rudi kwa Mipangilio")]}),o.jsx(X,{className:"overflow-hidden border-primary/30 bg-gradient-to-br from-primary/15 via-background to-accent/10",children:o.jsxs("div",{className:"p-6 space-y-3",children:[o.jsxs("div",{className:"inline-flex items-center gap-1.5 rounded-full bg-primary/15 px-3 py-1",children:[o.jsx(Hn,{className:"h-3 w-3 text-primary"}),o.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wide text-primary",children:e("About CLICK","Kuhusu CLICK")})]}),o.jsxs("h1",{className:"font-heading text-2xl font-black leading-tight",children:[e("Before they decide,","Kabla hawajaamua,"),o.jsx("br",{}),o.jsx("span",{className:"text-primary",children:"CLICK."})]}),o.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed italic",children:e("Read it. Feel it. Move it.","Soma. Hisi. Sukuma.")})]})}),o.jsxs(X,{className:"p-6 space-y-4 bg-card/60 backdrop-blur",children:[o.jsxs("article",{className:"prose prose-sm max-w-none space-y-4 text-[13px] leading-[1.75] text-foreground
658/90 first-letter:font-heading first-letter:text-5xl first-letter:font-black first-letter:text-primary first-letter:float-left first-letter:mr-2 first-letter:mt-1 first-letter:leading-none",children:[o.jsx("p",{children:e("On June 25, 2024, Kenyan Gen Z poured into the streets to protest the Finance Bill. They were not uninformed â they were, in fact, the most informed generation Kenya had ever seen. They broke the bill down clause by clause on TikTok, translated it into Swahili and Sheng on Twitter, and mobilised entire counties through WhatsApp. Awareness was at an all-time high. And yet, the moment still escalated into something painful, costly, and avoidable.","Tarehe 25 Juni 2024, vijana wa Kenya (Gen Z) walimiminika mitaani kupinga Mswada wa Fedha. Hawakuwa wajinga â walikuwa kizazi chenye taarifa zaidi ambacho Kenya iliwahi kuona. Waliuchambua mswada kifungu kwa kifungu kwenye TikTok, wakautafsiri kwa Kiswahili na Sheng kwenye Twitter, na wakahamasisha kaunti nzima kupitia WhatsApp. Uelewa ulikuwa juu sana. Na bado, wakati huo uliibuka na kuwa kitu chenye uchungu, gharama kubwa, na ambacho kingeweza kuepukika.")}),o.jsx("p",{children:e("That contradiction became the question that would not let go: if awareness was so high, why did it still end this way? The answer, slowly, became clear. Awareness alone was never going to be enough. Action was not structured â people knew what was happening, but not when to step in. There was no direct channel between citizens and decision-makers. Information was scattered, some accurate and some exaggerated, none of it centralised. And once the protests ended, the energy faded with them. There was no continuity, no muscle memory, no system.","Ukinzani huo ukawa swali ambalo halikuachi: ikiwa uelewa ulikuwa juu, kwa nini bado uliisha hivi? Jibu, polepole, likawa wazi. Uelewa pekee usingetosha kamwe. Hatua hazikuwa zimepangwa â watu walijua kinachoendelea, lakini si wakati wa kuingilia. Hapakuwa na njia ya moja kwa moja kati ya raia na watoa-maamuzi. Taarifa zilitawanyika, baadhi sahihi na baadhi za chumvi, hakuna iliyokusanywa. Na mara maandamano yalipoisha, nguvu ilififia nayo. Hakukuwa na mwendelezo, hakuna kumbukumbu ya pamoja, hakuna mfumo.")}),o.jsx("p",{children:e("CLICK was built to close that gap. It is not a protest app and it is not a news feed. It is the quiet infrastructure that turns raw civic energy into structured, informed, continuous action â so citizens can discover bills early, understand them in their own language, simulate exactly how a policy will hit their wallet, match candidates to the issues they actually care about, and act at the stage where it still matters. Not after the headlines. Before the decision.","CLICK ilijengwa kuziba pengo hilo. Si app ya maandamano wala si jarida la habari. Ni miundombinu ya kimya inayobadilisha nguvu ya kiraia kuwa hatua iliyopangwa, yenye taarifa, na inayoendelea â ili raia waweze kugundua miswada mapema, kuielewa kwa lugha yao, kuiga jinsi sera itakavyowagusa mfukoni, kulinganisha wagombea na masuala wanayojali kweli, na kuchukua hatua wakati bado inahesabika. Si baada ya vichwa vya habari. Kabla ya uamuzi.")}),o.jsx("p",{children:e("CLICK was developed in 2026 by Clare Njoroge, a Kenyan from Kiambu County, while studying at Smith College. It carries with it the memory of June 2024 and the conviction that the next time something this important moves through Parliament, the people it affects will not just be watching â they will be ready.","CLICK ilianzishwa mwaka 2026 na Clare Njoroge, Mkenya kutoka Kaunti ya Kiambu, alipokuwa akisoma katika Chuo cha Smith. Inabeba kumbukumbu ya Juni 2024 na imani kwamba wakati ujao kitu muhimu kama hicho kitakapopita Bungeni, watu kinachowahusu hawatakuwa tu wanaangalia â watakuwa tayari.")})]}),o.jsxs("div",{className:"flex gap-2 pt-3 border-t border-border/50",children:[o.jsx(PD,{className:"h-4 w-4 text-accent flex-shrink-0 mt-0.5"}),o.jsx("p",{className:"text-[12px] italic text-foreground/80 leading-relaxed",children:e("Read it. Feel it. Move it.","Soma. Hisi. Sukuma.")})]}),o.jsxs("div",{className:"pt-2 text-[11px] text-muted-foreground",children:[o.jsx("span",{className:"font-heading font-bold text-foreground",children:"Clare Njoroge"}),o.jsxs("span",{children:[" · ",e("Kiambu County, Kenya","Kaunti ya Kiambu, Kenya")," · ",e("Built in 2026 · Smith College","Imejengwa 2026 · Smith College")]})]})]}),o.jsx(Ue,{to:"/privacy-policy",children:o.jsxs(X,{className:"p-4 flex items-center gap-3 hover:bg-muted/50 transition-colors cursor-pointer",children:[o.jsx(Ai,{className:"h-4 w-4 text-primary"}),o.jsxs("div",{children:[o.jsx("h3",{className:"font-heading text-xs font-bold",children:e("Privacy Policy","Sera ya Faragha")}),o.jsx("p",{className:"text-[10px] text-muted-foreground",children:e("How we collect, use, and protect your data","Jinsi tunavyokusanya, kutumia, na kulinda data yako")})]})]})}),o.jsx(Ue,{to:"/terms-of-service",children:o.jsxs(X,{className:"p-4 flex items-center gap-3 hover:bg-muted/50 transition-colors cursor-pointer",children:[o.jsx(p2,{className:"h-4 w-4 text-accent"}),o.jsxs("div",{children:[o.jsx("h3",{className:"font-heading text-xs font-bold",children:e("Terms of Service","Masharti ya Huduma")}),o.jsx("p",{className:"text-[10px] text-muted-foreground",children:e("Rules for using CLICK","Sheria za kutumia CLICK")})]})]})}),o.jsx(Ue,{to:"/welcome",children:o.jsx(Q,{variant:"outline",size:"sm",className:"w-full text-xs",children:e("View intro & onboarding guide","Tazama utangulizi na mwongozo")})})]})};var Vee="authorization_response",Hee="/~oauth/initiate",Wee=["https://oauth.lovable.app","https://lovable.dev"],qee="lovable://oauth-callback",Gee="http://127.0.0.1/iframe-oauth/callback",Yee=500,Jee=12e4;function Qee(e){let t;const n=new Promise(r=>{t=r}),a=r=>{if(!e.some(u=>r.origin===u))return;const l=r.data;!l||typeof l!="object"||l.type===Vee&&t(l.response)},i=()=>{window.removeEventListener("message",a)};return window.addEventListener("message",a),{cleanup:i,messagePromise:n}}function Xee(e){const t=window.screenX!==0||window.screenY!==0||!e,n=t?window.outerWidth*.5:window.screen.width*.5,a=t?window.outerHeight*.5:window.screen.height*.5,i=t?window.screenX+(window.outerWidth-n)/2:(window.screen.width-n)/2,r=t?window.screenY+(window.outerHeight-a)/2:(window.screen.height-a)/2;return{width:n,height:a,left:i,top:r}}function rS(e,t){return e.state!==t?{error:new Error("State is invali
658d")}:e.error?e.error==="legacy_flow"?{error:new Error("This flow is not supported in Preview mode. Please open the app in a new tab to sign in.")}:{error:new Error(e.error_description??"Sign in failed")}:!e.access_token||!e.refresh_token?{error:new Error("No tokens received")}:{tokens:{access_token:e.access_token,refresh_token:e.refresh_token},error:null}}function Zee(){const e=navigator.userAgent;return!!(/iPhone|iPad|iPod|Android/i.test(e)||/Macintosh/i.test(e)&&navigator.maxTouchPoints>1)}function ete(){return typeof crypto<"u"&&crypto.getRandomValues?[...crypto.getRandomValues(new Uint8Array(16))].map(e=>e.toString(16).padStart(2,"0")).join(""):Math.random().toString(36).substring(2)+Date.now().toString(36)}function tte(e={}){const t=e.oauthBrokerUrl??Hee,n=e.supportedOAuthOrigins??Wee;async function a(i,r={}){let s=!1;try{s=window.self!==window.top}catch{s=!0}const l=navigator.userAgent,u=/LovableApp\//.test(l),c=!u&&/lovable/i.test(l),h=ete();let d=r.redirect_uri??window.location.origin;u&&s?d=qee:c&&s&&(d=Gee);const m=new URLSearchParams({...r.extraParams,provider:i,redirect_uri:d,state:h});if(!s)return window.location.href=`${t}?${m.toString()}`,{error:null,redirected:!0};!u&&!c&&m.set("response_mode","web_message");const f=`${t}?${m.toString()}`,y=c?[...n,window.location.origin]:n,{messagePromise:g,cleanup:x}=Qee(y);let w;if(Zee())w=window.open(f,"_blank");else{const{width:j,height:S,left:_,top:T}=Xee(s);w=window.open(f,"oauth",`width=${j},height=${S},left=${_},top=${T}`)}if(!w&&(u||c)){let j;const S=new Promise((_,T)=>{j=setTimeout(()=>{T(new Error("OAuth timed out waiting for response"))},Jee)});try{const _=await Promise.race([g,S]);return rS(_,h)}catch(_){return{error:_ instanceof Error?_:new Error(String(_))}}finally{j&&clearTimeout(j),x()}}if(!w)return x(),{error:new Error("Popup was blocked")};let v;const k=new Promise((j,S)=>{v=setInterval(()=>{w.closed&&(clearInterval(v),S(new Error("Sign in was cancelled")))},Yee)});try{const j=await Promise.race([g,k]);return rS(j,h)}catch(j){return{error:j instanceof Error?j:new Error(String(j))}}finally{clearInterval(v),x(),w==null||w.close()}}return{signInWithOAuth:a}}var nte={name:"@lovable.dev/cloud-auth-js",version:"1.1.1",description:"Lovable Cloud Auth JS",main:"./dist/index.cjs",module:"./dist/index.js",types:"./dist/index.d.ts",type:"module",files:["dist"],scripts:{build:"tsup src/index.ts --format cjs,esm --dts --outDir dist",dev:"tsup src/index.ts --format cjs,esm --dts --watch",test:"vitest run",typecheck:"tsgo --noEmit",prepublishOnly:"npm run clean && npm run build",clean:"rimraf dist"},keywords:["lovable","oauth","authentication"],license:"MIT",devDependencies:{"@types/node":"^22",jsdom:"^26",rimraf:"^5.0.0",tsup:"^7.2.0",typescript:"^5",vitest:"^4.1.0"}};typeof window<"u"&&(window.__lovable_cloud_auth_js_version=nte.version);function ate(e={}){return tte(e)}const ite=ate(),_R={auth:{signInWithOAuth:async(e,t)=>{const n=await ite.signInWithOAuth(e,{redirect_uri:t==null?void 0:t.redirect_uri,extraParams:{...t==null?void 0:t.extraParams}});if(n.redirected||n.error)return n;try{await te.auth.setSession(n.tokens)}catch(a){return{error:a instanceof Error?a:new Error(String(a))}}return n}}};var rte="Label",SR=p.forwardRef((e,t)=>o.jsx(we.label,{...e,ref:t,onMouseDown:n=>{var i;n.target.closest("button, input, select, textarea")||((i=e.onMouseDown)==null||i.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));SR.displayName=rte;var NR=SR;const ste=Qm("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),At=p.forwardRef(({className:e,...t},n)=>o.jsx(NR,{ref:n,className:ce(ste(),e),...t}));At.displayName=NR.displayName;function Hv(e){const t=p.useRef({value:e,previous:e});return p.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Of="Switch",[ote,xie]=Yt(Of),[lte,ute]=ote(Of),CR=p.forwardRef((e,t)=>{const{__scopeSwitch:n,name:a,checked:i,defaultChecked:r,required:s,disabled:l,value:u="on",onCheckedChange:c,form:h,...d}=e,[m,f]=p.useState(null),y=Pe(t,k=>f(k)),g=p.useRef(!1),x=m?h||!!m.closest("form"):!0,[w,v]=ma({prop:i,defaultProp:r??!1,onChange:c,caller:Of});return o.jsxs(lte,{scope:n,checked:w,disabled:l,children:[o.jsx(we.button,{type:"button",role:"switch","aria-checked":w,"aria-required":s,"data-state":PR(w),"data-disabled":l?"":void 0,disabled:l,value:u,...d,ref:y,onClick:ue(e.onClick,k=>{v(j=>!j),x&&(g.current=k.isPropagationStopped(),g.current||k.stopPropagation())})}),x&&o.jsx(AR,{control:m,bubbles:!g.current,name:a,value:u,checked:w,required:s,disabled:l,form:h,style:{transform:"translateX(-100%)"}})]})});CR.displayName=Of;var TR="SwitchThumb",ER=p.forwardRef((e,t)=>
vendor: 4,620 bytes, line 658
658{const{__scopeSwitch:n,...a}=e,i=ute(TR,n);return o.jsx(we.span,{"data-state":PR(i.checked),"data-disabled":i.disabled?"":void 0,...a,ref:t})});ER.displayName=TR;var cte="SwitchBubbleInput",AR=p.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:a=!0,...i},r)=>{const s=p.useRef(null),l=Pe(s,r),u=Hv(n),c=uk(t);return p.useEffect(()=>{const h=s.current;if(!h)return;const d=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(d,"checked").set;if(u!==n&&f){const y=new Event("click",{bubbles:a});f.call(h,n),h.dispatchEvent(y)}},[u,n,a]),o.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:l,style:{...i.style,...c,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});AR.displayName=cte;function PR(e){return e?"checked":"unchecked"}var MR=CR,dte=ER;const dl=p.forwardRef(({className:e,...t},n)=>o.jsx(MR,{className:ce("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50",e),...t,ref:n,children:o.jsx(dte,{className:ce("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));dl.displayName=MR.displayName;var Lf="Dialog",[RR,IR]=Yt(Lf),[hte,Ba]=RR(Lf),OR=e=>{const{__scopeDialog:t,children:n,open:a,defaultOpen:i,onOpenChange:r,modal:s=!0}=e,l=p.useRef(null),u=p.useRef(null),[c,h]=ma({prop:a,defaultProp:i??!1,onChange:r,caller:Lf});return o.jsx(hte,{scope:t,triggerRef:l,contentRef:u,contentId:la(),titleId:la(),descriptionId:la(),open:c,onOpenChange:h,onOpenToggle:p.useCallback(()=>h(d=>!d),[h]),modal:s,children:n})};OR.displayName=Lf;var LR="DialogTrigger",DR=p.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,i=Ba(LR,n),r=Pe(t,i.triggerRef);return o.jsx(we.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Gv(i.open),...a,ref:r,onClick:ue(e.onClick,i.onOpenToggle)})});DR.displayName=LR;var Wv="DialogPortal",[mte,zR]=RR(Wv,{forceMount:void 0}),FR=e=>{const{__scopeDialog:t,forceMount:n,children:a,container:i}=e,r=Ba(Wv,t);return o.jsx(mte,{scope:t,forceMount:n,children:p.Children.map(a,s=>o.jsx(fa,{present:n||r.open,children:o.jsx(Cc,{asChild:!0,container:i,children:s})}))})};FR.displayName=Wv;var _m="DialogOverlay",BR=p.forwardRef((e,t)=>{const n=zR(_m,e.__scopeDialog),{forceMount:a=n.forceMount,...i}=e,r=Ba(_m,e.__scopeDialog);return r.modal?o.jsx(fa,{present:a||r.open,children:o.jsx(pte,{...i,ref:t})}):null});BR.displayName=_m;var fte=_s("DialogOverlay.RemoveScroll"),pte=p.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,i=Ba(_m,n);return o.jsx(df,{as:fte,allowPinchZoom:!0,shards:[i.contentRef],children:o.jsx(we.div,{"data-state":Gv(i.open),...a,ref:t,style:{pointerEvents:"auto",...a.style}})})}),As="DialogContent",KR=p.forwardRef((e,t)=>{const n=zR(As,e.__scopeDialog),{forceMount:a=n.forceMount,...i}=e,r=Ba(As,e.__scopeDialog);return o.jsx(fa,{present:a||r.open,children:r.modal?o.jsx(gte,{...i,ref:t}):o.jsx(yte,{...i,ref:t})})});KR.displayName=As;var gte=p.forwardRef((e,t)=>{const n=Ba(As,e.__scopeDialog),a=p.useRef(null),i=Pe(t,n.contentRef,a);return p.useEffect(()=>{const r=a.current;if(r)return Sk(r)},[]),o.jsx($R,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ue(e.onCloseAutoFocus,r=>{var s;r.preventDefault(),(s=n.triggerRef.current)==null||s.focus()}),onPointerDownOutside:ue(e.onPointerDownOutside,r=>{const s=r.detail.originalEvent,l=s.button===0&&s.ctrlKey===!0;(s.button===2||l)&&r.preventDefault()}),onFocusOutside:ue(e.onFocusOutside,r=>r.preventDefault())})}),yte=p.forwardRef((e,t)=>{const n=Ba(As,e.__scopeDialog),a=p.useRef(!1),i=p.useRef(!1);return o.jsx($R,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:r=>{var s,l;(s=e.onCloseAutoFocus)==null||s.call(e,r),r.defaultPrevented||(a.current||(l=n.triggerRef.current)==null||l.focus(),r.preventDefault()),a.current=!1,i.current=!1},onInteractOutside:r=>{var u,c;(u=e.onInteractOutside)==null||u.call(e,r),r.defaultPrevented||(a.current=!0,r.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const s=r.target;((c=n.triggerRef.current)==null?void 0:c.contains(s))&&r.preventDefault(),r.detail.originalEvent.type==="focusin"&&i.current&&r.preventDefault()}})}),$R=p.forwardRef((e,t)=>
vendor: 4,590 bytes, lines 658-668
658{const{__scopeDialog:n,trapFocus:a,onOpenAutoFocus:i,onCloseAutoFocus:r,...s}=e,l=Ba(As,n),u=p.useRef(null),c=Pe(t,u);return _k(),o.jsxs(o.Fragment,{children:[o.jsx(lf,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:i,onUnmountAutoFocus:r,children:o.jsx(gl,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":Gv(l.open),...s,ref:c,onDismiss:()=>l.onOpenChange(!1)})}),o.jsxs(o.Fragment,{children:[o.jsx(xte,{titleId:l.titleId}),o.jsx(vte,{contentRef:u,descriptionId:l.descriptionId})]})]})}),qv="DialogTitle",UR=p.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,i=Ba(qv,n);return o.jsx(we.h2,{id:i.titleId,...a,ref:t})});UR.displayName=qv;var VR="DialogDescription",HR=p.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,i=Ba(VR,n);return o.jsx(we.p,{id:i.descriptionId,...a,ref:t})});HR.displayName=VR;var WR="DialogClose",qR=p.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,i=Ba(WR,n);return o.jsx(we.button,{type:"button",...a,ref:t,onClick:ue(e.onClick,()=>i.onOpenChange(!1))})});qR.displayName=WR;function Gv(e){return e?"open":"closed"}var GR="DialogTitleWarning",[wte,YR]=m3(GR,{contentName:As,titleName:qv,docsSlug:"dialog"}),xte=({titleId:e})=>{const t=YR(GR),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. 659 660If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. 661 662For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return p.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},kte="DialogDescriptionWarning",vte=({contentRef:e,descriptionId:t})=>{const a=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${YR(kte).contentName}}.`;return p.useEffect(()=>{var r;const i=(r=e.current)==null?void 0:r.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(a))},[a,e,t]),null},JR=OR,bte=DR,QR=FR,Yv=BR,Jv=KR,Qv=UR,Xv=HR,Zv=qR,XR="AlertDialog",[jte,kie]=Yt(XR,[IR]),Li=IR(),ZR=e=>{const{__scopeAlertDialog:t,...n}=e,a=Li(t);return o.jsx(JR,{...a,...n,modal:!0})};ZR.displayName=XR;var _te="AlertDialogTrigger",Ste=p.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...a}=e,i=Li(n);return o.jsx(bte,{...i,...a,ref:t})});Ste.displayName=_te;var Nte="AlertDialogPortal",eI=e=>{const{__scopeAlertDialog:t,...n}=e,a=Li(t);return o.jsx(QR,{...a,...n})};eI.displayName=Nte;var Cte="AlertDialogOverlay",tI=p.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...a}=e,i=Li(n);return o.jsx(Yv,{...i,...a,ref:t})});tI.displayName=Cte;var Oo="AlertDialogContent",[Tte,Ete]=jte(Oo),Ate=FC("AlertDialogContent"),nI=p.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:a,...i}=e,r=Li(n),s=p.useRef(null),l=Pe(t,s),u=p.useRef(null);return o.jsx(wte,{contentName:Oo,titleName:aI,docsSlug:"alert-dialog",children:o.jsx(Tte,{scope:n,cancelRef:u,children:o.jsxs(Jv,{role:"alertdialog",...r,...i,ref:l,onOpenAutoFocus:ue(i.onOpenAutoFocus,c=>{var h;c.preventDefault(),(h=u.current)==null||h.focus({preventScroll:!0})}),onPointerDownOutside:c=>c.preventDefault(),onInteractOutside:c=>c.preventDefault(),children:[o.jsx(Ate,{children:a}),o.jsx(Mte,{contentRef:s})]})})})});nI.displayName=Oo;var aI="AlertDialogTitle",iI=p.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...a}=e,i=Li(n);return o.jsx(Qv,{...i,...a,ref:t})});iI.displayName=aI;var rI="AlertDialogDescription",sI=p.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...a}=e,i=Li(n);return o.jsx(Xv,{...i,...a,ref:t})});sI.displayName=rI;var Pte="AlertDialogAction",oI=p.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...a}=e,i=Li(n);return o.jsx(Zv,{...i,...a,ref:t})});oI.displayName=Pte;var lI="AlertDialogCancel",uI=p.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...a}=e,{cancelRef:i}=Ete(lI,n),r=Li(n),s=Pe(t,i);return o.jsx(Zv,{...r,...a,ref:s})});uI.displayName=lI;var Mte=({contentRef:e})=>{const t=`\`${Oo}\` requires a description for the component to be accessible for screen reader users. 663 664You can add a description to the \`${Oo}\` by passing a \`${rI}\` component as a child, which also benefits sighted users by adding visible context to the dialog. 665 666Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${Oo}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component. 667 668For more information, see https://radix-ui.com/primitives/docs/components/
668alert-dialog`;return p.useEffect(()=>{var a;document.getElementById((a=e.current)==null?void 0:a.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},Rte=ZR,Ite=eI,cI=tI,dI=nI,hI=oI,mI=uI,fI=iI,pI=sI;const Ote=Rte,Lte=Ite,gI=p.forwardRef(({className:e,...t},n)=>o.jsx(cI,{className:ce("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));gI.displayName=cI.displayName;const yI=p.forwardRef(({className:e,...t},n)=>o.jsxs(Lte,{children:[o.jsx(gI,{}),o.jsx(dI,{ref:n,className:ce("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...t})]}));yI.displayName=dI.displayName;const wI=({className:e,...t})=>o.jsx("div",{className:ce("flex flex-col space-y-2 text-center sm:text-left",e),...t});wI.displayName="AlertDialogHeader";const xI=({className:e,...t})=>o.jsx("div",{className:ce("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});xI.displayName="AlertDialogFooter";const kI=p.forwardRef(({className:e,...t},n)=>o.jsx(fI,{ref:n,className:ce("text-lg font-semibold",e),...t}));kI.displayName=fI.displayName;const vI=p.forwardRef(({className:e,...t},n)=>o.jsx(pI,{ref:n,className:ce("text-sm text-muted-foreground",e),...t}));vI.displayName=pI.displayName;const bI=p.forwardRef(({className:e,...t},n)=>o.jsx(hI,{ref:n,className:ce(Dk(),e),...t}));bI.displayName=hI.displayName;const jI=p.forwardRef(({className:e,...t},n)=>o.jsx(mI,{ref:n,className:ce(Dk({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));jI.displayName=mI.displayName;const sS=JR,Dte=QR,_I=p.forwardRef(({className:e,...t},n)=>o.jsx(Yv,{ref:n,className:ce("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));_I.displayName=Yv.displayName;const zw=p.forwardRef(({className:e,children:t,...n},a)=>o.jsxs(Dte,{children:[o.jsx(_I,{}),o.jsxs(Jv,{ref:a,className:ce("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n,children:[t,o.jsxs(Zv,{className:"absolute right-4 top-4 roun
668ded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-accent data-[state=open]:text-muted-foreground hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[o.jsx(Rc,{className:"h-4 w-4"}),o.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));zw.displayName=Jv.displayName;const Fw=({className:e,...t})=>o.jsx("div",{className:ce("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Fw.displayName="DialogHeader";const Bw=({className:e,...t})=>o.jsx("div",{className:ce("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Bw.displayName="DialogFooter";const Kw=p.forwardRef(({className:e,...t},n)=>o.jsx(Qv,{ref:n,className:ce("text-lg font-semibold leading-none tracking-tight",e),...t}));Kw.displayName=Qv.displayName;const $w=p.forwardRef(({className:e,...t},n)=>o.jsx(Xv,{ref:n,className:ce("text-sm text-muted-foreground",e),...t}));$w.displayName=Xv.displayName;const Zs=["President","Governor","Senator","MP","MCA","Woman Representative"],Hr=["Jobs","Education","Healthcare","Taxes","Corruption","Infrastructure","Youth Opportunities","Digital Access","Agriculture","Security"],mg={office:"President",candidate_id:"",candidate_name:"",party:"",issue:"Jobs",title_en:"",title_sw:"",promises_en:"",promises_sw:"",source_url:"",source_name:"",is_published:!0},zte=()=>{const{t:e}=Re(),{toast:t}=Zn(),[n,a]=p.useState([]),[i,r]=p.useState(!0),[s,l]=p.useState(null),[u,c]=p.useState(!1),[h,d]=p.useState(mg),[m,f]=p.useState(!1),[y,g]=p.useState(""),[x,w]=p.useState("all"),[v,k]=p.useState("all"),[j,S]=p.useState("all"),[_,T]=p.useState(null),[E,O]=p.useState(!1),[A,R]=p.useState(!1),[F,Y]=p.useState(""),[V,z]=p.useState(!1),[W,B]=p.useState([]),[M,I]=p.useState(!0),[b,C]=p.useState(!1),[D,N]=p.useState(null),J=n.filter($=>{if(x!=="all"&&$.office!==x||v!=="all"&&$.issue!==v||j==="published"&&!$.is_published||j==="draft"&&$.is_published)return!1;if(y.trim()){const he=y.trim().toLowerCase();if(!`${$.title_en} ${$.title_sw||""} ${$.candidate_name} ${$.party}`.toLowerCase().includes(he))return!1}return!0}),re={};Zs.forEach($=>{re[$]={},Hr.forEach(he=>{re[$][he]=0})}),n.forEach($=>{$.is_published&&re[$.office]&&re[$.office][$.issue]!==void 0&&re[$.office][$.issue]++});const ee=Zs.reduce(($,he)=>$+Hr.filter(xe=>re[he][xe]<2).length,0),G=($,he)=>{w($),k(he),S("published"),g("")},ie=async()=>{r(!0);const{data:$,error:he}=await te.from("manifesto_cards").select("*").order("created_at",{ascending:!1});he&&t({title:he.message,variant:"destructive"}),a($||[]),r(!1)};p.useEffect(()=>{ie()},[]);const q=()=>{d(mg),l(null),c(!1)},ae=$=>{l($.id),d({office:$.office,candidate_id:$.candidate_id,candidate_name:$.candidate_name,party:$.party,issue:$.issue,title_en:$.title_en,title_sw:$.title_sw||"",promises_en:Array.isArray($.promises_en)?$.promises_en.join(` 669`):"",promises_sw:Array.isArray($.promises_sw)?$.promises_sw.join(` 670`):"",source_url:$.source_url||"",source_name:$.source_name||"",is_published:$.is_published}),c(!0)},de=async $=>{if($.preventDefault(),!h.candidate_name.trim()||!h.title_en.trim()||!h.party.trim()){t({title:e("Candidate name, party and English title are required","Jina la mgombea, chama na kichwa cha Kiingereza vinahitajika"),variant:"destructive"});return}f(!0);const he={office:h.office,candidate_id:h.candidate_id.trim()||h.candidate_name.trim().toLowerCase().replace(/\s+/g,"-"),candidate_name:h.candidate_name.trim(),party:h.party.trim(),issue:h.issue,title_en:h.title_en.trim(),title_sw:h.title_sw.trim()||null,promises_en:h.promises_en.split(` 671`).map(Me=>Me.trim()).filter(Boolean),promises_sw:h.promises_sw.split(` 672`).map(Me=>Me.trim()).filter(Boolean),source_url:h.source_url.trim()||null,source_name:h.source_name.trim()||null,is_published:h.is_published},{error:xe}=s?await te.from("manifesto_cards").update(he).eq("id",s):await te.from("manifesto_cards").insert(he);if(f(!1),xe){t({title:xe.message,variant:"destructive"});return}t({title:s?e("Card updated","Kadi imesasishwa"):e("Card created","Kadi imeundwa")}),q(),ie()},me=async $=>{const{error:he}=await te.from("manifesto_cards").update({is_published:!$.is_published}).eq("id",$.id);
672if(he){t({title:he.message,variant:"destructive"});return}t({title:$.is_published?e("Unpublished","Imeondolewa"):e("Published","Imechapishwa")}),ie()},Ce=async()=>{if(!_)return;O(!0);const{error:$}=await te.from("manifesto_cards").delete().eq("id",_.id);if(O(!1),$){t({title:$.message,variant:"destructive"});return}t({title:e("Deleted","Imefutwa")}),T(null),ie()},ke=["office","candidate_name","party","issue","title_en","title_sw","promises_en","promises_sw","source_name","source_url","is_published"],Ve=$=>{const he=[];let xe=[],Me="",be=!1;for(let U=0;U<$.length;U++){const P=$[U];be?P==='"'&&$[U+1]==='"'?(Me+='"',U++):P==='"'?be=!1:Me+=P:P==='"'?be=!0:P===","?(xe.push(Me),Me=""):P===` 673`?(xe.push(Me),he.push(xe),xe=[],Me=""):P==="\r"||(Me+=P)}return(Me.length>0||xe.length>0)&&(xe.push(Me),he.push(xe)),he.filter(U=>U.some(P=>P.trim().length>0))},We=()=>{const $=[ke.join(","),'President,Jane Doe,Party A,Jobs,Create 1M jobs,Tengeneza kazi 1M,"Build factories|Train youth","Jenga viwanda|Funza vijana",Manifesto 2027,https://example.com,true',"Governor,John Smith,Party B,Healthcare,Universal county clinics,,Build clinic per ward,,,https://example.com,true"].join(` 674`),he=new Blob([$],{type:"text/csv"}),xe=URL.createObjectURL(he),Me=document.createElement("a");Me.href=xe,Me.download="manifesto-cards-template.csv",Me.click(),URL.revokeObjectURL(xe)},Ge=$=>{const he=new FileReader;he.onload=()=>Y(String(he.result||"")),he.readAsText($)},ht=async()=>{if(B([]),!F.trim())return;const $=Ve(F);if($.length<2){B([e("CSV must have a header row and at least one data row","CSV lazima iwe na safu ya kichwa na safu moja ya data")]);return}const he=$[0].map(je=>je.trim().toLowerCase()),xe=["office","candidate_name","party","issue","title_en"].filter(je=>!he.includes(je));if(xe.length){B([e(`Missing required columns: ${xe.join(", ")}`,`Safu zinazohitajika hazipo: ${xe.join(", ")}`)]);return}const Me=je=>he.indexOf(je),be=[],U=[];for(let je=1;je<$.length;je++){const Qe=$[je],Ke=pa=>{const Jt=Me(pa);return Jt>=0?(Qe[Jt]||"").trim():""},Nt=Ke("office"),Xe=Ke("candidate_name"),wn=Ke("party"),Ct=Ke("issue"),hi=Ke("title_en");if(!Nt||!Xe||!wn||!Ct||!hi){be.push(e(`Row ${je+1}: missing required field`,`Safu ${je+1}: sehemu inayohitajika haipo`));continue}if(!Zs.includes(Nt)){be.push(e(`Row ${je+1}
674: invalid office "${Nt}"`,`Safu ${je+1}: ofisi batili "${Nt}"`));continue}if(!Hr.includes(Ct)){be.push(e(`Row ${je+1}: invalid issue "${Ct}"`,`Safu ${je+1}: suala batili "${Ct}"`));continue}const Br=pa=>pa.split("|").map(Jt=>Jt.trim()).filter(Boolean),Bs=Ke("is_published").toLowerCase();U.push({row:je+1,data:{office:Nt,candidate_name:Xe,candidate_id:Xe.toLowerCase().replace(/\s+/g,"-"),party:wn,issue:Ct,title_en:hi,title_sw:Ke("title_sw")||null,promises_en:Br(Ke("promises_en")),promises_sw:Br(Ke("promises_sw")),source_name:Ke("source_name")||null,source_url:Ke("source_url")||null,is_published:Bs===""?!0:!["false","0","no","draft"].includes(Bs)}})}const P=je=>je.trim().toLowerCase(),L=new Set(n.map(je=>`${P(je.candidate_name)}::${P(je.issue)}`)),H=new Set,Z=[],Ae=[];for(const je of U){const Qe=`${P(je.data.candidate_name)}::${P(je.data.issue)}`,Ke=L.has(Qe),Nt=H.has(Qe);if(M&&(Ke||Nt)){Ae.push({row:je.row,candidate_name:je.data.candidate_name,issue:je.data.issue,reason:Ke?"existing":"batch"});continue}H.add(Qe),Z.push(je.data)}if(Z.length===0&&be.length===0&&Ae.length===0){B([e("No valid rows to import","Hakuna safu halali za kuingiza")]);return}N({toInsert:Z,duplicates:Ae,invalids:be}),C(!0)},mt=async()=>{if(!D)return;const{toInsert:$,duplicates:he,invalids:xe}=D;if($.length===0){C(!1),B([...xe,he.length>0?e(`All ${he.length} rows are duplicates of existing cards`,`Safu zote ${he.length} ni nakala za kadi zilizopo`):e("No valid rows to import","Hakuna safu halali za kuingiza")]);return}z(!0);const{error:Me}=await te.from("manifesto_cards").insert($);if(z(!1),Me){C(!1),B([Me.message]);return}const be=[xe.length?e(`${xe.length} invalid`,`${xe.length} batili`):"",he.length?e(`${he.length} duplicates`,`nakala ${he.length}`):""].filter(Boolean).join(" · ");t({title:e(`Imported ${$.length} cards`,`Zimeingizwa kadi ${$.length}`),description:be?e(`Skipped: ${be}`,`Zimerukwa: ${be}`):void 0}),C(!1),N(null),R(!1),Y(""),B([]),ie()},st=()=>{if(J.length===0){t({title:e("No cards to export","Hakuna kadi za kusafirisha"),variant:"destructive"});return}const $=U=>{const P=U==null?"":String(U);return/[",\n\r]/.test(P)?`"${P.replace(/"/g,'""')}"`:P},he=[ke.join(",")];J.forEach(U=>{const P=Array.isArray(U.promises_en)?U.promises_en.join("|"):"",L=Array.isArray(U.promises_sw)?U.promises_sw.join("|"):"";he.push([U.office,U.candidate_name,U.party,U.issue,U.title_en,U.title_sw||"",P,L,U.source_name||"",U.source_url||"",U.is_published?"true":"false"].map($).join(","))});const xe=new Blob([he.join(` 675`)],{type:"text/csv"}),Me=URL.createObjectURL(xe),be=document.createElement("a");be.href=Me,be.download=`manifesto-cards-${new Date().toISOString().slice(0,10)}.csv`,be.click(),URL.revokeObjectURL(Me),t({title:e(`Exported ${J.length} cards`,`Zimesafirishwa kadi ${J.length}`)})};return o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"flex items-center justify-between gap-2",children:[o.jsxs("h2",{className:"text-sm font-bold",children:[e("Manifesto Cards","Kadi za Ilani")," (",J.length,J.length!==n.length?` / ${n.length}`:"",")"]}),!u&&o.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[o.jsxs(Q,{size:"sm",variant:"outline",className:"text-xs",onClick:st,disabled:J.length===0,children:[o.jsx(_0,{className:"h-3 w-3"})," ",e("Export CSV","Hamisha CSV")]}),o.jsxs(Q,{size:"sm",variant:"outline",className:"text-xs",onClick:()=>{Y(""),B([]),R(!0)},children:[o.jsx(bu,{className:"h-3 w-3"})," ",e("Import CSV","Ingiza CSV")]}),o.jsxs(Q,{size:"sm",className:"text-xs",onClick:()=>{d(mg),l(null),c(!0)},children:[o.jsx(ek,{className:"h-3 w-3"})," ",e("New Card","Kadi Mpya")]})]})]}),!u&&o.jsxs(X,{className:"p-3 space-y-2 overflow-x-auto",children:[o.jsxs("div",{className:"flex items-center justify-between gap-2",children:[o.jsx("h3",{className:"text-xs font-semibold",children:e("Coverage Matrix (published cards per office à issue)","Jedwali la Uwepo (kadi zilizochapishwa kwa ofisi à suala)")}),ee>0&&o.jsxs("span",{className:"text-[10px] bg-warning/15 text-warning px-1.5 py-0.5 rounded whitespace-nowrap",children:[ee," ",e("cells need data (<2)","visanduku vinahitaji data (<2)")]})]}),o.jsxs("table",{className:"w-full text-[10px] border-collapse",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{className:"text-left font-medium text-muted-foreground p-1 sticky left-0 bg-background",children:e("Office","Ofisi")}),Hr.map($=>o.jsx("th",{className:"text-center font-medium text-muted-foreground p-1 whitespace-nowrap",children:$},$))]})}),o.jsx("tbody",{children:Zs.map($=>o.jsxs("tr",{className:"border-t border-border/50",children:[o.jsx("td",{className:"text-left font-medium p-1 sticky left-0 bg-background whitespace-nowrap",children:$}),Hr.map(he=>{const xe=re[$][he],Me=xe===0?"bg-destructive/15 text-destructive hover:bg-destructive/25":xe<2?"bg-warning/15 text-warning hover:bg-warning/25":"bg-primary/15 text-primary hover:bg-primary/25";return o.jsx("td",{className:"p-0.5 text-center",children:o.jsx("button",{type:"button",onClick:()=>G($,he),className:`w-full rounded px-1.5 py-1 font-semibold transition-colors ${Me}`,title:`${$} · ${he}`,children:xe})},he)})]},$))})]}),o.jsx("p",{className:"text-[10px] text-muted-foreground",children:e("Red = 0 cards · Amber = 1 card · Green = 2+ cards. Click a cell to filter.","Nyekundu = kadi 0 · Manjano = kadi 1 · Kijani = kadi 2+. Bofya kisanduku kuchuja.")})]}),!u&&o.jsxs(X,{className:"p-3 space-y-2",children:[o.jsx(ft,{className:"text-xs h-9",placeholder:e("Search by title, candidate or partyâ¦","Tafuta kwa kichwa, mgombea au chamaâ¦"),value:y,onChange:$=>g($.target.value)}),o.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[o.jsxs("select",{className:"w-full h-9 rounded-md border border-input bg-background px-2 text-xs",value:x,onChange:$=>w($.target.value),children:[o.jsx("option",{value:"all",children:e("All office
675s","Ofisi zote")}),Zs.map($=>o.jsx("option",{value:$,children:$},$))]}),o.jsxs("select",{className:"w-full h-9 rounded-md border border-input bg-background px-2 text-xs",value:v,onChange:$=>k($.target.value),children:[o.jsx("option",{value:"all",children:e("All issues","Masuala yote")}),Hr.map($=>o.jsx("option",{value:$,children:$},$))]}),o.jsxs("select",{className:"w-full h-9 rounded-md border border-input bg-background px-2 text-xs",value:j,onChange:$=>S($.target.value),children:[o.jsx("option",{value:"all",children:e("All status","Hali zote")}),o.jsx("option",{value:"published",children:e("Published","Imechapishwa")}),o.jsx("option",{value:"draft",children:e("Draft","Rasimu")})]})]}),(y||x!=="all"||v!=="all"||j!=="all")&&o.jsx(Q,{size:"sm",variant:"ghost",className:"text-[10px] h-7",onClick:()=>{g(""),w("all"),k("all"),S("all")},children:e("Clear filters","Futa vichungi")})]}),u&&o.jsx(X,{className:"p-4",children:o.jsxs("form",{onSubmit:de,className:"space-y-3",children:[o.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[o.jsxs("div",{className:"space-y-1",children:[o.jsx(At,{className:"text-xs",children:e("Office","Ofisi")}),o.jsx("select",{className:"w-full h-9 rounded-md border border-input bg-background px-2 text-xs",value:h.office,onChange:$=>d({...h,office:$.target.value}),children:Zs.map($=>o.jsx("option",{value:$,children:$},$))})]}),o.jsxs("div",{className:"space-y-1",children:[o.jsx(At,{className:"text-xs",children:e("Issue","Suala")}),o.jsx("select",{className:"w-full h-9 rounded-md border border-input bg-background px-2 text-xs",value:h.issue,onChange:$=>d({...h,issue:$.target.value}),children:Hr.map($=>o.jsx("option",{value:$,children:$},$))})]}),o.jsxs("div",{className:"space-y-1",children:[o.jsxs(At,{className:"text-xs",children:[e("Candidate Name","Jina la Mgombea")," *"]}),o.jsx(ft,{className:"text-xs h-9",value:h.candidate_name,onChange:$=>d({...h,candidate_name:$.target.value}),required:!0})]}),o.jsxs("div",{className:"space-y-1",children:[o.jsxs(At,{className:"text-xs",children:[e("Party","Chama")," *"]}),o.jsx(ft,{className:"text-xs h-9",value:h.party,onChange:$=>d({...h,party:$.target.value}),required:!0})]}),o.jsxs("div",{className:"space-y-1 col-span-2",children:[o.jsx(At,{className:"text-xs",children:e("Candidate ID (optional, auto-generated)","Kitambulisho cha Mgombea (chaguo, kinazalishwa kiotomatiki)")}),o.jsx(ft,{className:"text-xs h-9",value:h.candidate_id,onChange:$=>d({...h,candidate_id:$.target.value}),placeholder:"e.g. john-doe"})]}),o.jsxs("div",{className:"space-y-1 col-span-2",children:[o.jsxs(At,{className:"text-xs",children:[e("Title (English)","Kichwa (Kiingereza)")," *"]}),o.jsx(ft,{className:"text-xs h-9",value:h.title_en,onChange:$=>d({...h,title_en:$.target.value}),required:!0})]}),o.jsxs("div",{className:"space-y-1 col-span-2",children:[o.jsx(At,{className:"text-xs",children:e("Title (Swahili)","Kichwa (Kiswahili)")}),o.jsx(ft,{className:"text-xs h-9",value:h.title_sw,onChange:$=>d({...h,title_sw:$.target.value})})]}),o.jsxs("div",{className:"space-y-1 col-span-2",children:[o.jsx(At,{className:"text-xs",children:e("Promises (English) â one per line","Ahadi (Kiingereza) â moja kwa kila mstari")}),o.jsx(Ia,{className:"text-xs min-h-[90px]",value:h.promises_en,onChange:$=>d({...h,promises_en:$.target.value}),placeholder:`Build 1000 schools 676Reduce taxes for SMEs`})]}),o.jsxs("div",{className:"space-y-1 col-span-2",children:[o.jsx(At,{className:"text-xs",children:e("Promises (Swahili) â one per line","Ahadi (Kiswahili) â moja kwa kila mstari")}),o.jsx(Ia,{className:"text-xs min-h-[90px]",value:h.promises_sw,onChange:$=>d({...h,promises_sw:$.target.value})})]}),o.jsxs("div",{className:"space-y-1",children:[o.jsx(At,{className:"text-xs",children:e("Source Name","Jina la Chanzo")}),o.jsx(ft,{className:"text-xs h-9",value:h.source_name,onChange:$=>d({...h,source_name:$.target.value})})]}),o.jsxs("div",{className:"space-y-1",children:[o.jsx(At,{className:"text-xs",children:e("Source URL","Kiungo cha Chanzo")}),o.jsx(ft,{type:"url",className:"text-xs h-9",value:h.source_url,onChange:$=>d({...h,source_url:$.target.value}),placeholder:"https://..."})]}),o.jsxs("div",{className:"flex items-center gap-2 col-span-2",children:[o.jsx(dl,{checked:h.is_published,onCheckedChange:$=>d({...h,is_published:$})}),o.jsx(At,{className:"text-xs",children:h.is_published?e("Published","Imechapishwa"):e("Draft (unpublished)","Rasimu (haijachapishwa)")})]})]}),o.jsxs("div",{className:"flex gap-2",children:[o.jsxs(Q,{type:"submit",size:"sm",className:"text-xs",disabled:m,children:[m&&o.jsx(Be,{className:"mr-1 h-3 w-3 animate-spin"}),s?e("Update Card","Sasisha Kadi"):e("Create Card","Tengeneza Kadi")]}),o.jsx(Q,{type:"button",size:"sm",variant:"outline",className:"text-xs",onClick:q,children:e("Cancel","Ghairi")})]})]})}),i?o.jsx("div",{className:"flex justify-center py-8",children:o.jsx(Be,{className:"h-5 w-5 animate-spin text-primary"})}):n.length===0?o.jsx("p",{className:"text-xs text-muted-foreground text-center py-4",children:e("No manifesto cards yet","Bado hakuna kadi za ilani")}):J.length===0?o.jsx("p",{className:"text-xs text-muted-foreground text-center py-4",children:e("No cards match your filters","Hakuna kadi zinazolingana na vichungi")}):J.map($=>{const he=Array.isArray($.promises_en)?$.promises_en:[];return o.jsxs(X,{className:"p-3",children:[o.jsx("div",{className:"flex items-start justify-between gap-2 mb-2",children:o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsxs("div",{className:"flex items-center gap-2 flex-wrap mb-1",children:[o.jsx("span",{className:"text-[9px] uppercase bg-muted px-1.5 py-0.5 rounded",children:$.office}),o.jsx("span",{className:"text-[9px] uppercase bg-primary/15 text-primary px-1.5 py-0.5 rounded",children:$.issue}),$.is_published?o.jsx("span",{className:"text-[9px] bg-green-500/15 text-green-600 px-1.5 py-0.5 rounded",children:e("Published","Imechapishwa")}):o.jsx("span",{className:"text-[9px] bg-warning/15 text-warning px-1.5 py-0.5 rounded",children:e("Draft","Rasimu")})]}),o.jsx("p",{className:"text-xs font-semibold",children:$.title_en}),o.jsxs("p",{className:"text-[10px] text-muted-foreground",children:[$.candidate_name," · ",$.party]}),he.length>0&&o.jsxs("ul",{className:"text-[10px] text-muted-foreground mt-1 list-disc pl-4",children:[he.slice(0,3).map((xe,Me)=>o.jsx("li",{children:xe},Me)),he.length>3&&o.jsxs("li",{children:["+",he.length-3," more"]})]}),$.source_url&&o.jsxs("a",{href:$.source_url,target:"_blank",rel:"noopener noreferrer",className:"text-[10px] text-primary inline-flex items-center gap-1 mt-1",children:[o.jsx(Nn,{className:"h-2.5 w-2.5"})," ",$.source_name||$.source_url]}
676)]})}),o.jsxs("div",{className:"flex gap-2 flex-wrap",children:[o.jsxs(Q,{size:"sm",variant:"outline",className:"text-[10px] h-7",onClick:()=>ae($),children:[o.jsx(ED,{className:"h-3 w-3"})," ",e("Edit","Hariri")]}),o.jsx(Q,{size:"sm",variant:"outline",className:"text-[10px] h-7",onClick:()=>me($),children:$.is_published?o.jsxs(o.Fragment,{children:[o.jsx(f2,{className:"h-3 w-3"})," ",e("Unpublish","Ondoa")]}):o.jsxs(o.Fragment,{children:[o.jsx(Zm,{className:"h-3 w-3"})," ",e("Publish","Chapisha")]})}),o.jsxs(Q,{size:"sm",variant:"destructive",className:"text-[10px] h-7",onClick:()=>T($),children:[o.jsx(Mc,{className:"h-3 w-3"})," ",e("Delete","Futa")]})]})]},$.id)}),o.jsx(Ote,{open:!!_,onOpenChange:$=>{$||T(null)},children:o.jsxs(yI,{children:[o.jsxs(wI,{children:[o.jsx(kI,{children:e("Delete this manifesto card?","Futa kadi hii ya ilani?")}),o.jsx(vI,{children:_?o.jsxs(o.Fragment,{children:[e("This will permanently delete","Hii itafuta kabisa")," ",o.jsxs("strong",{children:['"',_.title_en,'"']})," ","(",_.candidate_name," · ",_.party,")."," ",e("This action cannot be undone.","Kitendo hiki hakiwezi kutenduliwa.")]}):null})]}),o.jsxs(xI,{children:[o.jsx(jI,{disabled:E,children:e("Cancel","Ghairi")}),o.jsxs(bI,{onClick:$=>{$.preventDefault(),Ce()},disabled:E,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:[E&&o.jsx(Be,{className:"mr-1 h-3 w-3 animate-spin"}),e("Delete","Futa")]})]})]})}),o.jsx(sS,{open:A,onOpenChange:$=>{R($),$||(Y(""),B([]))},children:o.jsxs(zw,{className:"max-w-2xl",children:[o.jsxs(Fw,{children:[o.jsx(Kw,{children:e("Bulk import manifesto cards","Ingiza kadi nyingi za ilani")}),o.jsx($w,{children:e('Upload a CSV or paste rows. Required: office, candidate_name, party, issue, title_en. Use "|" to separate multiple promises.','Pakia CSV au bandika safu. Inahitajika: office, candidate_name, party, issue, title_en. Tumia "|" kutenganisha ahadi nyingi.')})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"flex flex-wrap gap-2",children:[o.jsxs(Q,{type:"button",size:"sm",variant:"outline",className:"text-xs",onClick:We,children:[o.jsx(_0,{className:"h-3 w-3"})," ",e("Download template","Pakua kiolezo")]}),o.jsxs("label",{className:"inline-flex",children:[o.jsx("input",{type:"file",accept:".csv,text/csv",className:"hidden",onChange:$=>{var xe;const he=(xe=$.target.files)==null?void 0:xe[0];he&&Ge(he),$.target.value=""}}),o.jsxs("span",{className:"inline-flex items-center gap-1 text-xs h-9 px-3 rounded-md border border-input bg-background hover:bg-accent cursor-pointer",children:[o.jsx(bu,{className:"h-3 w-3"})," ",e("Choose CSV file","Chagua faili la CSV")]})]})]}),o.jsx(Ia,{className:"text-xs font-mono min-h-[180px]",placeholder:`office,candidate_name,party,issue,title_en,... 677President,Jane Doe,Party A,Jobs,Create 1M jobs,...`,value:F,onChange:$=>Y($.target.value)}),W.length>0&&o.jsxs("div",{className:"rounded border border-destructive/30 bg-destructive/10 p-2 max-h-32 overflow-auto",children:[o.jsxs("p",{className:"text-xs font-semibold text-destructive mb-1",children:[e("Issues found","Matatizo yamepatikana"),":"]}),o.jsxs("ul",{className:"text-[11px] text-destructive space-y-0.5 list-disc pl-4",children:[W.slice(0,20).map(($,he)=>o.jsx("li",{children:$},he)),W.length>20&&o.jsx("li",{children:e(`+${W.length-20} more`,`+${W.length-20} zaidi`)})]})]}),o.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[o.jsx(dl,{checked:M,onCheckedChange:I,id:"skip-dupes"}),o.jsx(At,{htmlFor:"skip-dupes",className:"text-xs cursor-pointer",children:e("Skip duplicates (same candidate name + issue already exists)","Ruka nakala (jina la mgombea + suala lipo tayari)")})]})]}),o.jsxs(Bw,{children:[o.jsx(Q,{variant:"outline",size:"sm",className:"text-xs",onClick:()=>R(!1),disabled:V,children:e("Cancel","Ghairi")}),o.jsx(Q,{size:"sm",className:"text-xs",onClick:ht,disabled:V||!F.trim(),children:e("Preview import","Hakiki uingizaji")})]})]})}),o.jsx(sS,{open:b,onOpenChange:$=>{V||C($)},children:o.jsxs(zw,{className:"max-w-2xl",children:[o.jsxs(Fw,{children:[o.jsx(Kw,{children:e("Import preview","Hakiki ya uingizaji")}),o.jsx($w,{children:D&&e(`${D.toInsert.length} will be inserted · ${D.duplicates.length} duplicates skipped · ${D.invalids.length} invalid`,`${D.toInsert.length} zitaingizwa · nakala ${D.duplicates.length} zimerukwa · ${D.invalids.length} batili`)})]}),D&&o.jsxs("div",{className:"space-y-3 max-h-[420px] overflow-auto",children:[D.toInsert.length>0&&o.jsxs("div",{className:"rounded border border-primary/30 bg-primary/5 p-2",children:[o.jsx("p",{className:"text-xs font-semibold text-primary mb-1",children:e(`Will insert (${D.toInsert.length})`,`Zitaingizwa (${D.toInsert.length})`)}),o.jsxs("ul",{className:"text-[11px] space-y-0.5 list-disc pl-4",children:[D.toInsert.slice(0,50).map(($,he)=>o.jsxs("li",{children:[o.jsx("span",{className:"font-medium",children:$.candidate_name})," · ",$.office," · ",$.issue," â ",$.title_en]},he)),D.toInsert.length>50&&o.jsx("li",{children:e(`+${D.toInsert.length-50} more`,`+${D.toInsert.length-50} zaidi`)})]})]}),D.duplicates.length>0&&o.jsxs("div",{className:"rounded border border-muted-foreground
677/30 bg-muted/40 p-2",children:[o.jsx("p",{className:"text-xs font-semibold mb-1",children:e(`Skipped as duplicates (${D.duplicates.length})`,`Zimerukwa kama nakala (${D.duplicates.length})`)}),o.jsxs("ul",{className:"text-[11px] text-muted-foreground space-y-0.5 list-disc pl-4",children:[D.duplicates.slice(0,50).map(($,he)=>o.jsxs("li",{children:[e(`Row ${$.row}`,`Safu ${$.row}`),": ",o.jsx("span",{className:"font-medium",children:$.candidate_name})," · ",$.issue," ","(",$.reason==="existing"?e("already exists","tayari ipo"):e("duplicate within file","nakala ndani ya faili"),")"]},he)),D.duplicates.length>50&&o.jsx("li",{children:e(`+${D.duplicates.length-50} more`,`+${D.duplicates.length-50} zaidi`)})]})]}),D.invalids.length>0&&o.jsxs("div",{className:"rounded border border-destructive/30 bg-destructive/10 p-2",children:[o.jsx("p",{className:"text-xs font-semibold text-destructive mb-1",children:e(`Invalid (${D.invalids.length})`,`Batili (${D.invalids.length})`)}),o.jsxs("ul",{className:"text-[11px] text-destructive space-y-0.5 list-disc pl-4",children:[D.invalids.slice(0,50).map(($,he)=>o.jsx("li",{children:$},he)),D.invalids.length>50&&o.jsx("li",{children:e(`+${D.invalids.length-50} more`,`+${D.invalids.length-50} zaidi`)})]})]})]}),o.jsxs(Bw,{children:[o.jsx(Q,{variant:"outline",size:"sm",className:"text-xs",onClick:()=>C(!1),disabled:V,children:e("Back","Rudi")}),o.jsxs(Q,{size:"sm",className:"text-xs",onClick:mt,disabled:V||!D||D.toInsert.length===0,children:[V&&o.jsx(Be,{className:"mr-1 h-3 w-3 animate-spin"}),D?e(`Confirm & insert ${D.toInsert.length}`,`Thibitisha & ingiza ${D.toInsert.length}`):e("Confirm","Thibitisha")]})]})]})})]})},Fte=()=>{const{t:e}=Re(),{toast:t}=Zn(),{user:n,loading:a,signOut:i}=Rt(),{isAdmin:r,loading:s}=K8(n==null?void 0:n.id),[l,u]=p.useState("items"),[c,h]=p.useState(!1),[d,m]=p.useState(""),[f,y]=p.useState(""),[g,x]=p.useState(!1),[w,v]=p.useState(!1),k=async _=>{_.preventDefault(),v(!0);try{if(g){const{error:T}=await te.auth.signUp({email:d,password:f});if(T)throw T;t({title:e("Check your email to verify your account","Angalia barua pepe yako ili kuthibitisha akaunti yako")})}else{const{error:T}=await te.auth.signInWithPassword({email:d,password:f});if(T)throw T}}catch(T){t({title:T.message,variant:"destructive"})}finally{v(!1)}},j=async()=>{const _=await _R.auth.signInWithOAuth("google",{redirect_uri:window.location.origin});_.error&&t({title:String(_.error),variant:"destructive"})};if(a||n&&s)return o.jsx("div",{className:"flex min-h-[60vh] items-center justify-center",children:o.jsx(Be,{className:"h-8 w-8 animate-spin text-primary"})});if(!n)return o.jsx("div",{className:"flex min-h-[60vh] items-center justify-center",children:o.jsxs(X,{className:"w-full max-w-sm p-6 space-y-4",children:[o.jsxs("div",{className:"text-center",children:[o.jsx(Ai,{className:"mx-auto h-10 w-10 text-primary"}),o.jsx("h1",{className:"font-heading mt-2 text-lg font-bold",children:e("Admin Access","Ufikiaji wa Msimamizi")}),o.jsx("p",{className:"text-[10px] text-muted-foreground mt-1",children:e("Sign in with an admin account","Ingia kwa akaunti ya msimamizi")})]}),o.jsxs(Q,{variant:"outline",className:"w-full text-xs",onClick:j,children:[o.jsxs("svg",{className:"mr-2 h-4 w-4",viewBox:"0 0 24 24",children:[o.jsx("path",{d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92a5.06 5.06 0 0 1-2.2 3.32v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.1z",fill:"#4285F4"}),o.jsx("path",{d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z",fill:"#34A853"}),o.jsx("path",{d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z",fill:"#FBBC05"}),o.jsx("path",{d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z",fill:"#EA4335"})]}),e("Sign in with Google","Ingia na Google")]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("div",{className:"h-px flex-1 bg-border"}),o.jsx("span",{className:"text-[10px] text-muted-foreground",children:e("or","au")}),o.jsx("div",{className:"h-px flex-1 bg-border"})]}),o.jsxs("form",{onSubmit:k,className:"space-y-3",children:[o.jsx(ft,{type:"email",placeholder:e("Email","Barua pepe"),value:d,onChange:_=>m(_.target.value),required:!0,className:"text-sm"}),o.jsx(ft,{type:"password",placeholder:e("Password","Nenosiri"),value:f,onChange:_=>y(_.target.value),required:!0,className:"text-sm"}),o.jsxs(Q,{type:"submit",className:"w-full text-xs",disabled:w,children:[w&&o.jsx(Be,{className:"mr-1 h-3 w-3 animate-spin"}),g?e("Sign Up","Jisajili"):e("Sign In","Ingia")]})]}),o.jsxs("p",{className:"text-center text-[10px] text-muted-foreground",children:[g?e("Already have an account?","Tayari una akaunti?"):e("Don't have an account?","Huna akaunti?")," ",o.jsx("button",{onClick:()=>
677x(!g),className:"text-primary underline",children:g?e("Sign In","Ingia"):e("Sign Up","Jisajili")})]})]})});if(!r)return o.jsx("div",{className:"flex min-h-[60vh] items-center justify-center",children:o.jsxs(X,{className:"w-full max-w-sm p-6 space-y-4 text-center",children:[o.jsx(Ai,{className:"mx-auto h-10 w-10 text-destructive"}),o.jsx("h1",{className:"font-heading text-lg font-bold",children:e("Access Denied","Ufikiaji Umekataliwa")}),o.jsx("p",{className:"text-xs text-muted-foreground",children:e("Your account does not have admin privileges.","Akaunti yako haina mamlaka ya msimamizi.")}),o.jsx("p",{className:"text-[10px] text-muted-foreground",children:n.email}),o.jsxs(Q,{size:"sm",variant:"outline",onClick:i,className:"text-xs",children:[o.jsx(fy,{className:"mr-1 h-3 w-3"})," ",e("Sign Out","Ondoka")]})]})});const S=jf.filter(_=>_.verification_status==="pending");return o.jsxs("div",{className:"space-y-5",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("h1",{className:"font-heading text-xl font-bold",children:e("Admin Dashboard","Dashibodi ya Msimamizi")}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"text-[10px] text-muted-foreground",children:n.email}),o.jsx(Q,{size:"sm",variant:"ghost",onClick:i,className:"text-xs",children:o.jsx(fy,{className:"h-3 w-3"})})]})]}),o.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[o.jsxs(X,{className:"p-3 text-center",children:[o.jsx("p",{className:"text-2xl font-bold text-primary",children:as.filter(_=>_.type==="bill").length}),o.jsx("p",{className:"text-[10px] text-muted-foreground",children:e("Bills","Miswada")})]}),o.jsxs(X,{className:"p-3 text-center",children:[o.jsx("p",{className:"text-2xl font-bold text-secondary",children:as.filter(_=>_.type==="budget").length}),o.jsx("p",{className:"text-[10px] text-muted-foreground",children:e("Budget","Bajeti")})]}),o.jsxs(X,{className:"p-3 text-center",children:[o.jsx("p",{className:"text-2xl font-bold text-accent",children:S.length}),o.jsx("p",{className:"text-[10px] text-muted-foreground",children:e("Pending Events","Matukio Yanayosubiri")})]})]}),o.jsx("div",{className:"flex gap-2",children:[{key:"items",icon:Jn,label:e("Items","Vipengele")},{key:"events",icon:Xm,label:e("Events","Matukio")},{key:"ai",icon:Hn,label:e("AI Summary","Muhtasari wa AI")},{key:"verification",icon:Ft,label:e("Verify","Thibitisha")},{key:"guides",icon:La,label:e("Guides","Miongozo")},{key:"manifesto",icon:nl,label:e("Manifesto","Ilani")}].map(_=>o.jsxs("button",{onClick:()=>u(_.key),className:`chip ${l===_.key?"chip-active":""}`,children:[o.jsx(_.icon,{className:"mr-1 h-3 w-3"}),_.label]},_.key))}),l==="items"&&o.jsx("div",{className:"space-y-3",children:as.map(_=>o.jsx(X,{className:"p-3",children:o.jsx("div",{className:"flex items-start justify-between gap-2",children:o.jsxs("div",{className:"min-w-0",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[o.jsx(Vc,{stage:_.stage}),o.jsx("span",{className:"text-[10px] text-muted-foreground uppercase",children:_.type}),_.is_mock&&o.jsx("span",{className:"text-[9px] bg-warning/15 text-warning px-1.5 py-0.5 rounded",children:"MOCK"})]}),o.jsx("p",{className:"text-xs font-semibold",children:_.title_en}),o.jsxs("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:[e("Has summary:","Ina muhtasari:")," ",uu[_.id]?"â
":"â"]})]})})},_.id))}),l==="events"&&o.jsxs("div",{className:"space-y-3",children:[o.jsx("h2",{className:"text-sm font-bold",children:e("Pending Events","Matukio Yanayosubiri")}),S.length===0?o.jsx("p",{className:"text-xs text-muted-foreground py-4 text-center",children:e("No pending events","Hakuna matukio yanayosubiri")}):S.map(_=>o.jsxs(X,{className:"p-3",children:[o.jsx("p",{className:"text-xs font-semibold",children:_.title}),o.jsx("p",{className:"text-[10px] text-muted-foreground mt-1",children:_.description}),o.jsxs("p",{className:"text-[10px] text-muted-foreground",children:[_.county," · ",_.organizer]}),o.jsxs("div",{className:"mt-2 flex gap-2",children:[o.jsxs(Q,{size:"sm",variant:"default",className:"text-[10px] h-7",onClick:()=>
677t({title:"Approved (mock)"}),children:[o.jsx(oi,{className:"h-3 w-3"})," ",e("Approve","Kubali")]}),o.jsxs(Q,{size:"sm",variant:"destructive",className:"text-[10px] h-7",onClick:()=>t({title:"Rejected (mock)"}),children:[o.jsx(Qu,{className:"h-3 w-3"})," ",e("Reject","Kataa")]})]})]},_.id))]}),l==="ai"&&o.jsxs("div",{className:"space-y-3",children:[o.jsx("p",{className:"text-xs text-muted-foreground",children:e("Select an item to generate or regenerate its AI summary.","Chagua kipengele ili kutengeneza au kutengeneza upya muhtasari wake wa AI.")}),as.map(_=>o.jsxs(X,{className:"p-3 flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsx("p",{className:"text-xs font-semibold",children:_.title_en}),o.jsx("p",{className:"text-[10px] text-muted-foreground",children:uu[_.id]?`â
Generated ${new Date(uu[_.id].generated_at).toLocaleDateString()}`:"â No summary"})]}),o.jsxs(Q,{size:"sm",variant:"outline",className:"text-[10px] h-7",onClick:()=>t({title:e("AI generation triggered (mock)","Utengenezaji wa AI umeanzishwa (jaribio)")}),children:[o.jsx(Hn,{className:"h-3 w-3"}),uu[_.id]?e("Regenerate","Tengeneza upya"):e("Generate","Tengeneza")]})]},_.id))]}),l==="verification"&&o.jsx(Bte,{}),l==="guides"&&o.jsx(Kte,{ingesting:c,setIngesting:h,toast:t,t:e}),l==="manifesto"&&o.jsx(zte,{})]})},Bte=()=>{const{t:e}=Re(),{toast:t}=Zn(),{requests:n,loading:a,approveRequest:i,rejectRequest:r}=Kee();if(a)return o.jsx("div",{className:"flex justify-center py-8",children:o.jsx(Be,{className:"h-5 w-5 animate-spin text-primary"})});const s=n.filter(u=>u.status==="pending"),l=n.filter(u=>u.status!=="pending");return o.jsxs("div",{className:"space-y-3",children:[o.jsxs("h2",{className:"text-sm font-bold",children:[e("Pending Verification Requests","Maombi ya Uthibitishaji Yanayosubiri")," (",s.length,")"]}),s.length===0?o.jsx("p",{className:"text-xs text-muted-foreground text-center py-4",children:e("No pending requests","Hakuna maombi yanayosubiri")}):s.map(u=>o.jsxs(X,{className:"p-3 space-y-2",children:[o.jsx("p",{className:"text-xs font-semibold",children:u.email}),o.jsx("p",{className:"text-xs text-muted-foreground",children:u.message}),o.jsx("p",{className:"text-[10px] text-muted-foreground",children:new Date(u.created_at).toLocaleDateString()}),o.jsxs("div",{className:"flex gap-2",children:[o.jsxs(Q,{size:"sm",className:"text-[10px] h-7",onClick:async()=>{await i(u.id,u.user_id),t({title:e("Approved! User granted legal role.","Imeidhinishwa! Mtumiaji amepewa jukumu la kisheria.")})},children:[o.jsx(oi,{className:"h-3 w-3"})," ",e("Approve","Kubali")]}),o.jsxs(Q,{size:"sm",variant:"destructive",className:"text-[10px] h-7",onClick:async()=>{await r(u.id),t({title:e("Rejected","Imekataliwa")})},children:[o.jsx(Qu,{className:"h-3 w-3"})," ",e("Reject","Kataa")]})]})]},u.id)),l.length>0&&o.jsxs(o.Fragment,{children:[o.jsx("h2",{className:"text-sm font-bold mt-4",children:e("Handled","Zilizoshughulikiwa")}),l.map(u=>o.jsx(X,{className:"p-3 opacity-60",children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"text-xs font-semibold",children:u.email}),o.jsx("span",{className:`text-[10px] px-2 py-0.5 rounded-full ${u.status==="approved"?"bg-green-100 text-green-700":"bg-red-100 text-red-700"}`,children:u.status})]})},u.id))]})]})},Kte=({ingesting:e,setIngesting:t,toast:n,t:a})=>{const[i,r]=p.useState([]),[s,l]=p.useState(!1),[u,c]=p.useState(null);p.useEffect(()=>{te.from("public_guides").select("id",{count:"exact",head:!0}).eq("status","pending_editor").then(({count:m})=>{c(m??0)})},[]);const h=async()=>{t(!0),r([]);try{const{data:m,error:f}=await te.functions.invoke("ingest-civic-sources",{body:{}});if(f)throw f;r((m==null?void 0:m.results)||[]),n({title:a("Ingestion complete!","Uingizaji umekamilika!")});const{count:y}=await te.from("public_guides").select("id",{count:"exact",head:!0}).eq("status","pending_editor");c(y??0)}catch(m){n({title:m.message||"Ingestion failed",variant:"destructive"})}finally{t(!1)}},d=async()=>{l(!0);try{const{data:m,error:f}
677=await te.from("public_guides").select("id").eq("status","pending_editor");if(f)throw f;if(!m||m.length===0){n({title:a("No pending guides to publish","Hakuna miongozo inayosubiri kuchapishwa")});return}const y=m.map(x=>x.id),{error:g}=await te.from("public_guides").update({status:"published"}).in("id",y);if(g)throw g;c(0),n({title:a(`Published ${y.length} guides`,`Imechapisha miongozo ${y.length}`)})}catch(m){n({title:m.message||"Publish failed",variant:"destructive"})}finally{l(!1)}};return o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("h2",{className:"text-sm font-bold",children:a("Civic Source Ingestion","Uingizaji wa Vyanzo vya Kiraia")}),o.jsxs("div",{className:"flex gap-2",children:[o.jsxs(Q,{size:"sm",variant:"outline",className:"text-xs",onClick:d,disabled:s||u===0,children:[s&&o.jsx(Be,{className:"mr-1 h-3 w-3 animate-spin"}),o.jsx(oi,{className:"mr-1 h-3 w-3"}),a("Publish All","Chapisha Zote")," ",u!==null&&`(${u})`]}),o.jsxs(Q,{size:"sm",className:"text-xs",onClick:h,disabled:e,children:[e&&o.jsx(Be,{className:"mr-1 h-3 w-3 animate-spin"}),e?a("Ingesting...","Inaingiza..."):a("Ingest Sources","Ingiza Vyanzo")]})]})]}),o.jsx("p",{className:"text-[10px] text-muted-foreground",children:a("Scrapes civic participation pages and generates structured guides using AI. Guides will need editorial review before publishing.","Inachunguza kurasa za ushiriki wa kiraia na kutengeneza miongozo iliyoandaliwa kwa kutumia AI. Miongozo itahitaji mapitio ya wahariri kabla ya kuchapishwa.")}),i.length>0&&o.jsx("div",{className:"space-y-2",children:i.map((m,f)=>o.jsxs(X,{className:"p-3",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:`h-2 w-2 rounded-full ${m.status==="ingested"?"bg-green-500":m.status==="needs_review"?"bg-amber-500":"bg-red-500"}`}),o.jsx("span",{className:"text-[10px] truncate flex-1",children:m.url}),o.jsx("span",{className:"text-[10px] font-semibold",children:m.status})]}),m.error&&o.jsx("p",{className:"text-[10px] text-destructive mt-1",children:m.error})]},f))})]})};async function $te(e){if(!e)return!1;const{data:t,error:n}=await te.from("user_roles").select("role").eq("user_id",e).eq("role","admin").maybeSingle();return n?!1:!!t}const Ute=({allowedRoles:e,children:t})=>{const{user:n,loading:a}=Rt(),{t:i}=Re(),[r,s]=p.useState(!0),[l,u]=p.useState(!1);return p.useEffect(()=>{let c=!1;return(async()=>{if(a)return;if(!n){s(!1);return}let d=!1;for(const m of e)if(m==="admin"&&await $te(n.id)){d=!0;break}c||(u(d),s(!1))})(),()=>{c=!0}},[n,a,e]),a||n&&r?o.jsx("div",{className:"flex min-h-[60vh] items-center justify-center",children:o.jsx(Be,{className:"h-8 w-8 animate-spin text-primary"})}):n?l?o.jsx(o.Fragment,{children:t}):o.jsx("div",{className:"flex min-h-[60vh] items-center justify-center",children:o.jsxs(X,{className:"w-full max-w-sm p-6 space-y-4 text-center",children:[o.jsx(Ai,{className:"mx-auto h-10 w-10 text-destructive"}),o.jsx("h1",{className:"font-heading text-lg font-bold",children:i("403 · Access Denied","403 · Ufikiaji Umekataliwa")}),o.jsx("p",{className:"text-xs text-muted-foreground",children:i("You do not have permission to access this page.","Huna ruhusa ya kufikia ukurasa huu.")}),o.jsx(Ue,{to:"/home",children:o.jsx(Q,{size:"sm",className:"text-xs",children:i("Return Home","Rudi Nyumbani")})})]})}):(nn(i("Please sign in to continue.","Tafadhali ingia ili kuendelea.")),o.jsx(PT,{to:"/welcome",replace:!0}))},Vte=()=>{const{t:e,lang:t}=Re(),{user:n,loading:a}=Rt(),i=Mn(),{toast:r}=Zn(),[s,l]=p.useState(!1),[u,c]=p.useState(!0),[h,d]=p.useState([]),[m,f]=p.useState([]),[y,g]=p.useState([]),[x,w]=p.useState([]),[v,k]=p.useState(!0),[j,S]=p.useState(null),[_,T]=p.useState(""),[E,O]=p.useState(!1);p.useEffect(()=>{if(!n){c(!1);return}(async()=>{const{data:W}=await te.from("user_roles").select("role").eq("user_id",n.id).in("role",["legal","admin"]);l(!!(W&&W.length>0)),c(!1)})()},[n]);const A=async()=>{k(!0);const[z,W,B,M]=await Promise.all([te.from("items").select("id, title_en, title_sw, slug, stage, follower_count").order("follower_count",{ascending:!1}).limit(10),te.from("items").select("id, title_en, title_sw, slug, stage, click_count").order("click_count",{ascending:!1}).limit(10),te.from("forum_posts").select("*, items!inner(title_en, title_sw, slug)").order("created_at",{ascending:!1}).limit(20),te.from("consultations").select("*").order("created_at",{ascending:!1}).limit(50)]);d(z.data||[]),f(W.data||[]),g(B.data||[]),w(M.data||[]),k(!1)};p.useEffect(()=>{s&&A()},[s]);const R=async z=>{n&&(await te.from("consultations").update({lawyer_id:n.id,status:"claimed"}).eq("id",z),A())},F=async z=>{_.trim()&&(O(!0),await te.from("consultations").update({lawyer_response:_.trim(),status:"responded",responded_at:new Date().toISOString()}).eq("id",z),O(!1),S(null),T(""),r({title:e("Response sent","Jibu limetumwa")}),A())};if(a||u)return o.jsx("div",{className:"flex min-h-[60vh] items-center justify-center",children:o.jsx(Be,{className:"h-8 w-8 animate-spin text-primary"})});if(!n)return o.jsx("div",{className:"flex min-h-[60vh] items-center justify-center",children:o.jsxs(X,{className:"w-full max-w-sm p-6 text-center space-y-3",children:[o.jsx(Ft,{className:"mx-auto h-10 w-10 text-primary"}),o.jsx("h1",{className:"font-heading text-lg font-bold",children:e("Legal Professional Dashboard","Dashibodi ya Mtaalamu wa Sheria")}),o.jsx("p",{className:"text-xs text-muted-foreground",children:e("Sign in to access","Ingia ili kupata ufikiaji")}),o.jsx(Q,{size:"sm",onClick:()=>i("/welcome"),className:"text-xs",children:e("Sign In","Ingia")})]})});if(!s)return o.jsx("div",{className:"flex min-h-[60vh] items-center justify-center",children:o.jsxs(X,{className:"w-full max-w-sm p-6 text-center space-y-3",children:[o.jsx(Ai,{className:"mx-auto h-10 w-10 text-destructive"}),o.jsx("h1",{className:"font-heading text-lg font-bold",children:e("Access Restricted","Ufikiaji Umezuiwa")}),o.jsx("p",{className:"text-xs text-muted-foreground",children:e("This dashboard is for verified legal professionals.","Dashibodi hii ni kwa wataalamu wa sheria walioidhinishwa.")}),o.jsx(Q,{size:"sm",variant:"outline",onClick:()=>i("/settings"),className:"text-xs",children:e("Request Verification","Omba Uthibitishaji")})]})});if(v)return o.jsx("div",{className:"flex min-h-[60vh] items-center justify-center",children:o.jsx(Be,{className:"h-8 w-8 animate-spin text-primary"})});const Y=x.filter(z=>z.status==="open"),V=x.filter(z=>z.lawyer_id===n.id);return o.jsxs("div",{className:"space-y-5",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Ft,{className:"h-5 w-5 text-primary"}),o.jsx("h1",{className:"font-heading text-xl font-bold",children:e("Legal Dashboard","Dashibodi ya Kisheria")})]}),o.jsxs(Yc,{defaultValue:"consultations",className:"w-full",children:[o.jsxs(Rl,{className:"w-full grid grid-cols-3 text-xs",children:[o.jsxs(Gn,{value:"consultations",className:"text-xs gap-1",children:[o.jsx(wD,{className:"h-3 w-3"}),e("Inbox","Kikasha")," ",Y.length>0&&o.jsx("span",{className:"bg-destructive text-destructive-foreground text-[9px] px-1 rounded-full",children:Y.length})]}),o.jsxs(Gn,{value:"forum",className:"text-xs gap-1",children:[o.jsx(Ns,{className:"h-3 w-3"}),e("Forum","Jukwaa")]}),o.jsxs(Gn,{value:"trending",className:"text-xs gap-1",children:[o.jsx(Jh,{className:"h-3 w-3"}),e("Trending","Vuma")]})]}
677),o.jsxs(Ra,{value:"consultations",className:"space-y-4 mt-3",children:[o.jsxs("div",{children:[o.jsxs("h2",{className:"text-sm font-bold mb-2",children:[e("Open Grievances","Malalamiko Wazi")," (",Y.length,")"]}),Y.length===0?o.jsx("p",{className:"text-xs text-muted-foreground text-center py-6",children:e("No open grievances","Hakuna malalamiko wazi")}):o.jsx("div",{className:"space-y-2",children:Y.map(z=>o.jsxs(X,{className:"p-3 space-y-2",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("span",{className:"text-[10px] font-semibold",children:z.citizen_name}),o.jsx("span",{className:"text-[9px] bg-accent/20 text-accent-foreground px-1.5 py-0.5 rounded-full",children:z.category})]}),o.jsx("p",{className:"text-xs font-semibold",children:z.subject}),o.jsx("p",{className:"text-[11px] text-muted-foreground",children:z.description}),o.jsx("div",{className:"flex items-center gap-2",children:o.jsx("span",{className:"text-[10px] text-muted-foreground",children:bm(new Date(z.created_at),{addSuffix:!0})})}),j===z.id?o.jsxs("div",{className:"space-y-2 pt-1",children:[o.jsx(Ia,{value:_,onChange:W=>T(W.target.value),placeholder:e("Write your legal guidance...","Andika ushauri wako wa kisheria..."),className:"text-xs min-h-[80px]"}),o.jsxs("div",{className:"flex gap-2",children:[o.jsxs(Q,{size:"sm",onClick:()=>F(z.id),disabled:E||!_.trim(),className:"text-xs gap-1",children:[E?o.jsx(Be,{className:"h-3 w-3 animate-spin"}):o.jsx(Vn,{className:"h-3 w-3"}),e("Send Response","Tuma Jibu")]}),o.jsx(Q,{size:"sm",variant:"ghost",onClick:()=>{S(null),T("")},className:"text-xs",children:e("Cancel","Ghairi")})]})]}):o.jsxs(Q,{size:"sm",variant:"outline",onClick:()=>{R(z.id),S(z.id)},className:"text-xs gap-1",children:[o.jsx(Ns,{className:"h-3 w-3"}),e("Respond","Jibu")]})]},z.id))})]}),V.length>0&&o.jsxs("div",{children:[o.jsxs("h2",{className:"text-sm font-bold mb-2",children:[e("My Responses","Majibu Yangu")," (",V.length,")"]}),o.jsx("div",{className:"space-y-2",children:V.map(z=>o.jsxs(X,{className:"p-3 space-y-1 border-primary/20",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(oi,{className:"h-3 w-3 text-primary"}),o.jsx("span",{className:"text-[10px] font-semibold",children:z.citizen_name}),o.jsx("span",{className:`text-[9px] px-1.5 py-0.5 rounded-full ${z.status==="responded"?"bg-green-100 text-green-800":"bg-blue-100 text-blue-800"}`,children:z.status==="responded"?e("Responded","Imejibiwa"):e("Claimed","Imechukuliwa")})]}),o.jsx("p",{className:"text-xs font-semibold",children:z.subject}),z.lawyer_response&&o.jsx("p",{className:"text-[11px] text-muted-foreground line-clamp-2",children:z.lawyer_response}),z.status==="claimed"&&!z.lawyer_response&&j!==z.id&&o.jsxs(Q,{size:"sm",variant:"outline",onClick:()=>S(z.id),className:"text-xs gap-1",children:[o.jsx(Vn,{className:"h-3 w-3"}),e("Write Response","Andika Jibu")]}),j===z.id&&o.jsxs("div",{className:"space-y-2 pt-1",children:[o.jsx(Ia,{value:_,onChange:W=>T(W.target.value),placeholder:e("Write your legal guidance...","Andika ushauri wako wa kisheria..."),className:"text-xs min-h-[80px]"}),o.jsxs("div",{className:"flex gap-2",children:[o.jsxs(Q,{size:"sm",onClick:()=>F(z.id),disabled:E||!_.trim(),className:"text-xs gap-1",children:[E?o.jsx(Be,{className:"h-3 w-3 animate-spin"}):o.jsx(Vn,{className:"h-3 w-3"}),e("Send","Tuma")]}),o.jsx(Q,{size:"sm",variant:"ghost",onClick:()=>{S(null),T("")},className:"text-xs",children:e("Cancel","Ghairi")})]})]})]},z.id))})]})]}),o.jsx(Ra,{value:"forum",className:"space-y-2 mt-3",children:y.length===0?o.jsx("p",{className:"text-xs text-muted-foreground text-center py-6",children:e("No forum activity yet","Hakuna shughuli za jukwaa bado")}):y.slice(0,15).map(z=>{var W,B,M;return o.jsx(Ue,{to:`/item/${(W=z.items)==null?void 0:W.slug}`,children:o.jsxs(X,{className:`p-3 hover:bg-muted/50 transition-colors ${z.is_legal_guidance?"border-primary/30":""}`,children:[o.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[o.jsx("span",{className:"text-[10px] font-semibold",children:z.author_name}),z.is_legal_guidance&&o.jsx("span",{className:"text-[9px] bg-primary/10 text-primary px-1.5 py-0.5 rounded-full",children:e("Legal","Kisheria")}),o.jsx("span",{className:"text-[10px] text-muted-foreground",children:bm(new Date(z.created_at),{addSuffix:!0})})]}),o.jsx("p",{className:"text-xs text-foreground line-clamp-2",children:z.content}),o.jsxs("p",{className:"text-[10px] text-primary mt-1 truncate",children:["â ",t==="en"?(B=z.items)==null?void 0:B.title_en:(M=z.items)==null?void 0:M.title_sw]})]})},z.id)})}
677),o.jsxs(Ra,{value:"trending",className:"space-y-4 mt-3",children:[o.jsxs("div",{children:[o.jsxs("h2",{className:"font-heading text-sm font-bold flex items-center gap-2 mb-2",children:[o.jsx(Si,{className:"h-4 w-4 text-primary"}),e("Most Followed","Inayofuatiliwa Zaidi")]}),o.jsx("div",{className:"space-y-2",children:h.slice(0,5).map(z=>o.jsx(Ue,{to:`/item/${z.slug}`,children:o.jsxs(X,{className:"p-3 flex items-center justify-between hover:bg-muted/50 transition-colors",children:[o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsx("div",{className:"flex items-center gap-2 mb-0.5",children:o.jsx(Vc,{stage:z.stage})}),o.jsx("p",{className:"text-xs font-semibold truncate",children:t==="en"?z.title_en:z.title_sw})]}),o.jsxs("span",{className:"text-xs font-bold text-primary ml-2",children:[z.follower_count," ",o.jsx(Si,{className:"inline h-3 w-3"})]})]})},z.id))})]}),o.jsxs("div",{children:[o.jsxs("h2",{className:"font-heading text-sm font-bold flex items-center gap-2 mb-2",children:[o.jsx(Jh,{className:"h-4 w-4 text-accent"}),e("Most Clicked","Kubonyezwa Zaidi")]}),o.jsx("div",{className:"space-y-2",children:m.slice(0,5).map(z=>o.jsx(Ue,{to:`/item/${z.slug}`,children:o.jsxs(X,{className:"p-3 flex items-center justify-between hover:bg-muted/50 transition-colors",children:[o.jsx("p",{className:"text-xs font-semibold truncate flex-1",children:t==="en"?z.title_en:z.title_sw}),o.jsxs("span",{className:"text-xs font-bold text-accent ml-2",children:[z.click_count," ",e("clicks","mibofyo")]})]})},z.id))})]})]})]})]})},SI="/assets/kenya-map-touch-DbpShLKz.png",Hte=()=>{const{t:e}=Re(),t=Mn(),{user:n}=Rt(),{toast:a}=Zn(),[i,r]=p.useState("splash"),[s,l]=p.useState("citizen"),[u,c]=p.useState("signup"),[h,d]=p.useState(""),[m,f]=p.useState(""),[y,g]=p.useState(""),[x,w]=p.useState(!1),v=p.useRef(!1),[k,j]=p.useState(!1);p.useEffect(()=>{const A=window.location.hash;(A.includes("access_token")||A.includes("provider_token"))&&j(!0)},[]),p.useEffect(()=>{n&&k&&!v.current&&(v.current=!0,S(n.id))},[n,k]);const S=async A=>{if(localStorage.setItem("click-onboarded","true"),A){const{data:R}=await te.from("user_roles").select("role").eq("user_id",A).eq("role","legal").maybeSingle();if(R){t("/lawyer");return}}t("/home")},_=async()=>{if(n){const{data:{session:A}}=await te.auth.getSession();if(A){S(n.id);return}await te.auth.signOut()}r("auth")},T=async()=>{var A;if(!x){w(!0);try{if(u==="signup"){const{error:R}=await te.auth.signUp({email:h,password:m,options:{data:{full_name:y||h.split("@")[0]}}});if(R)throw R;a({title:e("Check your email to verify your account","Angalia barua pepe yako ili kuthibitisha akaunti yako")})}else{const{error:R,data:F}=await te.auth.signInWithPassword({email:h,password:m});if(R)throw R;S((A=F.user)==null?void 0:A.id)}}catch(R){a({title:R.message,variant:"destructive"})}finally{w(!1)}}},E=async()=>{const A=await _R.auth.signInWithOAuth("google",{redirect_uri:window.location.origin});A.error&&a({title:String(A.error),variant:"destructive"})},O={enter:{opacity:0,x:60},center:{opacity:1,x:0},exit:{opacity:0,x:-60}};return o.jsx("div",{className:"min-h-[85vh] flex flex-col items-center justify-center px-4",children:o.jsxs(Rv,{mode:"wait",children:[i==="splash"&&o.jsxs(Le.div,{variants:O,initial:"enter",animate:"center",exit:"exit",transition:{duration:.35},className:"flex flex-col items-center text-center space-y-6 max-w-sm w-full",children:[o.jsx(Le.div,{initial:{scale:.8,opacity:0}
677,animate:{scale:1,opacity:1},transition:{duration:.5,delay:.1},children:o.jsx("img",{src:SI,alt:e("CLICK logo showing a hand touching a map of Kenya","Nembo ya CLICK inayoonyesha mkono ukigusa ramani ya Kenya"),className:"w-64 h-64 object-contain rounded-2xl shadow-lg"})}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("h1",{className:"font-heading text-3xl font-extrabold text-foreground",children:e("CLICK â Civic Literacy for Kenyan Youth","CLICK â Elimu ya Uraia kwa Vijana wa Kenya")}),o.jsx("p",{className:"text-sm font-semibold text-primary italic",children:e("Before they decide, CLICK.","Kabla hawajaamua, CLICK.")})]}),o.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:e("Track bills, budgets and civic events in plain English and Swahili. Follow legislation, join public participation, and act before decisions that shape Kenya are made.","Fuatilia miswada, bajeti na matukio ya uraia kwa Kiingereza na Kiswahili rahisi. Fuata sheria, shiriki katika ushiriki wa umma, na chukua hatua kabla ya maamuzi yanayoiundaa Kenya kufanywa.")}),o.jsx("div",{className:"flex flex-col gap-3 w-full pt-2",children:o.jsxs(Q,{onClick:_,size:"lg",className:"w-full font-heading font-bold text-sm",children:[e("Get Started","Anza Sasa"),o.jsx(ts,{className:"ml-1 h-4 w-4"})]})}),o.jsx("p",{className:"text-[10px] text-muted-foreground pt-1",children:` 678`})]},"splash"),i==="auth"&&o.jsxs(Le.div,{variants:O,initial:"enter",animate:"center",exit:"exit",transition:{duration:.35},className:"w-full max-w-sm space-y-5",children:[o.jsxs("button",{onClick:()=>r("splash"),className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:["â ",e("Back","Rudi")]}),o.jsxs("div",{className:"text-center space-y-1",children:[o.jsx("h2",{className:"font-heading text-2xl font-bold text-foreground",children:e("I am a...","Mimi ni...")}),o.jsx("p",{className:"text-sm text-muted-foreground",children:e("Choose your role to personalize your experience.","Chagua jukumu lako ili kubinafsisha uzoefu wako.")})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[o.jsxs("button",{onClick:()=>l("citizen"),className:`rounded-xl border-2 p-4 text-center transition-all ${s==="citizen"?"border-primary bg-primary/10":"border-border bg-card hover:border-primary/30"}`,children:[o.jsx(ef,{className:`mx-auto h-8 w-8 mb-2 ${s==="citizen"?"text-primary":"text-muted-foreground"}`}),o.jsx("h3",{className:"font-heading text-sm font-bold",children:e("Citizen","Mwananchi")}),o.jsx("p",{className:"text-[10px] text-muted-foreground mt-1",children:e("Common Mwananchi","Mwananchi wa kawaida")})]}),o.jsxs("button",{onClick:()=>l("legal"),className:`rounded-xl border-2 p-4 text-center transition-all ${s==="legal"?"border-primary bg-primary/10":"border-border bg-card hover:border-primary/30"}`,children:[o.jsx(Ft,{className:`mx-auto h-8 w-8 mb-2 ${s==="legal"?"text-primary":"text-muted-foreground"}`}),o.jsx("h3",{className:"font-heading text-sm font-bold",children:e("Legal Professional","Mtaalamu wa Sheria")}),o.jsx("p",{className:"text-[10px] text-muted-foreground mt-1",children:e("Lawyer / Advocate","Wakili / Mtetezi")})]})]}),s==="legal"&&o.jsx("p",{className:"text-[10px] text-primary text-center",children:e("After signing up, request verification in Settings to access the Legal Dashboard.","Baada ya kujiandikisha, omba uthibitishaji katika Mipangilio kupata Dashibodi ya Kisheria.")}),o.jsxs(X,{className:"p-4 space-y-3",children:[o.jsxs(Q,{variant:"outline",className:"w-full text-sm",onClick:E,children:[o.jsxs("svg",{className:"mr-2 h-4 w-4",viewBox:"0 0 24 24",children:[o.jsx("path",{d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92a5.06 5.06 0 0 1-2.2 3.32v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.1z",fill:"#4285F4"}),o.jsx("path",{d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z",fill:"#34A853"}),o.jsx("path",{d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z",fill:"#FBBC05"}),o.jsx("path",{d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z",fill:"#EA4335"})]}),e("Sign in with Google","Ingia na Google")]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("div",{className:"h-px flex-1 bg-border"}),o.jsx("span",{className:"text-xs text-muted-foreground",children:e("or","au")}),o.jsx("div",{className:"h-px flex-1 bg-border"})]}),u==="signup"&&o.jsx(ft,{placeholder:e("Full name","Jina kamili"),value:y,onChange:A=>g(A.target.value)}),o.jsx(ft,{type:"email",placeholder:e("Email","Barua pepe"),value:h,onChange:A=>d(A.target.value)}),o.jsx(ft,{type:"password",placeholder:e("Password","Nenosiri"),value:m,onChange:A=>f(A.target.value)}),u==="signin"&&o.jsx("div",{className:"text-right",children:o.jsx("button",{type:"button",onClick:async()=>
678{if(!h){a({title:e("Enter your email first","Weka barua pepe yako kwanza"),variant:"destructive"});return}w(!0);try{const{error:A}=await te.auth.resetPasswordForEmail(h,{redirectTo:`${window.location.origin}/reset-password`});if(A)throw A;a({title:e("Check your email for a reset link","Angalia barua pepe yako kwa kiungo cha kuweka upya")})}catch(A){a({title:A.message,variant:"destructive"})}finally{w(!1)}},className:"text-[11px] text-primary hover:underline",children:e("Forgot password?","Umesahau nenosiri?")})}),o.jsxs(Q,{onClick:T,className:"w-full font-heading font-bold",disabled:x,children:[x&&o.jsx(Be,{className:"mr-1 h-4 w-4 animate-spin"}),u==="signup"?e("Sign Up","Jisajili"):e("Sign In","Ingia")]}),o.jsxs("p",{className:"text-center text-xs text-muted-foreground",children:[u==="signup"?e("Already have an account?","Tayari una akaunti?"):e("Don't have an account?","Huna akaunti?")," ",o.jsx("button",{onClick:()=>c(u==="signup"?"signin":"signup"),className:"text-primary underline",children:u==="signup"?e("Sign In","Ingia"):e("Sign Up","Jisajili")})]})]}),o.jsx("button",{onClick:()=>S(),className:"w-full text-xs text-muted-foreground hover:text-foreground underline underline-offset-2 transition-colors py-1",children:e("Browse as guest","Vinjari bila kujiandikisha")})]},"auth")]})})},Ui=(e=0)=>({initial:{opacity:0,y:14},animate:{opacity:1,y:0},transition:{delay:e,duration:.4}}),Wte=[{icon:y2,name_en:"Home",name_sw:"Nyumbani",desc_en:"Your dashboard. See your civic score, streak reminders, quick tools (Uko Kadi, Pick & Vote), Pesa Yangu shortcut, featured bills, and FAQs all in one place.",desc_sw:"Dashibodi yako. Tazama alama yako ya kiraia, vikumbusho, zana za haraka (Uko Kadi, Pick & Vote), njia ya mkato ya Pesa Yangu, miswada, na maswali mahali pamoja."},{icon:Jn,name_en:"Bills",name_sw:"Miswada",desc_en:'All proposed bills and amendments. Each card shows the current stage, an AI plain-language summary, youth-impact tags, and a "Simulate impact on my money" deep link to Pesa Yangu.',desc_sw:'Miswada yote inayopendekezwa. Kila kadi inaonyesha hatua, muhtasari wa AI, lebo za athari kwa vijana, na kiungo cha "Iga athari kwa pesa zangu".'},{icon:yl,name_en:"Budget",name_sw:"Bajeti",desc_en:"National budget proposals broken into plain language. See how allocations affect education, jobs, healthcare, and more.",desc_sw:"Mapendekezo ya bajeti ya kitaifa kwa lugha rahisi. Tazama jinsi mgawo unavyoathiri elimu, kazi, na afya."},{icon:Ss,name_en:"Pesa Yangu",name_sw:"Pesa Yangu",desc_en:"Your personal money simulator. Enter income, rent, food, transport and custom expenses (school fees, sacco, loans). Drag sliders for VAT, fuel, housing, PAYE and health to instantly see how proposed policies change your take-home. Signed-in users have their custom expenses synced across devices.",desc_sw:"Kiigaji chako cha pesa binafsi. Weka mapato na matumizi (ada za shule, sacco, mikopo). Sogeza vitelezi vya VAT, mafuta, nyumba, PAYE na afya uone jinsi sera mpya zinavyobadilisha pesa zako. Watumiaji walioingia wanahifadhi data kwenye vifaa vyote."},{icon:nl,name_en:"Pick & Vote (Manifesto Match)",name_sw:"Pick & Vote",desc_en:"Pick the issues that matter to you, then read candidate promises with names hidden. Your blind picks reveal which candidate truly matches your priorities â not their party.",desc_sw:"Chagua masuala muhimu kwako, kisha soma ahadi za wagombea bila majina. Chaguo lako litaonyesha mgombea anayelingana na vipaumbele vyako."},{icon:nl,name_en:"Uko Kadi? (Voter Registration)",name_sw:"Uko Kadi?",desc_en:"Find your nearest IEBC registration center, plan a visit time, and set reminders so you never miss the deadline.",desc_sw:"Pata kituo cha karibu cha IEBC, panga ziara, na weka vikumbusho."},{icon:Wn,name_en:"Civic Score & Leaderboard",name_sw:"Alama ya Kiraia",desc_en:"Earn points for civic actions â following bills, signing petitions, completing manifesto matches, attending events. Build daily streaks and climb the public leaderboard (toggle privacy in Settings).",desc_sw:"Pata pointi kwa vitendo vya kiraia â kufuatilia miswada, kusaini ombi, kukamilish
678a mechi, kuhudhuria matukio. Jenga mfululizo na panda chati."},{icon:Ns,name_en:"Haki AI Assistant",name_sw:"Msaidizi wa AI Haki",desc_en:"Chat with Haki â our bilingual civic AI assistant. Ask anything about bills, the Constitution, or your rights. Voice replies powered by ElevenLabs (sign-in required).",desc_sw:"Ongea na Haki â msaidizi wetu wa AI wa kiraia (inahitaji kuingia)."},{icon:Ft,name_en:"Ask a Lawyer",name_sw:"Uliza Wakili",desc_en:"Submit a private legal question to verified lawyers. Choose to remain anonymous. Responses come through your Ask Lawyer inbox.",desc_sw:"Wasilisha swali la kisheria kwa wakili waliothibitishwa. Chagua kubaki bila kutambulika."},{icon:Xm,name_en:"Events",name_sw:"Matukio",desc_en:"Browse verified civic events, public participation forums, and community actions near you. Filter by county and submit your own events.",desc_sw:"Vinjari matukio ya kiraia yaliyothibitishwa, vikao vya umma, na hatua za jamii. Chuja kwa kaunti."},{icon:ef,name_en:"My Feed",name_sw:"Yangu",desc_en:"Your personalized view based on bills you follow, categories you pick, and your county.",desc_sw:"Mtazamo wako wa kibinafsi kulingana na miswada unayofuatilia na kaunti yako."},{icon:v2,name_en:"Settings",name_sw:"Mipangilio",desc_en:"Choose your county, follow categories, switch among 6 Kenyan languages (English, Kiswahili, Kikuyu, Dholuo, Kalenjin, Kamba), toggle leaderboard privacy, and manage notifications.",desc_sw:"Chagua kaunti, fuatilia kategoria, badilisha lugha 6 za Kenya, badilisha faragha ya chati, na simamia arifa."}],qte=()=>{const{t:e,lang:t}=Re(),{toast:n}=Zn(),[a,i]=p.useState(""),[r,s]=p.useState(""),l=()=>{a.trim()&&(n({title:e("Report submitted","Ripoti imetumwa"),description:e("Thank you. We'll review this shortly.","Asante. Tutapitia hivi karibuni.")}),i(""))},u=()=>{r.trim()&&(n({title:e("Event submitted for review","Tukio limewasilishwa kwa mapitio"),description:e("Our team will review your submission.","Timu yetu itapitia uwasilishaji wako.")}),s(""))};return o.jsxs("div",{className:"space-y-8 pb-10",children:[o.jsxs(Le.div,{...Ui(),className:"flex items-center gap-3",children:[o.jsx(Ue,{to:"/welcome","aria-label":e("Back to welcome","Rudi kwenye karibu"),className:"rounded-lg p-2 text-muted-foreground hover:bg-muted transition-colors",children:o.jsx(tl,{className:"h-4 w-4"})}),o.jsxs("div",{children:[o.jsx("h1",{className:"font-heading text-xl font-bold text-foreground",children:e("Help & Support","Msaada na Usaidizi")}),o.jsx("p",{className:"text-xs text-muted-foreground",children:e("Everything you need to know about using CLICK","Kila kitu unachohitaji kujua kuhusu kutumia CLICK")})]})]}),o.jsxs(Le.section,{...Ui(.05),className:"space-y-3",children:[o.jsxs("h2",{className:"font-heading text-base font-bold text-foreground flex items-center gap-2",children:[o.jsx(La,{className:"h-4 w-4 text-primary"}),e("How to Use CLICK","Jinsi ya Kutumia CLICK")]}),o.jsx(If,{type:"single",collapsible:!0,className:"rounded-xl border border-border bg-card overflow-hidden",children:Wte.map((c,h)=>o.jsxs(Jc,{value:`guide-${h}`,className:"border-border px-4",children:[o.jsx(Qc,{className:"text-xs font-heading font-semibold text-foreground text-left",children:o.jsxs("span",{className:"flex items-center gap-2",children:[o.jsx(c.icon,{className:"h-4 w-4 text-primary"}),t==="en"?c.name_en:c.name_sw]})}),o.jsx(Xc,{className:"text-[11px] text-muted-foreground leading-relaxed",children:t==="en"?c.desc_en:c.desc_sw})]},h))})]}),o.jsxs(Le.section,{...Ui(.1),className:"space-y-3",children:[o.jsx("h2",{className:"font-heading text-base font-bold text-foreground",children:e("About CLICK","Kuhusu CLICK")}),o.jsxs(X,{className:"p-4 space-y-3",children:[o.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:e("CLICK â Civic Literacy & Information for Civic Knowledge â is built to empower Kenyan youth with early, accessible information about proposed laws and national budgets. Our mission is to bridge the gap between complex legislative processes and everyday understanding.","CLICK â Ujuzi wa Kiraia na Taarifa kwa Maarifa ya Kiraia â imejengwa kuwawezesha vijana w
678a Kenya kwa taarifa za mapema zinazoweza kupatikana kuhusu sheria zinazopendekezwa na bajeti za kitaifa. Dhamira yetu ni kuziba pengo kati ya michakato tata ya kisheria na uelewa wa kila siku.")}),o.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:e("By surfacing civic events and public participation opportunities, CLICK also helps users take meaningful action in their communities.","Kwa kuonyesha matukio ya kiraia na fursa za ushiriki wa umma, CLICK pia inasaidia watumiaji kuchukua hatua zenye maana katika jamii zao.")})]})]}),o.jsxs(Le.section,{...Ui(.15),className:"space-y-3",children:[o.jsxs("h2",{className:"font-heading text-base font-bold text-foreground flex items-center gap-2",children:[o.jsx(Ai,{className:"h-4 w-4 text-primary"}),e("Trust & Safety","Uaminifu na Usalama")]}),o.jsx(X,{className:"p-4 border-primary/20 bg-primary/5",children:o.jsx("p",{className:"text-xs text-foreground leading-relaxed",children:e("CLICK aims to make civic information easier to understand. Summaries are simplified for accessibility, but official source documents should always be consulted for full legal meaning. We link to all original sources and include confidence scores on AI-generated content.","CLICK inalenga kufanya taarifa za kiraia kuwa rahisi kueleweka. Muhtasari umerahisishwa kwa upatikanaji, lakini hati rasmi za chanzo zinapaswa kushauriwa kila wakati kwa maana kamili ya kisheria. Tunahusisha vyanzo vyote vya asili na tunajumuisha alama za kujiamini kwenye maudhui yanayotengenezwa na AI.")})})]}),o.jsxs(Le.section,{...Ui(.2),className:"space-y-3",children:[o.jsxs("h2",{className:"font-heading text-base font-bold text-foreground flex items-center gap-2",children:[o.jsx(b2,{className:"h-4 w-4 text-accent"}),e("Report an Issue","Ripoti Tatizo")]}),o.jsxs(X,{className:"p-4 space-y-3",children:[o.jsx("p",{className:"text-xs text-muted-foreground",children:e("Found incorrect information, a broken feature, or something else? Let us know.","Umepata taarifa isiyo sahihi, kipengele kilichovunjika, au kitu kingine? Tufahamishe.")}),o.jsx("textarea",{rows:3,value:a,onChange:c=>i(c.target.value),placeholder:e("Describe the issue...","Eleza tatizo..."),className:"w-full rounded-lg border border-input bg-background px-3 py-2 text-xs placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-primary/30 resize-none"}),o.jsxs(Q,{size:"sm",onClick:l,className:"text-xs",children:[o.jsx(Vn,{className:"h-3.5 w-3.5"}),e("Submit Report","Tuma Ripoti")]})]})]}),o.jsxs(Le.section,{...Ui(.25),className:"space-y-3",children:[o.jsxs("h2",{className:"font-heading text-base font-bold text-foreground flex items-center gap-2",children:[o.jsx(Xm,{className:"h-4 w-4 text-secondary"}),e("Submit an Event","Wasilisha Tukio")]}),o.jsxs(X,{className:"p-4 space-y-3",children:[o.jsx("p",{className:"text-xs text-muted-foreground",children:e("Know of a civic event, public hearing, or community action? Submit it for review.","Unajua tukio la kiraia, kikao cha umma, au hatua ya jamii? Wasilisha kwa mapitio.")}),o.jsx("input",{type:"text",value:r,onChange:c=>s(c.target.value),placeholder:e("Event title or brief description...","Jina la tukio au maelezo mafupi..."),className:"w-full rounded-lg border border-input bg-background px-3 py-2 text-xs placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-primary/30"}),o.jsxs(Q,{size:"sm",variant:"secondary",onClick:u,className:"text-xs",children:[o.jsx(Vn,{className:"h-3.5 w-3.5"}),e("Submit Event","Wasilisha Tukio")]})]})]}),o.jsxs(Le.section,{...Ui(.3),className:"space-y-3",children:[o.jsxs("h2",{className:"font-heading text-base font-bold text-foreground flex items-center gap-2",children:[o.jsx(py,{className:"h-4 w-4 text-primary"}),e("Contact & Support","Mawasiliano na Usaidizi")]}),o.jsxs(X,{className:"p-4 space-y-2",children:[o.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:e("For feedback, partnerships, or to volunteer with CLICK, reach out to us:","Kwa maoni, ushirikiano, au kujitolea na CLICK, wasiliana nasi:")}),o.jsxs("div",{className:"space-y-1.5 text-xs",children:[o.jsxs("p",{className:"flex items-center gap-2 text-foreground",children:[o.jsx(py,{className:"h-3.5 w-3.5 text-muted-foreground"}),"[email protected]"]}),o.jsxs("p",{className:"flex items-center gap-2 text-foreground",children:[o.jsx(Vn,{className:"h-3.5 w-3.5 text-muted-foreground"}),"WhatsApp: +254 700 000 000"]})]})]})]}),o.jsxs(Le.div,{...Ui(.35),className:"flex flex-col gap-2",children:[o.jsx(Ue,{to:"/welcome",children:o.jsxs(Q,{variant:"outline",className:"w-full text-xs",children:[o.jsx(tl,{className:"h-3.5 w-3.5"}),e("Back to Intro","Rudi kwenye Utangulizi")]})}),o.jsx(Ue,{to:"/",children:o.jsx(Q,{className:"w-full text-xs font-heading font-bold",children:e("Go to Home","Nenda Nyumbani")})})]})]})},oS="streak-reminder-dismissed-on",Gte=()=>{const{t:e}=Re(),{actions:t,loading:n,isAuthenticated:a,stats:i}=Uc(),[r,s]=p.useState(!1),l=new Date().toISOString().slice(0,10);if(p.useEffect(()=>{s(localStorage.getItem(oS)===l)},[l]),!a||n||r||t.some(d=>d.occurred_on===l))return null;const c=()=>{localStorage.setItem(oS,l),s(!0)},h=i.streak_days>0;return o.jsxs("div",{className:"rounded-2xl border border-primary/30 bg-primary/5 p-4 flex items-center gap-3",children:[o.jsx("div",{className:"shrink-0 h-10 w-10 rounded-full bg-primary/15 flex items-center justify-center",children:o.jsx(Xx,{className:"h-5 w-5 text-primary"})}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("p",{className:"font-semibold text-sm text-foreground",children:h?e(`Keep your ${i.streak_days}-day streak alive`,`Endeleza mfululizo wako wa siku ${i.streak_days}`):e("Start your civic streak today","Anzisha mfululizo wako wa uraia leo")}),o.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 line-clamp-2",children:e("You haven't earned any civic points yet today. Take one quick action to keep building your impact.","Bado hujapata pointi za uraia leo. Chukua hatua moja haraka kuendelea kujenga athari yako.")})]}),o.jsx(Q,{asChild:!0,size:"sm",className:"shrink-0 gap-1",children:o.jsxs(Ue,{to:"/civic-score",children:[e("View Score","Tazama Alama"),o.jsx(Kn,{className:"h-3.5 w-3.5"})]})}),o.jsx("button",{onClick:c,"aria-label":e("Dismiss","Funga"),className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors p-1",children:o.jsx(Rc,{className:"h-4 w-4"})})]})},Yte=e=>(e||[]).map(t=>({rank:Number(t.rank),display_name:t.display_name??"Anonymous Citizen",avatar_url:t.avatar_url??null,total_points:Number(t.total_points)||0,actions_count:Number(t.actions_count)||0,earned_action_keys:t.earned_action_keys||[],is_me:!!t.is_me,is_following:t.is_following??void 0,followee_token:t.followee_token??void 0})),lS=(e="public",t=!0,n=50)=>{const[a,i]=p.useState([]),[r,s]=p.useState(!1),[l,u]=p.useState(null),c=p.useCallback(async()=>
678{if(!t)return;s(!0),u(null);const{data:h,error:d}=e==="circle"?await te.rpc("get_circle_leaderboard"):await te.rpc("get_civic_leaderboard",{_limit:n});d?(u(d.message),i([])):i(Yte(h)),s(!1)},[e,t,n]);return p.useEffect(()=>{c()},[c]),{entries:a,loading:r,error:l,refresh:c}},Jte=async e=>{const{data:t,error:n}=await te.rpc("toggle_civic_follow",{_followee_token:e});return n?(console.warn("[civic] toggle_civic_follow failed",n.message),null):!!t},Qte=()=>{const{user:e}=Rt(),[t,n]=p.useState(!1),[a,i]=p.useState(!0),[r,s]=p.useState(!1),l=p.useCallback(async()=>{if(!e){i(!1);return}i(!0);const{data:c}=await te.from("profiles").select("leaderboard_public").eq("user_id",e.id).maybeSingle();n(!!(c!=null&&c.leaderboard_public)),i(!1)},[e]);p.useEffect(()=>{l()},[l]);const u=p.useCallback(async c=>{if(!e)return!1;s(!0);const{error:h}=await te.from("profiles").upsert({user_id:e.id,leaderboard_public:c},{onConflict:"user_id"});return h||n(c),s(!1),!h},[e]);return{optedIn:t,loading:a,saving:r,setOptIn:u}},Xte=()=>{const{user:e}=Rt(),[t,n]=p.useState(null),[a,i]=p.useState(0),[r,s]=p.useState(!0);return p.useEffect(()=>{let l=!1;if(!e){s(!1);return}return s(!0),te.rpc("get_civic_leaderboard",{_limit:200}).then(({data:u})=>{if(l)return;const c=u||[];i(c.length);const h=c.find(d=>d.is_me);n(h?Number(h.rank):null),s(!1)}),()=>{l=!0}},[e]),{rank:t,total:a,loading:r}},Zte=Qm("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Ze({className:e,variant:t,...n}){return o.jsx("div",{className:ce(Zte({variant:t}),e),...n})}const ene=()=>{const{t:e,lang:t}=Re(),n=Mn(),{stats:a,loading:i,isAuthenticated:r}=Uc(),{rank:s,total:l}=Xte(),{url:u,displayName:c}=wf();if(!r||i)return null;const h=av(a.total_points),d=iP(a.total_points),m=d?Math.min(100,Math.round((a.total_points-h.pointsRequired)/(d.pointsRequired-h.pointsRequired)*100)):100,f=d?d.pointsRequired-a.total_points:0,y=d?t==="en"?d.title_en:d.title_sw:null;return o.jsxs("button",{type:"button",onClick:()=>n("/civic-score"),className:"w-full text-left rounded-2xl border border-primary/30 bg-card hover:bg-muted/50 transition-colors p-4 flex items-center gap-3 group","aria-label":e("Open Civic Score","Fungua Alama ya Uraia"),children:[u?o.jsx(zs,{name:c,url:u,className:"h-11 w-11 shrink-0",fallbackTextClass:"text-sm"}):o.jsx("div",{className:"shrink-0 h-11 w-11 rounded-xl bg-primary/15 flex items-center justify-center",children:o.jsx(Wn,{className:"h-5 w-5 text-primary"})}),o.jsxs("div",{className:"flex-1 min-w-0 space-y-1.5",children:[o.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[o.jsxs("div",{className:"flex items-baseline gap-1",children:[o.jsx("span",{className:"font-heading text-lg font-extrabold text-foreground leading-none",children:a.total_points}),o.jsx("span",{className:"text-[10px] uppercase tracking-wider text-muted-foreground",children:e("pts","pti")})]}),o.jsxs("div",{className:"flex items-center gap-1 text-xs text-foreground",children:[o.jsx(Xx,{className:"h-3.5 w-3.5 text-secondary"}),o.jsx("span",{className:"font-bold",children:a.streak_days}),o.jsx("span",{className:"text-muted-foreground",children:e("day streak","siku mfululizo")})]}),s!==null&&o.jsxs(Ze,{variant:"secondary",className:"h-5 px-1.5 text-[10px] gap-1 font-bold",children:[o.jsx(Wn,{className:"h-3 w-3"}),"#",s," ",e("of","kati ya")," ",l]})]}),d?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"h-1.5 w-full rounded-full bg-muted overflow-hidden",children:o.jsx("div",{className:"h-full bg-primary transition-all",style:{width:`${m}%`}})}),o.jsx("p",{className:"text-[10px] text-muted-foreground line-clamp-1",children:e(`${f} pts to ${y}`,`Pti ${f} hadi ${y}`)})]}):o.jsx("p",{className:"text-[10px] text-muted-foreground",children:e("Top milestone reached","Umefika hatua ya juu")})]}),o.jsx(Kn,{className:"h-4 w-4 text-muted-foreground shrink-0 group-hover:text-foreground transition-colors"})]})},tne="/assets/kenya-youth-march-DxCv_1sO.jpeg",nne="/assets/kenya-digital-youth-CSZPwzfQ.jpeg",ane="/assets/haki-icon-Fq9W6G72.jpeg",fg={hidden:{opacity:0,y:14},visible:e=>({opacity:1,y:0,transition:{delay:e*.08,duration:.4}})},ine=()=>{const{t:e,lang:t}=Re(),n=Mn(),{data:a=[]}=iv(),[i,r]=p.useState(-1),s=i>
678=0,l=[{id:"tour-quick",title_en:"Quick Tools",title_sw:"Zana za Haraka",desc_en:"Register to vote, match candidates to your priorities, and check your civic score.",desc_sw:"Jiandikishe kupiga kura, linganisha wagombea, na angalia alama yako ya kiraia."},{id:"tour-how",title_en:"How It Works",title_sw:"Jinsi Inavyofanya Kazi",desc_en:"Three simple steps: Browse, Understand, Act.",desc_sw:"Hatua tatu rahisi: Vinjari, Elewa, Chukua hatua."},{id:"tour-features",title_en:"Why CLICK?",title_sw:"Kwa Nini CLICK?",desc_en:"See bills early, get plain-language summaries, and chat with Haki â your AI civic assistant.",desc_sw:"Ona miswada mapema, pata muhtasari rahisi, na ongea na Haki â msaidizi wako wa AI."},{id:"tour-money",title_en:"Pesa Yangu",title_sw:"Pesa Yangu",desc_en:"Simulate how new bills, taxes, and policies hit YOUR monthly budget.",desc_sw:"Iga jinsi miswada mipya, ushuru, na sera vinavyoathiri bajeti YAKO ya kila mwezi."},{id:"tour-bills",title_en:"Featured Bills",title_sw:"Miswada Iliyoangaziwa",desc_en:"Tap any bill to read the AI briefing, follow it, and join the discussion.",desc_sw:"Bonyeza mswada wowote kusoma muhtasari wa AI, ufuatilie, na ujiunge na mazungumzo."}],u=p.useCallback(()=>{r(0),setTimeout(()=>{var x;(x=document.getElementById("tour-quick"))==null||x.scrollIntoView({behavior:"smooth",block:"center"})},100)},[]),c=p.useCallback(()=>{const x=i+1;if(x>=l.length){r(-1),window.scrollTo({top:0,behavior:"smooth"});return}r(x),setTimeout(()=>{var w;(w=document.getElementById(l[x].id))==null||w.scrollIntoView({behavior:"smooth",block:"center"})},100)},[i,l]),h=a.filter(x=>x.type==="bill").slice(0,3),m=[{value:a.filter(x=>x.type==="bill").length||"50+",label_en:"Bills Tracked",label_sw:"Miswada",icon:Jn},{value:"6",label_en:"Languages",label_sw:"Lugha",icon:kD},{value:"47",label_en:"Counties",label_sw:"Kaunti",icon:Pc}],f=[{icon:Zm,title_en:"See Early",title_sw:"Ona Mapema",desc_en:"Access bills at draft stage â before they become law.",desc_sw:"Fikia miswada katika hatua ya rasimu."},{icon:_2,title_en:"Understand Fast",title_sw:"Elewa Haraka",desc_en:"AI plain-language summaries in 6 Kenyan languages.",desc_sw:"Muhtasari wa lugha rahisi katika lugha 6 za Kenya."},{icon:Ss,title_en:"Pesa Yangu",title_sw:"Pesa Yangu",desc_en:"Simulate how bills & taxes hit your monthly budget.",desc_sw:"Iga jinsi miswada na ushuru vinavyoathiri bajeti yako."},{icon:nl,title_en:"Pick & Vote",title_sw:"Pick & Vote",desc_en:"Match candidate manifestos to your priorities â blind.",desc_sw:"Linganisha ahadi za wagombea na vipaumbele vyako."},{icon:Ns,title_en:"Ask Haki AI",title_sw:"Uliza Haki AI",desc_en:"Chat with our bilingual civic assistant anytime.",desc_sw:"Ongea na msaidizi wetu wa AI wa kiraia wakati wowote."},{icon:Wn,title_en:"Civic Score",title_sw:"Alama ya Kiraia",desc_en:"Earn points for civic actions and climb the leaderboard.",desc_sw:"Pata pointi kwa vitendo vya kiraia na panda chati."}],y=[{num:"01",title_en:"Browse",title_sw:"Vinjari",desc_en:"Explore bills, budgets, and candidate manifestos.",desc_sw:"Chunguza miswada, bajeti, na ahadi za wagombea."},{num:"02",title_en:"Understand",title_sw:"Elewa",desc_en:"Read AI summaries and simulate the impact on your money.",desc_sw:"Soma muhtasari wa AI na iga athari kwa pesa zako."},{num:"03",title_en:"Act",title_sw:"Chukua Hatua",desc_en:"Follow bills, sign petitions, attend events, vote.",desc_sw:"Fuatilia miswada, saini ombi, hudhuria matukio, piga kura."}],g=[{q_en:"What is CLICK?",q_sw:"CLICK ni nini?",a_en:"CLICK helps Kenyan youth (18â35) understand national bills, budgets, and candidate manifestos â in plain language, before decisions are made.",a_sw:"CLICK inasaidia vijana wa Kenya (18â35) kuelewa miswada, bajeti, na ahadi za wagombea â kwa lugha rahisi, kabla ya maamuzi."},{q_en:"What is Pesa Yangu?",q_sw:"Pesa Yangu ni nini?",a_en:"A personal money simulator. Enter your income and expenses, then see how proposed VAT, fuel, housing, PAYE or health changes affect your take-home â live. Custom expenses sync to your account.",a_sw:"Kiigaji cha pesa zako binafsi. Weka mapato na matumizi, kisha uone jinsi mabadiliko ya VAT, mafuta, nyumba, PAYE au afya yanavyoathiri pesa zako â moja kwa moja."},{q_en:"What is Pick & Vote (Manifesto Match)?",q_sw:"Pick & Vote ni nini?",a_en:"Pick the issues you care about, then read candidate promises with names hidden. Your blind picks reveal which candidate truly matches your priorities.",a_sw:"Chagua masuala yanayokuhusu, kisha soma ahadi bila majina. Chaguo lako la kipofu litaonyesha mgombea anayelingana na vipaumbele vyako."},{q_en:"What is Civic Score?",q_sw:"Alama ya Kiraia ni nini?",a_en:"You earn points for civic actions â following bills, signing petitions, completing manifesto matches, attending events. Build streaks and climb the leaderboard.",a_sw:"Unapata pointi kwa vitendo vya kiraia â kufuatilia miswada, kusaini ombi, kukamilish
678a mechi, kuhudhuria matukio."},{q_en:"Who is Haki?",q_sw:"Haki ni nani?",a_en:"Haki is our bilingual AI civic assistant. Ask any question about bills, the Constitution, or your rights â voice or text.",a_sw:"Haki ni msaidizi wetu wa AI wa kiraia. Uliza swali lolote kuhusu miswada, Katiba, au haki zako â sauti au maandishi."},{q_en:"Where does CLICK get its info?",q_sw:"CLICK inapata taarifa wapi?",a_en:"From official sources: Parliament Bills Tracker, Kenya Law, National Treasury, IEBC, and Kenya Gazette. Every summary links back to the original.",a_sw:"Kutoka vyanzo rasmi: Bunge, Sheria ya Kenya, Hazina, IEBC, na Kenya Gazette."},{q_en:"Is CLICK reliable?",q_sw:"Je, CLICK inategemeka?",a_en:"AI summaries include confidence scores and link to primary sources. For legal advice, use Ask a Lawyer to reach a verified professional.",a_sw:"Muhtasari wa AI una alama za kujiamini na unahusisha vyanzo rasmi. Kwa ushauri wa kisheria, tumia Uliza Wakili."},{q_en:"Do I need an account?",q_sw:"Je, nahitaji akaunti?",a_en:"You can browse without one. Sign in to follow bills, save Pesa Yangu across devices, earn civic points, and join discussions.",a_sw:"Unaweza kuvinjari bila akaunti. Ingia ili kufuatilia miswada, kuhifadhi Pesa Yangu, na kupata pointi."},{q_en:"Which languages are supported?",q_sw:"Lugha zipi zinatumika?",a_en:"English, Kiswahili, Kikuyu, Dholuo, Kalenjin, and Kamba. Toggle anytime from the header.",a_sw:"Kiingereza, Kiswahili, Kikuyu, Dholuo, Kalenjin, na Kikamba."}];return o.jsxs("div",{className:"space-y-6 pb-10",children:[o.jsx(Gte,{}),o.jsx(ene,{}),o.jsxs(Le.section,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{duration:.5},className:"relative overflow-hidden rounded-3xl p-6 text-primary-foreground shadow-xl",style:{backgroundImage:"linear-gradient(135deg, hsl(var(--primary)) 0%, hsl(var(--primary) / 0.85) 50%, hsl(152 70% 22%) 100%)"},children:[o.jsx("img",{src:tne,alt:"",width:800,height:600,className:"absolute inset-0 w-full h-full object-cover opacity-25 pointer-events-none select-none mix-blend-overlay"}),o.jsx("div",{className:"absolute -right-10 -top-10 h-40 w-40 rounded-full bg-secondary/30 blur-3xl"}),o.jsx("div",{className:"absolute -left-8 -bottom-8 h-32 w-32 rounded-full bg-primary-foreground/10 blur-2xl"}),o.jsxs("div",{className:"relative space-y-4",children:[o.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full bg-primary-foreground/15 backdrop-blur-sm px-3 py-1 text-[10px] font-bold uppercase tracking-wider border border-primary-foreground/20",children:[o.jsx(Hn,{className:"h-3 w-3 text-secondary"}),e("Civic Literacy & Information for Civic Knowledge","Ujuzi wa Kiraia na Taarifa kwa Maarifa ya Kiraia")]}),o.jsxs("h1",{className:"font-heading text-3xl font-extrabold leading-[1.05] tracking-tight",children:[e("Before they decide,","Kabla hawajaamua,"),o.jsx("br",{}),o.jsx("span",{className:"inline-block text-secondary-foreground",style:{filter:"drop-shadow(0 2px 10px hsl(var(--secondary) / 0.6))"},children:"CLICK."})]}),o.jsx("p",{className:"text-sm max-w-sm leading-relaxed text-primary-foreground/90 font-bold",children:e("Understand bills and budgets before they become law â in your language. Built for Kenyan youth.","Elewa miswada na bajeti kabla hayajawa sheria â kwa lugha yako. Kwa vijana wa Kenya.")}),o.jsxs("div",{className:"flex flex-wrap gap-2",children:[o.jsxs(Q,{onClick:()=>n("/bills"),variant:"secondary",className:"font-heading font-bold text-xs h-10 shadow-md hover:shadow-lg transition-shadow",children:[e("Explore Bills","Chunguza Miswada")," ",o.jsx(Kn,{className:"ml-1 h-3.5 w-3.5"})]}),o.jsx(Q,{onClick:u,variant:"outline",className:"font-heading font-bold text-xs h-10 border-primary-foreground/40 text-primary-foreground bg-primary-foreground/10 backdrop-blur-sm hover:bg-primary-foreground/20",children:e("Take the Tour","Chukua Ziara")})]})]}),o.jsx("div",{className:"relative mt-5 grid grid-cols-3 gap-2",children:m.map((x,w)=>o.jsxs("div",{className:"rounded-xl bg-primary-foreground/15 backdrop-blur-md border border-primary-foreground/20 px-2 py-2.5 text-center",children:[o.jsxs("div",{className:"flex items-center justify-center gap-1",children:[o.jsx(x.icon,{className:"h-3 w-3 opacity-70"}),o.jsx("p",{className:"font-heading text-lg font-extrabold",children:x.value})]}),o.jsx("p",{className:"text-[9px] opacity-80 mt-0.5",children:t==="en"?x.label_en:x.label_sw})]},w))})]}),o.jsxs(Le.section,{id:"tour-quick",initial:{opacity:0,y:8}
678,animate:{opacity:1,y:0},transition:{delay:.15},className:"grid gap-3 sm:grid-cols-2",children:[o.jsxs("button",{type:"button",onClick:()=>n("/uko-kadi"),className:"cursor-pointer rounded-2xl border border-secondary/30 bg-secondary/10 p-4 flex items-center gap-3 hover:bg-secondary/20 transition-colors text-left",children:[o.jsx("div",{className:"flex h-11 w-11 shrink-0 items-center justify-center rounded-xl bg-secondary/20",children:o.jsx(nl,{className:"h-5 w-5 text-secondary"})}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("h3",{className:"font-heading text-sm font-extrabold text-foreground",children:e("Uko Kadi? Register to Vote","Uko Kadi? Jiandikishe Kupiga Kura")}),o.jsx("p",{className:"text-[10px] text-muted-foreground leading-snug",children:e("Find your nearest IEBC center, plan your visit, and set reminders.","Pata kituo cha karibu cha IEBC, panga ziara yako, weka vikumbusho.")})]}),o.jsx(ts,{className:"h-4 w-4 text-muted-foreground shrink-0"})]}),o.jsxs("button",{type:"button",onClick:()=>n("/manifesto-match"),className:"cursor-pointer rounded-2xl border border-primary/30 bg-primary/10 p-4 flex items-center gap-3 hover:bg-primary/20 transition-colors text-left",children:[o.jsx("div",{className:"flex h-11 w-11 shrink-0 items-center justify-center rounded-xl bg-primary/20",children:o.jsx(Hn,{className:"h-5 w-5 text-primary"})}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("h3",{className:"font-heading text-sm font-extrabold text-foreground",children:e("Pick & Vote","Pick & Vote")}),o.jsx("p",{className:"text-[10px] text-muted-foreground leading-snug",children:e("Compare candidate promises blindly, then see who matches your priorities.","Linganisha ahadi za wagombea bila kuona majina, kisha uone anayelingana na vipaumbele vyako.")})]}),o.jsx(ts,{className:"h-4 w-4 text-muted-foreground shrink-0"})]})]}),o.jsxs("section",{id:"tour-how",className:"space-y-3",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("h2",{className:"font-heading text-base font-bold text-foreground flex items-center gap-2",children:[o.jsx(bD,{className:"h-4 w-4 text-primary"}),e("How It Works","Jinsi Inavyofanya Kazi")]}),o.jsx("img",{src:SI,alt:"",loading:"lazy",width:800,height:512,className:"h-12 w-auto object-contain"})]}),o.jsx("div",{className:"grid grid-cols-3 gap-2",children:y.map((x,w)=>o.jsxs(Le.div,{custom:w,variants:fg,initial:"hidden",animate:"visible",className:"rounded-xl border border-border bg-card p-3 text-center space-y-1",children:[o.jsx("div",{className:"mx-auto flex h-9 w-9 items-center justify-center rounded-lg bg-primary/10",children:o.jsx("span",{className:"font-heading text-sm font-extrabold text-primary",children:x.num})}),o.jsx("h3",{className:"font-heading text-xs font-bold text-foreground",children:t==="en"?x.title_en:x.title_sw}),o.jsx("p",{className:"text-[9px] text-muted-foreground leading-snug",children:t==="en"?x.desc_en:x.desc_sw})]},w))})]}),o.jsxs("section",{id:"tour-features",className:"relative overflow-hidden rounded-2xl bg-muted/50 border border-border p-4 space-y-3",children:[o.jsx("img",{src:nne,alt:"",loading:"lazy",width:512,height:512,className:"absolute -right-6 -bottom-4 w-28 opacity-20 pointer-events-none select-none rounded-xl"}),o.jsxs("h2",{className:"font-heading text-base font-bold text-foreground flex items-center gap-2 relative z-10",children:[o.jsx(Hn,{className:"h-4 w-4 text-primary"}),e("Why CLICK?","Kwa Nini CLICK?")]}),o.jsx("div",{className:"grid grid-cols-2 gap-2 relative z-10",children:f.map((x,w)=>o.jsxs(Le.div,{custom:w,variants:fg,initial:"hidden",animate:"visible",className:"rounded-xl bg-card border border-border p-3 flex items-start gap-2.5",children:[o.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-primary/10",children:o.jsx(x.icon,{className:"h-4 w-4 text-primary"})}),o.jsxs("div",{className:"min-w-0",children:[o.jsx("h3",{className:"font-heading text-[11px] font-bold text-foreground",children:t==="en"?x.title_en:x.title_sw}),o.jsx("p",{className:"text-[9px] text-muted-foreground leading-snug",children:t==="en"?x.desc_en:x.desc_sw})]})]},w))})]}),o.jsx(Le.section,{id:"tour-money",initial:{opacity:0,y:8}
678,animate:{opacity:1,y:0},transition:{delay:.18},children:o.jsxs("button",{type:"button",onClick:()=>n("/my-money"),className:"w-full text-left rounded-2xl border border-accent/30 bg-gradient-to-br from-accent/15 via-accent/5 to-transparent p-4 flex items-center gap-3 hover:from-accent/25 transition-colors",children:[o.jsx("div",{className:"flex h-12 w-12 shrink-0 items-center justify-center rounded-xl bg-accent/20",children:o.jsx(Ss,{className:"h-6 w-6 text-accent"})}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("h3",{className:"font-heading text-sm font-extrabold text-foreground",children:e("Pesa Yangu â How bills hit your wallet","Pesa Yangu â Jinsi miswada inavyogusa pochi yako")}),o.jsx("p",{className:"text-[10px] text-muted-foreground leading-snug",children:e("Enter your income & expenses, then drag sliders to see VAT, fuel and PAYE changes â live.","Weka mapato na matumizi, kisha sogeza vitelezi kuona mabadiliko ya VAT, mafuta na PAYE â moja kwa moja.")})]}),o.jsx(ts,{className:"h-4 w-4 text-muted-foreground shrink-0"})]})}),h.length>0&&o.jsxs("section",{id:"tour-bills",className:"space-y-3",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("h2",{className:"font-heading text-base font-bold text-foreground flex items-center gap-2",children:[o.jsx(Jn,{className:"h-4 w-4 text-primary"}),e("Featured Bills","Miswada Iliyoangaziwa")]}),o.jsx("img",{src:ane,alt:"",loading:"lazy",width:512,height:512,className:"h-10 w-10 object-contain opacity-80 rounded-full"})]}),o.jsx("div",{className:"space-y-2",children:h.map((x,w)=>o.jsx(Le.div,{custom:w,variants:fg,initial:"hidden",animate:"visible",children:o.jsx(X,{className:"p-3 cursor-pointer hover:bg-muted/50 transition-colors",onClick:()=>n(`/item/${x.slug}`),children:o.jsxs("div",{className:"flex items-start justify-between gap-2",children:[o.jsxs("div",{className:"flex-1 min-w-0 space-y-1",children:[o.jsx(Vc,{stage:x.stage}),o.jsx("h3",{className:"font-heading text-xs font-bold text-foreground leading-snug line-clamp-2",children:t==="en"?x.title_en:x.title_sw||x.title_en}),x.introduced_date&&o.jsxs("p",{className:"text-[9px] text-muted-foreground",children:[e("Introduced","Ilianzishwa"),": ",x.introduced_date]})]}),o.jsx(ts,{className:"h-4 w-4 text-muted-foreground mt-1 shrink-0"})]})})},x.id))}),o.jsxs(Q,{variant:"outline",className:"w-full text-xs font-heading font-bold h-9",onClick:()=>n("/bills"),children:[e("View All Bills","Tazama Miswada Yote")," ",o.jsx(Kn,{className:"ml-1 h-3.5 w-3.5"})]})]}),o.jsxs("section",{className:"space-y-3",children:[o.jsxs("h2",{className:"font-heading text-base font-bold text-foreground flex items-center gap-2",children:[o.jsx(m2,{className:"h-4 w-4 text-primary"}),e("FAQ","Maswali")]}),o.jsx(If,{type:"single",collapsible:!0,className:"rounded-xl border border-border bg-card overflow-hidden",children:g.map((x,w)=>o.jsxs(Jc,{value:`faq-${w}`,className:"border-border px-3",children:[o.jsx(Qc,{className:"text-[11px] font-heading font-semibold text-foreground text-left py-3",children:t==="en"?x.q_en:x.q_sw}),o.jsx(Xc,{className:"text-[10px] text-muted-foreground leading-relaxed pb-3",children:t==="en"?x.a_en:x.a_sw})]},w))})]}),o.jsxs(Le.section,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{delay:.2},className:"relative overflow-hidden rounded-2xl bg-primary p-5 text-primary-foreground text-center space-y-3",children:[o.jsx("div",{className:"absolute -left-6 -top-6 h-20 w-20 rounded-full bg-primary-foreground/5"}),o.jsx("div",{className:"absolute -right-6 -bottom-6 h-20 w-20 rounded-full bg-primary-foreground/5"}),o.jsx("img",{src:Lv,alt:"",loading:"lazy",width:512,height:512,className:"absolute inset-0 w-full h-full object-cover opacity-15 pointer-events-none select-none"}),o.jsx("h2",{className:"font-heading text-lg font-bold",children:e("Ready to stay informed?","Uko tayari kuwa na taarifa?")}),o.jsx("p",{className:"text-[11px] opacity-80 max-w-xs mx-auto leading-relaxed",children:e("Join thousands of Kenyan youth tracking bills and budgets that shape your future.","Jiunge na maelfu ya vijana w
678a Kenya wanaofuatilia miswada na bajeti.")}),o.jsxs(Q,{onClick:()=>n("/bills"),variant:"secondary",className:"font-heading font-bold text-xs h-9",children:[e("Start Exploring","Anza Kuchunguza")," ",o.jsx(Kn,{className:"ml-1 h-4 w-4"})]})]}),o.jsx(Rv,{children:s&&i<l.length&&o.jsx(Le.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-x-0 bottom-0 z-50 p-4 pb-20",children:o.jsxs(X,{className:"mx-auto max-w-sm p-4 space-y-2 shadow-lg border-primary/30 bg-card",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("p",{className:"text-[10px] text-muted-foreground font-medium",children:[i+1," / ",l.length]}),o.jsxs("button",{onClick:()=>r(-1),className:"text-[10px] text-muted-foreground hover:text-foreground",children:[e("Skip","Ruka")," â"]})]}),o.jsx("h3",{className:"font-heading text-sm font-bold text-primary",children:t==="en"?l[i].title_en:l[i].title_sw}),o.jsx("p",{className:"text-xs text-muted-foreground",children:t==="en"?l[i].desc_en:l[i].desc_sw}),o.jsxs(Q,{size:"sm",className:"w-full text-xs",onClick:c,children:[i===l.length-1?e("Finish","Maliza"):e("Next","Ifuatayo")," ",o.jsx(Kn,{className:"ml-1 h-3 w-3"})]})]})})})]})},rne=()=>{const{t:e}=Re(),t=Mn(),{toast:n}=Zn(),[a,i]=p.useState(""),[r,s]=p.useState(""),[l,u]=p.useState(!1),[c,h]=p.useState(!1),[d,m]=p.useState(!1);p.useEffect(()=>{const{data:{subscription:y}}=te.auth.onAuthStateChange(g=>{g==="PASSWORD_RECOVERY"&&m(!0)});return window.location.hash.includes("type=recovery")&&m(!0),()=>y.unsubscribe()},[]);const f=async()=>{if(a!==r){n({title:e("Passwords do not match","Nenosiri hazifanani"),variant:"destructive"});return}if(a.length<6){n({title:e("Password must be at least 6 characters","Nenosiri lazima liwe na herufi 6 au zaidi"),variant:"destructive"});return}u(!0);try{const{error:y}=await te.auth.updateUser({password:a});if(y)throw y;h(!0),setTimeout(()=>t("/home"),2e3)}catch(y){n({title:y.message,variant:"destructive"})}finally{u(!1)}};return!d&&!c?o.jsx("div",{className:"min-h-[70vh] flex items-center justify-center px-4",children:o.jsxs(X,{className:"p-6 max-w-sm w-full text-center space-y-3",children:[o.jsx("h2",{className:"font-heading text-xl font-bold",children:e("Invalid Link","Kiungo Batili")}),o.jsx("p",{className:"text-sm text-muted-foreground",children:e("This password reset link is invalid or expired.","Kiungo hiki cha kuweka upya nenosiri ni batili au kimekwisha muda wake.")}),o.jsx(Q,{onClick:()=>t("/welcome"),variant:"outline",className:"w-full",children:e("Back to Login","Rudi Kuingia")})]})}):o.jsx("div",{className:"min-h-[70vh] flex items-center justify-center px-4",children:o.jsx(X,{className:"p-6 max-w-sm w-full space-y-4",children:c?o.jsxs("div",{className:"text-center space-y-3",children:[o.jsx(oi,{className:"mx-auto h-12 w-12 text-primary"}),o.jsx("h2",{className:"font-heading text-xl font-bold",children:e("Password Updated!","Nenosiri Limesasishwa!")}),o.jsx("p",{className:"text-sm text-muted-foreground",children:e("Redirecting you to the app...","Inakuelekeza kwenye programu...")})]}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"text-center space-y-1",children:[o.jsx("h2",{className:"font-heading text-xl font-bold",children:e("Set New Password","Weka Nenosiri Jipya")}),o.jsx("p",{className:"text-sm text-muted-foreground",children:e("Enter your new password below.","Weka nenosiri lako jipya hapa chini.")})]}),o.jsx(ft,{type:"password",placeholder:e("New password","Nenosiri jipya"),value:a,onChange:y=>i(y.target.value)}),o.jsx(ft,{type:"password",placeholder:e("Confirm password","Thibitisha nenosiri"),value:r,onChange:y=>s(y.target.value)}),o.jsxs(Q,{onClick:f,className:"w-full font-heading font-bold",disabled:l,children:[l&&o.jsx(Be,{className:"mr-1 h-4 w-4 animate-spin"}),e("Reset Password","Weka Upya Nenosiri")]})]})})})};function Sm(e,[t,n]){return Math.min(n,Math.max(t,e))}var sne=[" ","Enter","ArrowUp","ArrowDown"],one=[" ","Enter"],Ps="Select",[Df,zf,lne]=pl(Ps),[Il,vie]=Yt(Ps,[lne,vl]),Ff=vl(),[une,zr]=Il(Ps),[cne,dne]=Il(Ps),NI=e=>{const{__scopeSelect:t,children:n,open:a,defaultOpen:i,onOpenChange:r,value:s,defaultValue:l,onValueChange:u,dir:c,name:h,autoComplete:d,disabled:m,required:f,form:y}=e,g=Ff(t),[x,w]=p.useState(null),[v,k]=p.useState(null),[j,S]=p.useState(!1),_=Sl(c),[T,E]=ma({prop:a,defaultProp:i??!1,onChange:r,caller:Ps}),[O,A]=ma({prop:s,defaultProp:l,onChange:u,caller:Ps}),R=p.useRef(null),F=x?y||!!x.closest("form"):!0,[Y,V]=p.useState(new Set),z=Array.from(Y).map(W=>W.props.value).join(";");return o.jsx(nT,{...g,children:o.jsxs(une,{required:f,scope:t,trigger:x,onTriggerChange:w,valueNode:v,onValueNodeChange:k,valueNodeHasChildren:j,onValueNodeHasChildrenChange:S,contentId:la(),value:O,onValueChange:A,open:T,onOpenChange:E,dir:_,triggerPointerDownPosRef:R,disabled:m,children:[o.jsx(Df.Provider,{scope:t,children:o.jsx(cne,{scope:e.__scopeSelect,onNativeOptionAdd:p.useCallback(W=>{V(B=>new Set(B).add(W))},[]),onNativeOptionRemove:p.useCallback(W=>{V(B=>{const M=new Set(B);return M.delete(W),M})},[]),children:n})}),F?o.jsxs(JI,{"aria-hidden":!0,required:f,tabIndex:-1,name:h,autoComplete:d,value:O,onChange:W=>A(W.target.value),disabled:m,form:y,children:[O===void 0?o.jsx("option",{value:""}):null,Array.from(Y)]},z):null]})})};NI.displayName=Ps;var CI="SelectTrigger",TI=p.forwardRef((e,t)=>
vendor: 16,841 bytes, line 678
678{const{__scopeSelect:n,disabled:a=!1,...i}=e,r=Ff(n),s=zr(CI,n),l=s.disabled||a,u=Pe(t,s.onTriggerChange),c=zf(n),h=p.useRef("touch"),[d,m,f]=XI(g=>{const x=c().filter(k=>!k.disabled),w=x.find(k=>k.value===s.value),v=ZI(x,g,w);v!==void 0&&s.onValueChange(v.value)}),y=g=>{l||(s.onOpenChange(!0),f()),g&&(s.triggerPointerDownPosRef.current={x:Math.round(g.pageX),y:Math.round(g.pageY)})};return o.jsx(hk,{asChild:!0,...r,children:o.jsx(we.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":QI(s.value)?"":void 0,...i,ref:u,onClick:ue(i.onClick,g=>{g.currentTarget.focus(),h.current!=="mouse"&&y(g)}),onPointerDown:ue(i.onPointerDown,g=>{h.current=g.pointerType;const x=g.target;x.hasPointerCapture(g.pointerId)&&x.releasePointerCapture(g.pointerId),g.button===0&&g.ctrlKey===!1&&g.pointerType==="mouse"&&(y(g),g.preventDefault())}),onKeyDown:ue(i.onKeyDown,g=>{const x=d.current!=="";!(g.ctrlKey||g.altKey||g.metaKey)&&g.key.length===1&&m(g.key),!(x&&g.key===" ")&&sne.includes(g.key)&&(y(),g.preventDefault())})})})});TI.displayName=CI;var EI="SelectValue",AI=p.forwardRef((e,t)=>{const{__scopeSelect:n,className:a,style:i,children:r,placeholder:s="",...l}=e,u=zr(EI,n),{onValueNodeHasChildrenChange:c}=u,h=r!==void 0,d=Pe(t,u.onValueNodeChange);return St(()=>{c(h)},[c,h]),o.jsx(we.span,{...l,ref:d,style:{pointerEvents:"none"},children:QI(u.value)?o.jsx(o.Fragment,{children:s}):r})});AI.displayName=EI;var hne="SelectIcon",PI=p.forwardRef((e,t)=>{const{__scopeSelect:n,children:a,...i}=e;return o.jsx(we.span,{"aria-hidden":!0,...i,ref:t,children:a||"â¼"})});PI.displayName=hne;var mne="SelectPortal",MI=e=>o.jsx(Cc,{asChild:!0,...e});MI.displayName=mne;var Ms="SelectContent",RI=p.forwardRef((e,t)=>{const n=zr(Ms,e.__scopeSelect),[a,i]=p.useState();if(St(()=>{i(new DocumentFragment)},[]),!n.open){const r=a;return r?Os.createPortal(o.jsx(II,{scope:e.__scopeSelect,children:o.jsx(Df.Slot,{scope:e.__scopeSelect,children:o.jsx("div",{children:e.children})})}),r):null}return o.jsx(OI,{...e,ref:t})});RI.displayName=Ms;var ja=10,[II,Fr]=Il(Ms),fne="SelectContentImpl",pne=_s("SelectContent.RemoveScroll"),OI=p.forwardRef((e,t)=>{const{__scopeSelect:n,position:a="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:r,onPointerDownOutside:s,side:l,sideOffset:u,align:c,alignOffset:h,arrowPadding:d,collisionBoundary:m,collisionPadding:f,sticky:y,hideWhenDetached:g,avoidCollisions:x,...w}=e,v=zr(Ms,n),[k,j]=p.useState(null),[S,_]=p.useState(null),T=Pe(t,G=>j(G)),[E,O]=p.useState(null),[A,R]=p.useState(null),F=zf(n),[Y,V]=p.useState(!1),z=p.useRef(!1);p.useEffect(()=>{if(k)return Sk(k)},[k]),_k();const W=p.useCallback(G=>{const[ie,...q]=F().map(me=>me.ref.current),[ae]=q.slice(-1),de=document.activeElement;for(const me of G)if(me===de||(me==null||me.scrollIntoView({block:"nearest"}),me===ie&&S&&(S.scrollTop=0),me===ae&&S&&(S.scrollTop=S.scrollHeight),me==null||me.focus(),document.activeElement!==de))return},[F,S]),B=p.useCallback(()=>W([E,k]),[W,E,k]);p.useEffect(()=>{Y&&B()},[Y,B]);const{onOpenChange:M,triggerPointerDownPosRef:I}=v;p.useEffect(()=>{if(k){let G={x:0,y:0};const ie=ae=>{var de,me;G={x:Math.abs(Math.round(ae.pageX)-(((de=I.current)==null?void 0:de.x)??0)),y:Math.abs(Math.round(ae.pageY)-(((me=I.current)==null?void 0:me.y)??0))}},q=ae=>{G.x<=10&&G.y<=10?ae.preventDefault():k.contains(ae.target)||M(!1),document.removeEventListener("pointermove",ie),I.current=null};return I.current!==null&&(document.addEventListener("pointermove",ie),document.addEventListener("pointerup",q,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ie),document.removeEventListener("pointerup",q,{capture:!0})}}},[k,M,I]),p.useEffect(()=>{const G=()=>M(!1);return window.addEventListener("blur",G),window.addEventListener("resize",G),()=>{window.removeEventListener("blur",G),window.removeEventListener("resize",G)}},[M]);const[b,C]=XI(G=>{const ie=F().filter(de=>!de.disabled),q=ie.find(de=>de.ref.current===document.activeElement),ae=ZI(ie,G,q);ae&&setTimeout(()=>ae.ref.current.focus())}),D=p.useCallback((G,ie,q)=>{const ae=!z.current&&!q;(v.value!==void 0&&v.value===ie||ae)&&(O(G),ae&&(z.current=!0))},[v.value]),N=p.useCallback(()=>k==null?void 0:k.focus(),[k]),J=p.useCallback((G,ie,q)=>{const ae=!z.current&&!q;(v.value!==void 0&&v.value===ie||ae)&&R(G)},[v.value]),re=a==="popper"?Uw:LI,ee=re===Uw?{side:l,sideOffset:u,align:c,alignOffset:h,arrowPadding:d,collisionBoundary:m,collisionPadding:f,sticky:y,hideWhenDetached:g,avoidCollisions:x}:{};return o.jsx(II,{scope:n,content:k,viewport:S,onViewportChange:_,itemRefCallback:D,selectedItem:E,onItemLeave:N,itemTextRefCallback:J,focusSelectedItem:B,selectedItemText:A,position:a,isPositioned:Y,searchRef:b,children:o.jsx(df,{as:pne,allowPinchZoom:!0,children:o.jsx(lf,{asChild:!0,trapped:v.open,onMountAutoFocus:G=>{G.preventDefault()},onUnmountAutoFocus:ue(i,G=>{var ie;(ie=v.trigger)==null||ie.focus({preventScroll:!0}),G.preventDefault()}),children:o.jsx(gl,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:G=>G.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:o.jsx(re,{role:"listbox",id:v.contentId,"data-state":v.open?"open":"closed",dir:v.dir,onContextMenu:G=>G.preventDefault(),...w,...ee,onPlaced:()=>V(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...w.style},onKeyDown:ue(w.onKeyDown,G=>{const ie=G.ctrlKey||G.altKey||G.metaKey;if(G.key==="Tab"&&G.preventDefault(),!ie&&G.key.length===1&&C(G.key),["ArrowUp","ArrowDown","Home","End"].includes(G.key)){let ae=F().filter(de=>!de.disabled).map(de=>de.ref.current);if(["ArrowUp","End"].includes(G.key)&&(ae=ae.slice().reverse()),["ArrowUp","ArrowDown"].includes(G.key)){const de=G.target,me=ae.indexOf(de);ae=ae.slice(me+1)}setTimeout(()=>W(ae)),G.preventDefault()}})})})})})})});OI.displayName=fne;var gne="SelectItemAlignedPosition",LI=p.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:a,...i}=e,r=zr(Ms,n),s=Fr(Ms,n),[l,u]=p.useState(null),[c,h]=p.useState(null),d=Pe(t,T=>h(T)),m=zf(n),f=p.useRef(!1),y=p.useRef(!0),{viewport:g,selectedItem:x,selectedItemText:w,focusSelectedItem:v}=s,k=p.useCallback(()=>{if(r.trigger&&r.valueNode&&l&&c&&g&&x&&w){const T=r.trigger.getBoundingClientRect(),E=c.getBoundingClientRect(),O=r.valueNode.getBoundingClientRect(),A=w.getBoundingClientRect();if(r.dir!=="rtl"){const de=A.left-E.left,me=O.left-de,Ce=T.left-me,ke=T.width+Ce,Ve=Math.max(ke,E.width),We=window.innerWidth-ja,Ge=Sm(me,[ja,Math.max(ja,We-Ve)]);l.style.minWidth=ke+"px",l.style.left=Ge+"px"}else{const de=E.right-A.right,me=window.innerWidth-O.right-de,Ce=window.innerWidth-T.right-me,ke=T.width+Ce,Ve=Math.max(ke,E.width),We=window.innerWidth-ja,Ge=Sm(me,[ja,Math.max(ja,We-Ve)]);l.style.minWidth=ke+"px",l.style.right=Ge+"px"}const R=m(),F=window.innerHeight-ja*2,Y=g.scrollHeight,V=window.getComputedStyle(c),z=parseInt(V.borderTopWidth,10),W=parseInt(V.paddingTop,10),B=parseInt(V.borderBottomWidth,10),M=parseInt(V.paddingBottom,10),I=z+W+Y+M+B,b=Math.min(x.offsetHeight*5,I),C=window.getComputedStyle(g),D=parseInt(C.paddingTop,10),N=parseInt(C.paddingBottom,10),J=T.top+T.height/2-ja,re=F-J,ee=x.offsetHeight/2,G=x.offsetTop+ee,ie=z+W+G,q=I-ie;if(ie<=J){const de=R.length>0&&x===R[R.length-1].ref.current;l.style.bottom="0px";const me=c.clientHeight-g.offsetTop-g.offsetHeight,Ce=Math.max(re,ee+(de?N:0)+me+B),ke=ie+Ce;l.style.height=ke+"px"}else{const de=R.length>0&&x===R[0].ref.current;l.style.top="0px";const Ce=Math.max(J,z+g.offsetTop+(de?D:0)+ee)+q;l.style.height=Ce+"px",g.scrollTop=ie-J+g.offsetTop}l.style.margin=`${ja}px 0`,l.style.minHeight=b+"px",l.style.maxHeight=F+"px",a==null||a(),requestAnimationFrame(()=>f.current=!0)}},[m,r.trigger,r.valueNode,l,c,g,x,w,r.dir,a]);St(()=>k(),[k]);const[j,S]=p.useState();St(()=>{c&&S(window.getComputedStyle(c).zIndex)},[c]);const _=p.useCallback(T=>{T&&y.current===!0&&(k(),v==null||v(),y.current=!1)},[k,v]);return o.jsx(wne,{scope:n,contentWrapper:l,shouldExpandOnScrollRef:f,onScrollButtonChange:_,children:o.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:j},children:o.jsx(we.div,{...i,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});LI.displayName=gne;var yne="SelectPopperPosition",Uw=p.forwardRef((e,t)=>{const{__scopeSelect:n,align:a="start",collisionPadding:i=ja,...r}=e,s=Ff(n);return o.jsx(mk,{...s,...r,ref:t,align:a,collisionPadding:i,style:{boxSizing:"border-box",...r.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Uw.displayName=yne;var[wne,eb]=Il(Ms,{}),Vw="SelectViewport",DI=p.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:a,...i}=e,r=Fr(Vw,n),s=eb(Vw,n),l=Pe(t,r.onViewportChange),u=p.useRef(0);return o.jsxs(o.Fragment,{children:[o.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:a}),o.jsx(Df.Slot,{scope:n,children:o.jsx(we.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:ue(i.onScroll,c=>{const h=c.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:m}=s;if(m!=null&&m.current&&d){const f=Math.abs(u.current-h.scrollTop);if(f>0){const y=window.innerHeight-ja*2,g=parseFloat(d.style.minHeight),x=parseFloat(d.style.height),w=Math.max(g,x);if(w<y){const v=w+f,k=Math.min(y,v),j=v-k;d.style.height=k+"px",d.style.bottom==="0px"&&(h.scrollTop=j>0?j:0,d.style.justifyContent="flex-end")}}}u.current=h.scrollTop})})})]})});DI.displayName=Vw;var zI="SelectGroup",[xne,kne]=Il(zI),vne=p.forwardRef((e,t)=>{const{__scopeSelect:n,...a}=e,i=la();return o.jsx(xne,{scope:n,id:i,children:o.jsx(we.div,{role:"group","aria-labelledby":i,...a,ref:t})})});vne.displayName=zI;var FI="SelectLabel",BI=p.forwardRef((e,t)=>{const{__scopeSelect:n,...a}=e,i=kne(FI,n);return o.jsx(we.div,{id:i.id,...a,ref:t})});BI.displayName=FI;var Nm="SelectItem",[bne,KI]=Il(Nm),$I=p.forwardRef((e,t)=>{const{__scopeSelect:n,value:a,disabled:i=!1,textValue:r,...s}=e,l=zr(Nm,n),u=Fr(Nm,n),c=l.value===a,[h,d]=p.useState(r??""),[m,f]=p.useState(!1),y=Pe(t,v=>{var k;return(k=u.itemRefCallback)==null?void 0:k.call(u,v,a,i)}),g=la(),x=p.useRef("touch"),w=()=>{i||(l.onValueChange(a),l.onOpenChange(!1))};if(a==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return o.jsx(bne,{scope:n,value:a,disabled:i,textId:g,isSelected:c,onItemTextChange:p.useCallback(v=>{d(k=>k||((v==null?void 0:v.textContent)??"").trim())},[]),children:o.jsx(Df.ItemSlot,{scope:n,value:a,disabled:i,textValue:h,children:o.jsx(we.div,{role:"option","aria-labelledby":g,"data-highlighted":m?"":void 0,"aria-selected":c&&m,"data-state":c?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...s,ref:y,onFocus:ue(s.onFocus,()=>f(!0)),onBlur:ue(s.onBlur,()=>f(!1)),onClick:ue(s.onClick,()=>{x.current!=="mouse"&&w()}),onPointerUp:ue(s.onPointerUp,()=>{x.current==="mouse"&&w()}),onPointerDown:ue(s.onPointerDown,v=>{x.current=v.pointerType}),onPointerMove:ue(s.onPointerMove,v=>{var k;x.current=v.pointerType,i?(k=u.onItemLeave)==null||k.call(u):x.current==="mouse"&&v.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ue(s.onPointerLeave,v=>{var k;v.currentTarget===document.activeElement&&((k=u.onItemLeave)==null||k.call(u))}),onKeyDown:ue(s.onKeyDown,v=>{var j;((j=u.searchRef)==null?void 0:j.current)!==""&&v.key===" "||(one.includes(v.key)&&w(),v.key===" "&&v.preventDefault())})})})})});$I.displayName=Nm;var du="SelectItemText",UI=p.forwardRef((e,t)=>{const{__scopeSelect:n,className:a,style:i,...r}=e,s=zr(du,n),l=Fr(du,n),u=KI(du,n),c=dne(du,n),[h,d]=p.useState(null),m=Pe(t,w=>d(w),u.onItemTextChange,w=>{var v;return(v=l.itemTextRefCallback)==null?void 0:v.call(l,w,u.value,u.disabled)}),f=h==null?void 0:h.textContent,y=p.useMemo(()=>o.jsx("option",{value:u.value,disabled:u.disabled,children:f},u.value),[u.disabled,u.value,f]),{onNativeOptionAdd:g,onNativeOptionRemove:x}=c;return St(()=>(g(y),()=>x(y)),[g,x,y]),o.jsxs(o.Fragment,{children:[o.jsx(we.span,{id:u.textId,...r,ref:m}),u.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Os.createPortal(r.children,s.valueNode):null]})});UI.displayName=du;var VI="SelectItemIndicator",HI=p.forwardRef((e,t)=>{const{__scopeSelect:n,...a}=e;return KI(VI,n).isSelected?o.jsx(we.span,{"aria-hidden":!0,...a,ref:t}):null});HI.displayName=VI;var Hw="SelectScrollUpButton",WI=p.forwardRef((e,t)=>{const n=Fr(Hw,e.__scopeSelect),a=eb(Hw,e.__scopeSelect),[i,r]=p.useState(!1),s=Pe(t,a.onScrollButtonChange);return St(()=>{if(n.viewport&&n.isPositioned){let l=function(){const c=u.scrollTop>0;r(c)};const u=n.viewport;return l(),u.addEventListener("scroll",l),()=>u.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),i?o.jsx(GI,{...e,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:u}=n;l&&u&&(l.scrollTop=l.scrollTop-u.offsetHeight)}}):null});WI.displayName=Hw;var Ww="SelectScrollDownButton",qI=p.forwardRef((e,t)=>{const n=Fr(Ww,e.__scopeSelect),a=eb(Ww,e.__scopeSelect),[i,r]=p.useState(!1),s=Pe(t,a.onScrollButtonChange);return St(()=>{if(n.viewport&&n.isPositioned){let l=function(){const c=u.scrollHeight-u.clientHeight,h=Math.ceil(u.scrollTop)<c;r(h)};const u=n.viewport;return l(),u.addEventListener("scroll",l),()=>u.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),i?o.jsx(GI,{...e,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:u}=n;l&&u&&(l.scrollTop=l.scrollTop+u.offsetHeight)}}):null});qI.displayName=Ww;var GI=p.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:a,...i}=e,r=Fr("SelectScrollButton",n),s=p.useRef(null),l=zf(n),u=p.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return p.useEffect(()=>()=>u(),[u]),St(()=>{var h;const c=l().find(d=>d.ref.current===document.activeElement);(h=c==null?void 0:c.ref.current)==null||h.scrollIntoView({block:"nearest"})},[l]),o.jsx(we.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:ue(i.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(a,50))}),onPointerMove:ue(i.onPointerMove,()=>{var c;(c=r.onItemLeave)==null||c.call(r),s.current===null&&(s.current=window.setInterval(a,50))}),onPointerLeave:ue(i.onPointerLeave,()=>{u()})})}),jne="SelectSeparator",YI=p.forwardRef((e,t)=>{const{__scopeSelect:n,...a}=e;return o.jsx(we.div,{"aria-hidden":!0,...a,ref:t})});YI.displayName=jne;var qw="SelectArrow",_ne=p.forwardRef((e,t)=>{const{__scopeSelect:n,...a}=e,i=Ff(n),r=zr(qw,n),s=Fr(qw,n);return r.open&&s.position==="popper"?o.jsx(fk,{...i,...a,ref:t}):null});_ne.displayName=qw;var Sne="SelectBubbleInput",JI=p.forwardRef(({__scopeSelect:e,value:t,...n},a)=>{const i=p.useRef(null),r=Pe(a,i),s=Hv(t);return p.useEffect(()=>{const l=i.current;if(!l)return;const u=window.HTMLSelectElement.prototype,h=Object.getOwnPropertyDescriptor(u,"value").set;if(s!==t&&h){const d=new Event("change",{bubbles:!0});h.call(l,t),l.dispatchEvent(d)}},[s,t]),o.jsx(we.select,{...n,style:{...UC,...n.style},ref:r,defaultValue:t})});JI.displayName=Sne;function QI(e){return e===""||e===void 0}function XI(e){const t=fn(e),n=p.useRef(""),a=p.useRef(0),i=p.useCallback(s=>{const l=n.current+s;t(l),function u(c){n.current=c,window.clearTimeout(a.current),c!==""&&(a.current=window.setTimeout(()=>u(""),1e3))}(l)},[t]),r=p.useCallback(()=>{n.current="",window.clearTimeout(a.current)},[]);return p.useEffect(()=>()=>window.clearTimeout(a.current),[]),[n,i,r]}function ZI(e,t,n){const i=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,r=n?e.indexOf(n):-1;let s=Nne(e,Math.max(r,0));i.length===1&&(s=s.filter(c=>c!==n));const u=s.find(c=>c.textValue.toLowerCase().startsWith(i.toLowerCase()));return u!==n?u:void 0}function Nne(e,t){return e.map((n,a)=>e[(t+a)%e.length])}var Cne=NI,eO=TI,Tne=AI,Ene=PI,Ane=MI,tO=RI,Pne=DI,nO=BI,aO=$I,Mne=UI,Rne=HI,iO=WI,rO=qI,sO=YI;const oO=Cne,lO=Tne,tb=p.forwardRef(({className:e,children:t,...n},a)=>o.jsxs(eO,{ref:a,className:ce("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm r
678ing-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,o.jsx(Ene,{asChild:!0,children:o.jsx(Ec,{className:"h-4 w-4 opacity-50"})})]}));tb.displayName=eO.displayName;const uO=p.forwardRef(({className:e,...t},n)=>o.jsx(iO,{ref:n,className:ce("flex cursor-default items-center justify-center py-1",e),...t,children:o.jsx(Qx,{className:"h-4 w-4"})}));uO.displayName=iO.displayName;const cO=p.forwardRef(({className:e,...t},n)=>o.jsx(rO,{ref:n,className:ce("flex cursor-default items-center justify-center py-1",e),...t,children:o.jsx(Ec,{className:"h-4 w-4"})}));cO.displayName=rO.displayName;const nb=p.forwardRef(({className:e,children:t,position:n="popper",...a},i)=>o.jsx(Ane,{children:o.jsxs(tO,{ref:i,className:ce("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...a,children:[o.jsx(uO,{}),o.jsx(Pne,{className:ce("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),o.jsx(cO,{})]})}));nb.displayName=tO.displayName;const Ine=p.forwardRef(({className:e,...t},n)=>o.jsx(nO,{ref:n,className:ce("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));Ine.displayName=nO.displayName;const Cm=p.forwardRef(({className:e,children:t,...n},a)=>o.jsxs(aO,{ref:a,className:ce("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e),...n,children:[o.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(Rne,{children:o.jsx(Jx,{className:"h-4 w-4"})})}),o.jsx(Mne,{children:t})]}));Cm.displayName=aO.displayName;const One=p.forwardRef(({className:e,...t},n)=>o.jsx(sO,{ref:n,className:ce("-mx-1 my-1 h-px bg-muted",e),...t}));One.displayName=sO.displayName;const Lne=[{value:"general",label_en:"General Legal Question",label_sw:"Swali la Jumla la Kisheria"},{value:"bill",label_en:"About a Bill/Policy",label_sw:"Kuhusu Muswada/Sera"},{value:"rights",label_en:"Rights & Freedoms",label_sw:"Haki na Uhuru"},{value:"land",label_en:"Land & Property",label_sw:"Ardhi na Mali"},{value:"employment",label_en:"Employment",label_sw:"Ajira"},{value:"family",label_en:"Family Law",label_sw:"Sheria ya Familia"},{value:"other",label_en:"Other",label_sw:"Nyingine"}],Dne=()=>{const{t:e,lang:t}=Re(),{user:n}=Rt(),{url:a,displayName:i}=wf(),r=Mn(),{toast:s}=Zn(),[l,u]=p.useState(""),[c,h]=p.useState(""),[d,m]=p.useState("general"),[f,y]=p.useState(!1),[g,x]=p.useState(!1),{data:w,refetch:v}=bl({queryKey:["my-consultations",n==null?void 0:n.id],queryFn:async()=>{if(!n)return[];const{data:j}=await te.from("consultations").select("*").eq("citizen_id",n.id).order("created_at",{ascending:!1});return j||[]},enabled:!!n}),k=async()=>{var _;if(!n||!l.trim()||!c.trim())return;y(!0);const{data:j}=await te.from("profiles").select("display_name").eq("user_id",n.id).maybeSingle(),{error:S}=await te.from("consultations").insert({citizen_id:n.id,citizen_name:(j==null?void 0:j.display_name)||((_=n.email)==null?void 0:_.split("@")[0])||"Citizen",subject:l.trim(),description:c.trim(),category:d});y(!1),S?s({title:e("Error","Hitilafu"),description:S.message,variant:"destructive"}):(x(!0),u(""),h(""),m("general"),v(),Es(async()=>{const{awardCivicPoints:T}=await Promise.resolve().then(()=>ol);return{awardCivicPoints:T}},void 0).then(({awardCivicPoints:T})=>{T("consultation_submit")}),setTimeout(()=>x(!1),3e3))};return n?o.jsxs("div",{className:"space-y-5",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Ft,{className:"h-5 w-5 text-primary"}),o.jsx("h1",{className:"font-heading text-xl font-bold",children:e("Ask a Lawyer","Uliza Wakili")})]}),o.jsx("p",{className:"text-xs text-muted-foreground",children:e("Submit your legal question or grievance and a verified legal professional will respond.","Tuma swali lako la kisheria au malalamiko na mtaalamu wa sheria aliyeidhinishwa atajibu.")}),o.jsxs(X,{className:"p-4 space-y-3",children:[o.jsx("h2",{className:"text-sm font-bold",children:e("New Question","Swali Jipya")}),o.jsxs(oO,{value:d,onValueChange:m,children:[o.jsx(tb,{className:"text-xs",children:o.jsx(lO,{})}),o.jsx(nb,{children:Lne.map(j=>o.jsx(Cm,{value:j.value,className:"text-xs",children:t==="en"?j.label_en:j.label_sw},j.value))})]}
678),o.jsx(ft,{placeholder:e("Subject...","Mada..."),value:l,onChange:j=>u(j.target.value),className:"text-xs",maxLength:200}),o.jsx(Ia,{placeholder:e("Describe your question or grievance in detail...","Eleza swali lako au malalamiko kwa undani..."),value:c,onChange:j=>h(j.target.value),className:"text-xs min-h-[100px]",maxLength:2e3}),g?o.jsxs("div",{className:"flex items-center gap-2 text-primary text-xs",children:[o.jsx(oi,{className:"h-4 w-4"}),e("Submitted! A lawyer will respond soon.","Imetumwa! Wakili atajibu hivi karibuni.")]}):o.jsxs(Q,{size:"sm",onClick:k,disabled:f||!l.trim()||!c.trim(),className:"text-xs gap-1",children:[f?o.jsx(Be,{className:"h-3 w-3 animate-spin"}):o.jsx(Vn,{className:"h-3 w-3"}),e("Submit","Tuma")]})]}),w&&w.length>0&&o.jsxs("div",{children:[o.jsxs("h2",{className:"font-heading text-sm font-bold flex items-center gap-2 mb-2",children:[o.jsx(Ns,{className:"h-4 w-4 text-primary"}),e("My Questions","Maswali Yangu")]}),o.jsx("div",{className:"space-y-2",children:w.map(j=>o.jsxs(X,{className:`p-3 space-y-2 ${j.status==="responded"?"border-primary/30":""}`,children:[o.jsxs("div",{className:"flex items-start gap-2",children:[o.jsx(zs,{name:j.citizen_name||i||"You",url:a,className:"h-7 w-7 shrink-0 mt-0.5",fallbackTextClass:"text-[10px]"}),o.jsxs("div",{className:"min-w-0 flex-1 space-y-1",children:[o.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[o.jsx("span",{className:`text-[9px] px-1.5 py-0.5 rounded-full ${j.status==="open"?"bg-yellow-100 text-yellow-800":j.status==="claimed"?"bg-blue-100 text-blue-800":"bg-green-100 text-green-800"}`,children:j.status==="open"?e("Pending","Inasubiri"):j.status==="claimed"?e("Being reviewed","Inakaguliwa"):e("Responded","Imejibiwa")}),o.jsxs("span",{className:"text-[10px] text-muted-foreground flex items-center gap-1",children:[o.jsx(Ac,{className:"h-3 w-3"}),bm(new Date(j.created_at),{addSuffix:!0})]})]}),o.jsx("p",{className:"text-xs font-semibold",children:j.subject}),o.jsx("p",{className:"text-[11px] text-muted-foreground line-clamp-2",children:j.description})]})]}),j.lawyer_response&&o.jsxs("div",{className:"mt-2 p-2 bg-primary/5 rounded border border-primary/20 flex items-start gap-2",children:[o.jsx("div",{className:"h-7 w-7 rounded-full bg-primary/15 flex items-center justify-center shrink-0",children:o.jsx(Ft,{className:"h-3.5 w-3.5 text-primary"})}),o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsx("p",{className:"text-[10px] font-semibold text-primary mb-0.5",children:e("Lawyer Response","Jibu la Wakili")}),o.jsx("p",{className:"text-[11px] text-foreground",children:j.lawyer_response})]})]})]},j.id))})]})]}):o.jsx("div",{className:"flex min-h-[60vh] items-center justify-center",children:o.jsxs(X,{className:"w-full max-w-sm p-6 text-center space-y-3",children:[o.jsx(Ft,{className:"mx-auto h-10 w-10 text-primary"}),o.jsx("h1",{className:"font-heading text-lg font-bold",children:e("Ask a Lawyer","Uliza Wakili")}),o.jsx("p",{className:"text-xs text-muted-foreground",children:e("Sign in to submit your question","Ingia ili kutuma swali lako")}),o.jsx(Q,{size:"sm",onClick:()=>r("/welcome"),className:"text-xs",children:e("Sign In","Ingia")})]})})},zne=()=>{const{t:e,lang:t}=Re(),[n,a]=p.useState(null),{data:i,isLoading:r}=bl({queryKey:["public-guides"],queryFn:async()=>{const{data:s,error:l}=await te.from("public_guides").select("*").order("created_at",{ascending:!1});if(l)throw l;return s||[]}});return r?o.jsx("div",{className:"flex min-h-[60vh] items-center justify-center",children:o.jsx(Be,{className:"h-8 w-8 animate-spin text-primary"})}):n?o.jsx(Fne,{guide:n,onBack:()=>a(null)}):o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(La,{className:"h-5 w-5 text-primary"}),o.jsx("h1",{className:"font-heading text-xl font-bold",children:e("Public Participation Guides","Miongozo ya Ushiriki wa Umma")})]}),o.jsx("p",{className:"text-xs text-muted-foreground",children:e("Learn how public participation works in Kenya and what you can do at each stage.","Jifunze jinsi ushiriki wa umma unavyofanya kazi nchini Kenya na unachoweza kufanya katika kila hatua.")}),!i||i.length===0?o.jsxs(X,{className:"p-6 text-center",children:[o.jsx(La,{className:"mx-auto h-10 w-10 text-muted-foreground
678/50"}),o.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:e("No guides available yet.","Hakuna miongozo bado.")})]}):o.jsx("div",{className:"space-y-3",children:i.map(s=>{var l,u;return o.jsx(X,{className:"p-4 cursor-pointer hover:bg-muted/50 transition-colors",onClick:()=>a(s),children:o.jsxs("div",{className:"flex items-start justify-between gap-2",children:[o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("h3",{className:"text-sm font-semibold leading-tight",children:s.source_title||e("Public Participation Guide","Mwongozo wa Ushiriki")}),o.jsx("p",{className:"mt-1 text-xs text-muted-foreground line-clamp-2",children:t==="sw"?s.short_summary_sw:s.short_summary_en}),o.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[o.jsxs(Ze,{variant:"outline",className:"text-[10px]",children:[((l=s.key_obligations)==null?void 0:l.length)||0," ",e("obligations","wajibu")]}),o.jsxs(Ze,{variant:"outline",className:"text-[10px]",children:[((u=s.public_participation_steps)==null?void 0:u.length)||0," ",e("steps","hatua")]})]})]}),o.jsx(ts,{className:"h-4 w-4 text-muted-foreground shrink-0 mt-1"})]})},s.id)})})]})},Fne=({guide:e,onBack:t})=>{const{t:n,lang:a}=Re(),i={inform:"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200",engage:"bg-amber-100 text-amber-800 dark:bg-amber-900 dark:text-amber-200",act:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200"};return o.jsxs("div",{className:"space-y-4",children:[o.jsxs("button",{onClick:t,className:"text-xs text-primary flex items-center gap-1 hover:underline",children:["â ",n("Back to Guides","Rudi kwa Miongozo")]}),o.jsx("h1",{className:"font-heading text-lg font-bold",children:e.source_title||n("Public Participation Guide","Mwongozo wa Ushiriki")}),o.jsx("p",{className:"text-sm text-muted-foreground",children:a==="sw"?e.short_summary_sw:e.short_summary_en}),e.key_obligations&&e.key_obligations.length>0&&o.jsxs(X,{className:"p-4 space-y-3",children:[o.jsxs("h2",{className:"text-sm font-semibold flex items-center gap-2",children:[o.jsx(Ft,{className:"h-4 w-4 text-primary"}),n("Key Obligations","Wajibu Muhimu")]}),o.jsx("ul",{className:"space-y-2",children:e.key_obligations.map((r,s)=>o.jsxs("li",{className:"flex gap-2 text-xs",children:[o.jsxs("span",{className:"text-primary font-bold shrink-0",children:[s+1,"."]}),o.jsx("span",{children:r.text})]},r.id||s))})]}),e.public_participation_steps&&e.public_participation_steps.length>0&&o.jsxs(X,{className:"p-4 space-y-3",children:[o.jsxs("h2",{className:"text-sm font-semibold flex items-center gap-2",children:[o.jsx(Si,{className:"h-4 w-4 text-primary"}),n("How Public Participation Works","Jinsi Ushiriki wa Umma Unavyofanya Kazi")]}),o.jsx("div",{className:"space-y-3",children:e.public_participation_steps.sort((r,s)=>r.stepOrder-s.stepOrder).map((r,s)=>o.jsxs("div",{className:"flex gap-3",children:[o.jsxs("div",{className:"flex flex-col items-center",children:[o.jsx("div",{className:"flex h-6 w-6 items-center justify-center rounded-full bg-primary text-primary-foreground text-[10px] font-bold",children:r.stepOrder}),s<e.public_participation_steps.length-1&&o.jsx("div",{className:"w-px flex-1 bg-border mt-1"})]}),o.jsxs("div",{className:"pb-3",children:[o.jsx("p",{className:"text-xs font-semibold",children:r.title}),o.jsx("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:r.description}),r.expected_time&&o.jsxs(Ze,{variant:"outline",className:"mt-1 text-[9px]",children:["â± ",r.expected_time]})]})]},s))})]}),e.suggested_actions_per_stage&&Object.keys(e.suggested_actions_per_stage).length>0&&o.jsxs(X,{className:"p-4 space-y-3",children:[o.jsxs("h2",{className:"text-sm font-semibold flex items-center gap-2",children:[o.jsx(Jn,{className:"h-4 w-4 text-primary"}),n("What You Can Do","Unachoweza Kufanya")]}),o.jsx(If,{type:"multiple",className:"w-full",children:Object.entries(e.suggested_actions_per_stage).map(([r,s])=>s&&s.length>0&&o.jsxs(Jc,{value:r,children:[o.jsx(Qc,{className:"text-xs font-semibold capitalize py-2",children:n(`At "${r}" stage`,`Katika hatua ya "${r}"`)}),o.jsx(Xc,{children:o.jsx("div",{className:"space-y-2",children:s.map((l,u)=>{var c;return o.jsxs("div",{className:"rounded-lg border p-3 space-y-1",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:`rounded-full px-2 py-0.5 text-[9px] font-medium ${i[l.level]||"bg-muted text-muted-foreground"}`,children:(c=l.level)==null?void 0:c.toUpperCase()}),o.jsx("span",{className:"text-xs font-semibold",children:l.title})]}),o.jsx("p",{className:"text-[10px] text-muted-foreground",children:l.description}),o.jsxs("div",{className:"flex gap-2 flex-wrap",children:[l.eta&&o.jsxs(Ze,{variant:"outline",className:"text-[9px]",children:["â± ",l.eta]}),l.privacy&&o.jsxs(Ze,{variant:"outline",className:"text-[9px]",children:["ð ",l.privacy]})]})]},l.id||u)})})})]},r))})]}),e.citations&&e.citations.length>0&&o.jsxs(X,{className:"p-4 space-y-2",children:[o.jsx("h2",{className:"text-xs font-semibold text-muted-foreground",children:n("Sources","Vyanzo")}),e.citations.map((r,s)=>o.jsx("a",{href:r.anchor,target:"_blank",rel:"noopener noreferrer",className:"block text-[10px] text-primary hover:underline truncate",children:r.text||r.anchor},s))]})]})},Bne="/assets/tuko-kadi-logo-BmWJY_8Z.jpg",Vd=[{id:1,name:"IEBC Nairobi County Office",county:"Nairobi",town:"Nairobi CBD",latitude:-1.286389,longitude:36.817223,address:"Anniversary Towers, University Way, Nairobi",hours:"MonâFri, 8:00 AM â 5:00 PM"},{id:2,name:"IEBC Mombasa County Office",county:"Mombasa",town:"Mombasa Island",latitude:-4.0435,longitude:39.6682,address:"Bima Tower, Digo Road, Mombasa",hours:"MonâFri, 8:00 AM â 5:00 PM"},{id:3,name:"IEBC Kwale County Office",county:"Kwale",town:"Kwale Town",latitude:-4.1747,longitude:39.4521,address:"County Headquarters, Kwale Town",hours:"MonâFri, 8:00 AM â 5:00 PM"},{id:4,name:"IEBC Kilifi County Office",county:"Kilifi",town:"Kilifi Town",latitude:-3.6305,longitude:39.8499,address:"County HQ, Kilifi Town",hours:"MonâFri, 8:00 AM â 5:00 PM"},{id:5,name:"IEBC Tana River County Office",county:"Tana River",town:"Hola",latitude:-1.5,longitude:40.0333,address:"County HQ, Hola Town",hours:"MonâFri, 8:00 AM â 5:00 PM"},{id:6,name:"IEBC Lamu County Office",county:"Lamu",town:"Lamu Town",latitude:-2.2696,longitude:40.902,address:"County HQ, Lamu Town",hours:"MonâFri, 8:00 AM â 5:00 PM"},{id:7,name:"IEBC Taita Taveta County Office",county:"Taita Taveta",town:"Wundanyi",latitude:-3.4,longitude:38.3667,address:"County HQ, Wundanyi",hours:"MonâFri, 8:00 AM â 5:00 PM"},{id:8,name:"IEBC Garissa County Office",county:"Garissa",town:"Garissa Town",latitude:-.4536,longitude:39.6401,address:"County HQ, Garissa Town",hours:"MonâFri, 8:00 AM â 5:00 PM"},{id:9,name:"IEBC Wajir County Office",county:"Wajir",town:"Wajir Town",latitude:1.7471,longitude:40.0573,address:"County HQ, Wajir Town",hours:"MonâFri, 8:00 AM â 5:00 PM"},{id:10,name:"IEBC Mandera County Office",county:"Mandera",town:"Mandera Town",latitude:3.9366,longitude:41.8569,address:"County HQ, Mandera Town",hours:"MonâFri, 8:00 AM â 5:00 PM"},{id:11,name:"IEBC Marsabit County Office",county:"Marsabit",town:"Marsabit Town",latitude:2.3284,longitude:37.9899,address:"County HQ, Marsabit Town",hours:"MonâFri, 8:00 AM â 5:00 PM"},{id:12,name:"IEBC Isiolo County Office",county:"Isiolo",town:"Isiolo Town",latitude:.3546,longitude:37.5822,address:"County HQ, Isiolo Town",hours:"MonâFri, 8:00 AM â 5:00 PM"},{id:13,name:"IEBC Meru County Office",county:"Meru",town:"Meru Town",latitude:.0463,longitude:37.6559,address:"County HQ, Meru Town",hours:"MonâFri, 8:00 AM â 5:00 PM"},{id:14,name:"IEBC Tharaka Nithi County Office",county:"Tharaka Nithi",town:"Kathwana",latitude:-.2965,longitude:37.8968,address:"County HQ, Kathwana",hours:"MonâFri, 8:00 AM â 5:00 PM"},{id:15,name:"IEBC Embu County Office",county:"Embu",town:"Embu Town",latitude:-.5389,longitude:37.4575,address:"County HQ, Embu Town",hours:"MonâFri, 8:00 AM â 5:00 PM"},{id:16,name:"IEBC Kitui County Office",county:"Kitui",town:"Kitui Town",latitude:-1.3667,longitude:38.0106,address:"County HQ, Kitui Town",hours:"MonâFri, 8:00 AM â 5:00 PM"},{id:17,name:"IEBC Machakos County Office",county:"Machakos",town:"Machakos Town",latitude:-1.5177,longitude:37.2634,address:"County HQ, Machakos Town",hours:"MonâFri, 8:00 AM â 5:00 PM"},{id:18,name:"IEBC Makueni County Office",county:"Makueni",town:"Wote",latitude:-1.7833,longitude:37.6333,address:"County HQ, Wote Town",hours:"MonâFri, 8:00 AM â 5:00 PM"},{id:19,name:"IEBC Nyandarua County Office",county:"Nyandarua",town:"Ol Kalou",latitude:-.2667,longitude:36.3833,address:"County HQ, Ol Kalou",hours:"MonâFri, 8:00 AM â 5:00 PM"},{id:20,name:"IEBC Nyeri County Office",county:"Nyeri",town:"Nyeri Town",latitude:-.4201,longitude:36.9476,address:"County HQ, Nyeri Town",hours:"MonâFri, 8:00 AM â 5:00 PM"},{id:21,name:"IEBC Kirinyaga County Office",county:"Kirinyaga",town:"Kerugoya",latitude:-.4985,longitude:37.2803,address:"County HQ, Kerugoya",hours:"MonâFri, 8:00 AM â 5:00 PM"},{id:22,name:"IEBC Murang'a County Office",county:"Murang'a",town:"Murang'a Town",latitude:-.7167,longitude:37.15,address:"County HQ, Murang'a Town",hours:"MonâFri, 8:00 AM â 5:00 PM"}
678,{id:23,name:"IEBC Kiambu County Office",county:"Kiambu",town:"Kiambu Town",latitude:-1.1714,longitude:36.8356,address:"County HQ, Kiambu Town",hours:"MonâFri, 8:00 AM â 5:00 PM"},{id:24,name:"IEBC Turkana County Office",county:"Turkana",town:"Lodwar",latitude:3.1191,longitude:35.5973,address:"County HQ, Lodwar",hours:"MonâFri, 8:00 AM â 5:00 PM"},{id:25,name:"IEBC West Pokot County Office",county:"West Pokot",town:"Kapenguria",latitude:1.2389,longitude:35.1119,address:"County HQ, Kapenguria",hours:"MonâFri, 8:00 AM â 5:00 PM"},{id:26,name:"IEBC Samburu County Office",county:"Samburu",town:"Maralal",latitude:1.0944,longitude:36.6989,address:"County HQ, Maralal",hours:"MonâFri, 8:00 AM â 5:00 PM"},{id:27,name:"IEBC Trans Nzoia County Office",county:"Trans Nzoia",town:"Kitale",latitude:1.0157,longitude:35.0062,address:"County HQ, Kitale",hours:"MonâFri, 8:00 AM â 5:00 PM"},{id:28,name:"IEBC Uasin Gishu County Office",county:"Uasin Gishu",town:"Eldoret",latitude:.5143,longitude:35.2698,address:"County HQ, Eldoret",hours:"MonâFri, 8:00 AM â 5:00 PM"},{id:29,name:"IEBC Elgeyo Marakwet County Office",county:"Elgeyo Marakwet",town:"Iten",latitude:.6699,longitude:35.5083,address:"County HQ, Iten",hours:"MonâFri, 8:00 AM â 5:00 PM"},{id:30,name:"IEBC Nandi County Office",county:"Nandi",town:"Kapsabet",latitude:.2031,longitude:35.1058,address:"County HQ, Kapsabet",hours:"MonâFri, 8:00 AM â 5:00 PM"},{id:31,name:"IEBC Baringo County Office",county:"Baringo",town:"Kabarnet",latitude:.4919,longitude:35.7431,address:"County HQ, Kabarnet",hours:"MonâFri, 8:00 AM â 5:00 PM"},{id:32,name:"IEBC Laikipia County Office",county:"Laikipia",town:"Nanyuki",latitude:.0167,longitude:37.0667,address:"County HQ, Nanyuki",hours:"MonâFri, 8:00 AM â 5:00 PM"},{id:33,name:"IEBC Nakuru County Office",county:"Nakuru",town:"Nakuru Town",latitude:-.3031,longitude:36.08,address:"County HQ, Nakuru Town",hours:"MonâFri, 8:00 AM â 5:00 PM"},{id:34,name:"IEBC Narok County Office",county:"Narok",town:"Narok Town",latitude:-1.0833,longitude:35.8667,address:"County HQ, Narok Town",hours:"MonâFri, 8:00 AM â 5:00 PM"},{id:35,name:"IEBC Kajiado County Office",county:"Kajiado",town:"Kajiado Town",latitude:-1.85,longitude:36.7833,address:"County HQ, Kajiado Town",hours:"MonâFri, 8:00 AM â 5:00 PM"},{id:36,name:"IEBC Kericho County Office",county:"Kericho",town:"Kericho Town",latitude:-.3689,longitude:35.2831,address:"County HQ, Kericho Town",hours:"MonâFri, 8:00 AM â 5:00 PM"},{id:37,name:"IEBC Bomet County Office",county:"Bomet",town:"Bomet Town",latitude:-.7827,longitude:35.3428,address:"County HQ, Bomet Town",hours:"MonâFri, 8:00 AM â 5:00 PM"},{id:38,name:"IEBC Kakamega County Office",county:"Kakamega",town:"Kakamega Town",latitude:.2827,longitude:34.7519,address:"County HQ, Kakamega Town",hours:"MonâFri, 8:00 AM â 5:00 PM"},{id:39,name:"IEBC Vihiga County Office",county:"Vihiga",town:"Mbale",latitude:.0764,longitude:34.7228,address:"County HQ, Mbale",hours:"MonâFri, 8:00 AM â 5:00 PM"},{id:40,name:"IEBC Bungoma County Office",county:"Bungoma",town:"Bungoma Town",latitude:.5635,longitude:34.5606,address:"County HQ, Bungoma Town",hours:"MonâFri, 8:00 AM â 5:00 PM"},{id:41,name:"IEBC Busia County Office",county:"Busia",town:"Busia Town",latitude:.4607,longitude:34.1115,address:"County HQ, Busia Town",hours:"MonâFri, 8:00 AM â 5:00 PM"},{id:42,name:"IEBC Siaya County Office",county:"Siaya",town:"Siaya Town",latitude:.0607,longitude:34.288,address:"County HQ, Siaya Town",hours:"MonâFri, 8:00 AM â 5:00 PM"},{id:43,name:"IEBC Kisumu County Office",county:"Kisumu",town:"Kisumu Central",latitude:-.0917,longitude:34.768,address:"County HQ, Kisumu Town",hours:"MonâFri, 8:00 AM â 5:00 PM"},{id:44,name:"IEBC Homa Bay County Office",county:"Homa Bay",town:"Homa Bay Town",latitude:-.5273,longitude:34.4571,address:"County HQ, Homa Bay Town",hours:"MonâFri, 8:00 AM â 5:00 PM"},{id:45,name:"IEBC Migori County Office",county:"Migori",town:"Migori Town",latitude:-1.0634,longitude:34.4731,address:"County HQ, Migori Town",hours:"MonâFri, 8:00 AM â 5:00 PM"},{id:46,name:"IEBC Kisii County Office",county:"Kisii",town:"Kisii Town",latitude:-.6817,longitude:34.7757,address:"County HQ, Kisii Town",hours:"MonâFri, 8:00 AM â 5:00 PM"},{id:47,name:"IEBC Nyamira County Office",county:"Nyamira",town:"Nyamira Town",latitude:-.5633,longitude:34.9358,address:"County HQ, Nyamira Town",hours:"MonâFri, 8:00 AM â 5:00 PM"}];function Hd(e){return e*Math.PI/180}function Kne(e,t,n,a){const r=Hd(n-e),s=Hd(a-t),l=Math.sin(r/2)*Math.sin(r/2)+Math.cos(Hd(e))*Math.cos(Hd(n))*Math.sin(s/2)*Math.sin(s/2);return 6371*(2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)))}function $ne(){const{user:e}=Rt(),[t,n]=p.useState(null),[a,i]=p.useState(null),[r,s]=p.useState(""),[l,u]=p.useState(""),[c,h]=p.useState(""),[d,m]=p.useState("50 days before"),[f,y]=p.useState(""),[g,x]=p.useState(""),[w,v]=p.useState(null),[k,j]=p.useState(!1),[S,_]=p.useState(!1),[T,E]=p.useState(()=>{if(typeof window>"u")return"unknown";const b=localStorage.getItem("uko_kadi_registered");return b==="yes"||b==="no"?b:"unknown"}),[O,A]=p.useState(!1),R=async b=>{if(E(b),localStorage.setItem("uko_kadi_registered",b),e){const{error:C}=await te.from("voter_registration_plans").upsert({user_id:e.id,already_registered:b==="yes"},{onConflict:"user_id"});C&&console.warn("[uko-kadi] failed to persist already_registered",C.message)}if(b==="yes"&&!O){A(!0);const{awardCivicPoints:C}=await Es(async()=>{const{awardCivicPoints:D}=await Promise.resolve().then(()=>ol);return{awardCivicPoints:D}},void 0);await C("voter_plan_save",{refType:"self_declared_registered"}),h("Asante! We've added a head-start to your civic score for already being registered. ð")}else b==="no"&&h("No worries â we'll guide you through registration. You'll earn points as you plan your visit.")},F=p.useMemo(()=>Array.from(new Set(Vd.map(b=>b.county))).sort((b,C)=>b.localeCompare(C)),[]);p.useEffect(()=>{if(!e)return;let b=!1;return(async()=>{const{data:C,error:D}=await te.from("voter_registration_plans").select("*").eq("user_id",e.id).maybeSingle();if(!(b||D||!C)&&(C.center_id&&v(C.center_id),C.appointment_date&&y(C.appointment_date),C.appointment_time&&x(String(C.appointment_time).slice(0,5)),C.reminder_choice&&m(C.reminder_choice),C.center_county&&s(C.center_county),typeof C.already_registered=="boolean")){const N=C.already_registered?"yes":"no";E(N),localStorage.setItem("uko_kadi_registered",N),N==="yes"&&A(!0)}})(),()=>{b=!0}},[e]);const Y=p.useMemo(()=>t!==null&&a!==null?Vd.map(b=>({...b,distance:Kne(t,a,b.latitude,b.longitude)})).sort((b,C)=>(b.distance??0)-(C.distance??0)):r.trim()||l.trim()?Vd.filter(b=>{const C=r?b.county===r:!0,D=l?b.town.toLowerCase().includes(l.toLowerCase()):!0;return C&&D}).map(b=>({...b,distance:null})):[],[t,a,r,l]),V=Y.length>0?Y[0]:null,z=Vd.find(b=>b.id===w)||V,W=()=>{if(!navigator.geolocation){h("Geolocation is not supported on this device.");return}h("Getting your location..."),navigator.geolocation.getCurrentPosition(b=>{n(b.coords.latitude),i(b.coords.longitude),s(""),u(""),h("Location found successfully.")},()=>{h("We could not access your location. You can enter your county and town manually.")})},B=async(b={})=>
678{if(!e||!z)return{error:null};const C={user_id:e.id,center_id:z.id,center_name:z.name,center_county:z.county,center_town:z.town,center_address:z.address,center_latitude:z.latitude,center_longitude:z.longitude,appointment_date:f||null,appointment_time:g||null,reminder_choice:d,...b};return te.from("voter_registration_plans").upsert(C,{onConflict:"user_id"})},M=async()=>{if(!z){h("Please choose a registration center first.");return}if(!e){h("Please sign in to save your reminder so it survives reload.");return}_(!0);const{error:b}=await B();if(_(!1),b){h("Could not save reminder. Please try again.");return}h(`Reminder saved: ${d} for ${z.name}.`),Es(async()=>{const{awardCivicPoints:C}=await Promise.resolve().then(()=>ol);return{awardCivicPoints:C}},void 0).then(({awardCivicPoints:C})=>{C("voter_plan_save")})},I=async()=>{if(!z||!f||!g){h("Please select a center, date, and time before scheduling.");return}if(!e){h("Please sign in to save your appointment plan so it survives reload.");return}j(!0);const{error:b}=await B();if(j(!1),b){h("Could not save appointment. Please try again.");return}h(`Appointment saved for ${f} at ${g} at ${z.name}.`)};return o.jsx("div",{className:"min-h-screen bg-background text-foreground",children:o.jsxs("div",{className:"max-w-6xl mx-auto space-y-8 py-2",children:[o.jsxs("section",{className:"relative overflow-hidden rounded-3xl border border-primary/20 shadow-[0_8px_30px_-8px_hsl(var(--primary)/0.4)] p-6 md:p-10 bg-gradient-to-br from-primary/15 via-card to-accent/15",children:[o.jsx("div",{className:"pointer-events-none absolute -top-20 -right-20 h-64 w-64 rounded-full bg-primary/20 blur-3xl"}),o.jsx("div",{className:"pointer-events-none absolute -bottom-24 -left-16 h-72 w-72 rounded-full bg-accent/20 blur-3xl"}),o.jsxs("div",{className:"relative flex flex-col md:flex-row items-start md:items-center gap-6 md:gap-8",children:[o.jsxs("div",{className:"relative shrink-0",children:[o.jsx("div",{className:"absolute inset-0 rounded-2xl bg-gradient-to-br from-primary to-accent blur-md opacity-60"}),o.jsx("img",{src:Bne,alt:"Tuko Kadi â Mass Voter Registration #RegisterNaMbogi",className:"relative w-28 h-28 md:w-40 md:h-40 rounded-2xl object-cover border-2 border-background shadow-xl"})]}),o.jsxs("div",{className:"flex flex-col gap-3 md:gap-4",children:[o.jsxs("span",{className:"inline-flex items-center gap-2 w-fit px-3 py-1.5 rounded-full bg-primary/15 border border-primary/30 text-primary text-xs font-bold uppercase tracking-wider",children:[o.jsx("span",{className:"h-2 w-2 rounded-full bg-primary animate-pulse"}),"UKO KADI? · #RegisterNaMbogi"]}),o.jsxs("h1",{className:"font-heading text-4xl md:text-5xl font-extrabold leading-tight bg-gradient-to-br from-foreground via-foreground to-primary bg-clip-text text-transparent",children:["Your Vote.",o.jsx("br",{className:"hidden md:block"})," Your Voice. Your Future."]}),o.jsx("p",{className:"text-base md:text-lg text-muted-foreground max-w-2xl leading-relaxed",children:"Register to vote with confidence. We help you understand the process, prepare your documents, find your nearest IEBC center, and plan your visit â all in one place."}),o.jsxs("div",{className:"flex flex-wrap gap-2 pt-1",children:[o.jsx("span",{className:"px-3 py-1 rounded-full bg-card/60 border border-border/60 text-xs font-medium text-foreground",children:"ð 47 Counties"}),o.jsx("span",{className:"px-3 py-1 rounded-full bg-card/60 border border-border/60 text-xs font-medium text-foreground",children:"ð ID Required"}),o.jsx("span",{className:"px-3 py-1 rounded-full bg-card/60 border border-border/60 text-xs font-medium text-foreground",children:"â° Free & Quick"})]})]})]})]}),o.jsxs("section",{className:"rounded-3xl border border-accent/30 bg-gradient-to-br from-accent/10 via-card to-primary/10 p-6 md:p-7",children:[o.jsxs("div",{className:"flex flex-col md:flex-row md:items-center md:justify-between gap-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsxs("div",{className:"inline-flex items-center gap-2 px-3 py-1 rounded-full bg-accent/20 border border-accent/40 text-accent-foreground text-xs font-bold uppercase tracking-wider",children:[o.jsx("span",{className:"h-2 w-2 rounded-full bg-accent animate-pulse"}),"Quick check"]}),o.jsx("h2",{className:"text-xl md:text-2xl font-bold",children:"Are you already registered to vote?"}),o.jsx("p",{className:"text-sm text-muted-foreground max-w-xl",children:"We want fairness on the leaderboard. If you're already a registered voter, we'll give you a head-start on your civic score â no need to start from zero."})]}),o.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 shrink-0",children:[o.jsx("button",{onClick:()=>R("yes"),className:`px-5 py-3 rounded-2xl font-semibold transition border-2 ${T==="yes"?"bg-primary text-primary-foreground border-primary shadow-lg":"bg-card border-primary/40 text-foreground hover:bg-primary/10"}`,children:"â
Yes, I'm registered"}),o.jsx("button",{onClick:()=>R("no"),className:`px-5 py-3 rounded-2xl font-semibold transition border-2 ${T==="no"?"bg-foreground text-background border-foreground":"bg-card border-border text-foreground hover:bg-muted"}`,children:"Not yet"})]})]}),T==="yes"&&o.jsx("div",{className:"mt-4 rounded-2xl bg-primary/10 border border-primary/30 p-4 text-sm text-foreground",children:"ð Head-start applied! Your civic score reflects your existing voter status. Keep engaging to climb higher."}),T==="no"&&o.jsx("div",{className:"mt-4 rounded-2xl bg-muted border p-4 text-sm text-foreground",children:"Use the tools below to find a center, plan a visit, and earn civic points along the way."})]}),o.jsxs("section",{className:"grid md:grid-cols-2 gap-6",children:[o.jsxs("div",{className:"bg-card rounded-3xl shadow-sm border p-6 space-y-4",children:[o.jsx("h2",{className:"text-xl font-semibold",children:"Find a Registration Center"}),o.jsx("p",{className:"text-muted-foreground",children:"Use your location or enter your county and town manually."}),o.jsx("button",{onClick:W,className:"w-full bg-primary text-primary-foreground rounded-2xl px-4 py-3 font-medium hover:opacity-90 transition",children:"Use My Current Location"}),o.jsxs("div",{className:"grid grid-cols-1 gap-3",children:[o.jsxs(oO,{value:r||"__all__",onValueChange:b=>{s(b==="__all__"?"":b),n(null),i(null)},children:[o.jsx(tb,{className:"w-full rounded-2xl px-4 py-6 bg-background",children:o.jsx(lO,{placeholder:"Select county"})}),o.jsxs(nb,{className:"max-h-72",children:[o.jsx(Cm,{value:"__all__",children:"All counties"}),F.map(b=>o.jsx(Cm,{value:b,children:b},b))]})]}),o.jsx("input",{type:"text",placeholder:"Enter town / area (optional)",value:l,onCh
678ange:b=>{u(b.target.value),n(null),i(null)},className:"w-full border rounded-2xl px-4 py-3 outline-none focus:ring-2 focus:ring-ring bg-background"})]}),c&&o.jsx("div",{className:"rounded-2xl bg-muted px-4 py-3 text-sm text-muted-foreground",children:c})]}),o.jsxs("div",{className:"bg-card rounded-3xl shadow-sm border p-6 space-y-4",children:[o.jsx("h2",{className:"text-xl font-semibold",children:"Documents Needed"}),o.jsxs("ul",{className:"space-y-3 text-foreground",children:[o.jsx("li",{className:"rounded-2xl bg-muted p-4 border",children:"â
Original National ID or valid Kenyan passport"}),o.jsx("li",{className:"rounded-2xl bg-muted p-4 border",children:"â
Be a Kenyan citizen and eligible to register as a voter"}),o.jsx("li",{className:"rounded-2xl bg-muted p-4 border",children:"â
Make sure your identification details are clear and valid"})]}),o.jsx("div",{className:"rounded-2xl bg-accent border p-4 text-sm text-accent-foreground",children:"Tip: Carry your original document, not a photocopy."})]})]}),o.jsxs("section",{className:"bg-card rounded-3xl shadow-sm border p-6",children:[o.jsx("h2",{className:"text-xl font-semibold mb-4",children:"Recommended Center"}),V?o.jsx("div",{className:"rounded-3xl border bg-primary/5 border-primary/30 p-5",children:o.jsxs("div",{className:"flex flex-col md:flex-row md:items-start md:justify-between gap-4",children:[o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-medium text-primary mb-2",children:"Best option for you"}),o.jsx("h3",{className:"text-2xl font-bold",children:V.name}),o.jsx("p",{className:"text-foreground mt-2",children:V.address}),o.jsxs("p",{className:"text-muted-foreground",children:[V.county," ⢠",V.town]}),o.jsx("p",{className:"text-muted-foreground",children:V.hours}),V.distance!==null&&o.jsxs("p",{className:"mt-2 font-medium",children:["Approx. ",V.distance.toFixed(1)," km away"]})]}),o.jsxs("div",{className:"flex flex-col gap-3",children:[o.jsx("a",{href:`https://www.google.com/maps/search/?api=1&query=${V.latitude},${V.longitude}`,target:"_blank",rel:"noreferrer",className:"bg-primary text-primary-foreground text-center rounded-2xl px-4 py-3 font-medium hover:opacity-90 transition",children:"Get Directions"}),o.jsx("button",{onClick:()=>v(V.id),className:"border rounded-2xl px-4 py-3 font-medium hover:bg-muted transition",children:"Select This Center"})]})]})}):o.jsx("div",{className:"rounded-2xl bg-muted border p-5 text-muted-foreground",children:"Enter your location or use GPS to get a recommendation."})]}),o.jsxs("section",{className:"bg-card rounded-3xl shadow-sm border p-6",children:[o.jsx("h2",{className:"text-xl font-semibold mb-4",children:"Nearby Centers"}),Y.length>0?o.jsx("div",{className:"grid md:grid-cols-2 gap-4",children:Y.map(b=>o.jsxs("div",{className:`rounded-2xl border p-4 ${(z==null?void 0:z.id)===b.id?"border-primary bg-muted":"border-border"}`,children:[o.jsx("h3",{className:"font-semibold text-lg",children:b.name}),o.jsx("p",{className:"text-foreground",children:b.address}),o.jsxs("p",{className:"text-muted-foreground",children:[b.county," ⢠",b.town]}),o.jsx("p",{className:"text-muted-foreground",children:b.hours}),b.distance!==null&&o.jsxs("p",{className:"text-sm mt-2",children:[b.distance.toFixed(1)," km away"]}),o.jsxs("div",{className:"flex gap-3 mt-4",children:[o.jsx("button",{onClick:()=>v(b.id),className:"flex-1 border rounded-2xl px-4 py-2 font-medium hover:bg-muted transition",children:"Select"}),o.jsx("a",{href:`https://www.google.com/maps/search/?api=1&query=${b.latitude},${b.longitude}`,target:"_blank",rel:"noreferrer",className:"flex-1 bg-primary text-primary-foreground text-center rounded-2xl px-4 py-2 font-medium hover:opacity-90 transition",children:"Directions"})]})]},b.id))}):o.jsx("div",{className:"rounded-2xl bg-muted border p-5 text-muted-foreground",children:"No centers to show yet. Add a location first."})]}),o.jsxs("section",{className:"grid md:grid-cols-2 gap-6",children:[o.jsxs("div",{className:"bg-card rounded-3xl shadow-sm border p-6 space-y-4",children:[o.jsx("h2",{className:"text-xl font-semibold",children:"Plan Your Registration Visit"}),o.jsxs("div",{children:[o.jsx("label",{className:"block text-sm font-medium mb-2",children:"Selected center"}),o.jsx("div",{className:"rounded-2xl border px-4 py-3 bg-muted",children:z?z.name:"No center selected yet"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"block text-sm font-medium mb-2",children:"Appointment date"}),o.jsx("input",{type:"date",value:f,onChange:b=>y(b.target.value),className:"w-full border rounded-2xl px-4 py-3 outline-none focus:ring-2 focus:ring-ring bg-background"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"block text-sm font-medium mb-2",children:"Appointment time"}),o.jsx("input",{type:"time",value:g,onChange:b=>x(b.target.value),className:"w-full border rounded-2xl px-4 py-3 outline-none focus:ring-2 focus:ring-ring bg-background"})]}),o.jsx("button",{onClick:I,disabled:k,className:"w-full bg-primary text-primary-foreground rounded-2xl px-4 py-3 font-medium hover:opacity-90 transition disabled:opacity-60",children:k?"S
678aving...":"Save Appointment Plan"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"This schedules a personal plan inside CLICK. You can later connect it to an official booking system if available."})]}),o.jsxs("div",{className:"bg-card rounded-3xl shadow-sm border p-6 space-y-4",children:[o.jsx("h2",{className:"text-xl font-semibold",children:"Set Reminder"}),o.jsxs("select",{value:d,onChange:b=>m(b.target.value),className:"w-full border rounded-2xl px-4 py-3 outline-none focus:ring-2 focus:ring-ring bg-background",children:[o.jsx("option",{children:"50 days before"}),o.jsx("option",{children:"30 days before"}),o.jsx("option",{children:"7 days before"}),o.jsx("option",{children:"2 days before"}),o.jsx("option",{children:"1 day before"})]}),o.jsx("button",{onClick:M,disabled:S,className:"w-full bg-primary text-primary-foreground rounded-2xl px-4 py-3 font-medium hover:opacity-90 transition disabled:opacity-60",children:S?"Saving...":"Save Reminder"}),o.jsxs("div",{className:"rounded-2xl bg-muted border p-4 text-sm text-foreground",children:["Example reminders:",o.jsxs("ul",{className:"list-disc ml-5 mt-2 space-y-1",children:[o.jsx("li",{children:"50 days to registration"}),o.jsx("li",{children:"2 days to your planned visit"}),o.jsx("li",{children:"Tomorrow is your registration day"})]})]})]})]}),o.jsxs("section",{className:"grid md:grid-cols-2 gap-6",children:[o.jsxs("div",{className:"bg-card rounded-3xl shadow-sm border p-6 space-y-4",children:[o.jsx("h2",{className:"text-xl font-semibold",children:"How to Register"}),o.jsxs("ol",{className:"space-y-3 text-foreground list-decimal ml-5",children:[o.jsx("li",{children:"Confirm that you are eligible to register as a voter."}),o.jsx("li",{children:"Carry your original National ID or valid passport."}),o.jsx("li",{children:"Go to the recommended or selected registration center."}),o.jsx("li",{children:"Follow the officer's instructions during registration."}),o.jsx("li",{children:"Confirm your details before leaving the center."})]})]}),o.jsxs("div",{className:"bg-card rounded-3xl shadow-sm border p-6 space-y-4",children:[o.jsx("h2",{className:"text-xl font-semibold",children:"What to Wear / Expect"}),o.jsxs("ul",{className:"space-y-3 text-foreground",children:[o.jsx("li",{children:"⢠Dress decently and comfortably."}),o.jsx("li",{children:"⢠Carry your original identification document."}),o.jsx("li",{children:"⢠Be prepared for queues, especially during busy days."}),o.jsx("li",{children:"⢠Keep your phone charged in case you need directions."}),o.jsx("li",{children:"⢠Arrive early where possible."})]})]})]}),o.jsxs("section",{className:"bg-foreground text-background rounded-3xl p-6 md:p-8",children:[o.jsx("h2",{className:"text-2xl font-bold mb-3",children:"Uko Kadi?"}),o.jsx("p",{className:"opacity-80 max-w-2xl mb-5",children:"Register early. Stay ready. Let CLICK guide you through the voter registration journey with the information you need in one place."}),o.jsx("button",{type:"button",onClick:()=>window.open("https://www.iebc.or.ke/registration/?how","_blank","noopener,noreferrer"),className:"inline-block bg-background text-foreground rounded-2xl px-5 py-3 font-medium hover:opacity-90 transition",children:"Visit Official IEBC Registration Page"})]})]})})}function Tm({className:e,...t}){return o.jsx("div",{className:ce("animate-pulse rounded-md bg-muted",e),...t})}var dO=["PageUp","PageDown"],hO=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],mO={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Ol="Slider",[Gw,Une,Vne]=pl(Ol),[fO,bie]=Yt(Ol,[Vne]),[Hne,Bf]=fO(Ol),pO=p.forwardRef((e,t)=>{const{name:n,min:a=0,max:i=100,step:r=1,orientation:s="horizontal",disabled:l=!1,minStepsBetweenThumbs:u=0,defaultValue:c=[a],value:h,onValueChange:d=()=>{},onValueCommit:m=()=>{},inverted:f=!1,form:y,...g}=e,x=p.useRef(new Set),w=p.useRef(0),k=s==="horizontal"?Wne:qne,[j=[],S]=ma({prop:h,defaultProp:c,onChange:R=>{var Y;(Y=[...x.current][w.current])==null||Y.focus(),d(R)}}),_=p.useRef(j);function T(R){const F=Xne(j,R);
678A(R,F)}function E(R){A(R,w.current)}function O(){const R=_.current[w.current];j[w.current]!==R&&m(j)}function A(R,F,{commit:Y}={commit:!1}){const V=nae(r),z=aae(Math.round((R-a)/r)*r+a,V),W=Sm(z,[a,i]);S((B=[])=>{const M=Jne(B,W,F);if(tae(M,u*r)){w.current=M.indexOf(W);const I=String(M)!==String(B);return I&&Y&&m(M),I?M:B}else return B})}return o.jsx(Hne,{scope:e.__scopeSlider,name:n,disabled:l,min:a,max:i,valueIndexToChangeRef:w,thumbs:x.current,values:j,orientation:s,form:y,children:o.jsx(Gw.Provider,{scope:e.__scopeSlider,children:o.jsx(Gw.Slot,{scope:e.__scopeSlider,children:o.jsx(k,{"aria-disabled":l,"data-disabled":l?"":void 0,...g,ref:t,onPointerDown:ue(g.onPointerDown,()=>{l||(_.current=j)}),min:a,max:i,inverted:f,onSlideStart:l?void 0:T,onSlideMove:l?void 0:E,onSlideEnd:l?void 0:O,onHomeKeyDown:()=>!l&&A(a,0,{commit:!0}),onEndKeyDown:()=>!l&&A(i,j.length-1,{commit:!0}),onStepKeyDown:({event:R,direction:F})=>{if(!l){const z=dO.includes(R.key)||R.shiftKey&&hO.includes(R.key)?10:1,W=w.current,B=j[W],M=r*z*F;A(B+M,W,{commit:!0})}}})})})})});pO.displayName=Ol;var[gO,yO]=fO(Ol,{startEdge:"left",endEdge:"right",size:"width",direction:1}),Wne=p.forwardRef((e,t)=>{const{min:n,max:a,dir:i,inverted:r,onSlideStart:s,onSlideMove:l,onSlideEnd:u,onStepKeyDown:c,...h}=e,[d,m]=p.useState(null),f=Pe(t,k=>m(k)),y=p.useRef(void 0),g=Sl(i),x=g==="ltr",w=x&&!r||!x&&r;function v(k){const j=y.current||d.getBoundingClientRect(),S=[0,j.width],T=ab(S,w?[n,a]:[a,n]);return y.current=j,T(k-j.left)}return o.jsx(gO,{scope:e.__scopeSlider,startEdge:w?"left":"right",endEdge:w?"right":"left",direction:w?1:-1,size:"width",children:o.jsx(wO,{dir:g,"data-orientation":"horizontal",...h,ref:f,style:{...h.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:k=>{const j=v(k.clientX);s==null||s(j)},onSlideMove:k=>{const j=v(k.clientX);l==null||l(j)},onSlideEnd:()=>{y.current=void 0,u==null||u()},onStepKeyDown:k=>{const S=mO[w?"from-left":"from-right"].includes(k.key);c==null||c({event:k,direction:S?-1:1})}})})}),qne=p.forwardRef((e,t)=>{const{min:n,max:a,inverted:i,onSlideStart:r,onSlideMove:s,onSlideEnd:l,onStepKeyDown:u,...c}=e,h=p.useRef(null),d=Pe(t,h),m=p.useRef(void 0),f=!i;function y(g){const x=m.current||h.current.getBoundingClientRect(),w=[0,x.height],k=ab(w,f?[a,n]:[n,a]);return m.current=x,k(g-x.top)}return o.jsx(gO,{scope:e.__scopeSlider,startEdge:f?"bottom":"top",endEdge:f?"top":"bottom",size:"height",direction:f?1:-1,children:o.jsx(wO,{"data-orientation":"vertical",...c,ref:d,style:{...c.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:g=>{const x=y(g.clientY);r==null||r(x)},onSlideMove:g=>{const x=y(g.clientY);s==null||s(x)},onSlideEnd:()=>{m.current=void 0,l==null||l()},onStepKeyDown:g=>{const w=mO[f?"from-bottom":"from-top"].includes(g.key);u==null||u({event:g,direction:w?-1:1})}})})}),wO=p.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:a,onSlideMove:i,onSlideEnd:r,onHomeKeyDown:s,onEndKeyDown:l,onStepKeyDown:u,...c}=e,h=Bf(Ol,n);return o.jsx(we.span,{...c,ref:t,onKeyDown:ue(e.onKeyDown,d=>{d.key==="Home"?(s(d),d.preventDefault()):d.key==="End"?(l(d),d.preventDefault()):dO.concat(hO).includes(d.key)&&(u(d),d.preventDefault())}),onPointerDown:ue(e.onPointerDown,d=>{const m=d.target;m.setPointerCapture(d.pointerId),d.preventDefault(),h.thumbs.has(m)?m.focus():a(d)}),onPointerMove:ue(e.onPointerMove,d=>{d.target.hasPointerCapture(d.pointerId)&&i(d)}),onPointerUp:ue(e.onPointerUp,d=>{const m=d.target;m.hasPointerCapture(d.pointerId)&&(m.releasePointerCapture(d.pointerId),r(d))})})}),xO="SliderTrack",kO=p.forwardRef((e,t)=>{const{__scopeSlider:n,...a}=e,i=Bf(xO,n);return o.jsx(we.span,{"data-disabled":i.disabled?"":void 0,"data-orientation":i.orientation,...a,ref:t})});kO.displayName=xO;var Yw="SliderRange",vO=p.forwardRef((e,t)=>{const{__scopeSlider:n,...a}=e,i=Bf(Yw,n),r=yO(Yw,n),s=p.useRef(null),l=Pe(t,s),u=i.values.length,c=i.values.map(m=>_O(m,i.min,i.max)),h=u>1?Math.min(...c):0,d=100-Math.max(...c);return o.jsx(we.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,...a,ref:l,style:{...e.style,[r.startEdge]:h+"%",[r.endEdge]:d+"%"}})});vO.displayName=Yw;var Jw="SliderThumb",bO=p.forwardRef((e,t)=>
678{const n=Une(e.__scopeSlider),[a,i]=p.useState(null),r=Pe(t,l=>i(l)),s=p.useMemo(()=>a?n().findIndex(l=>l.ref.current===a):-1,[n,a]);return o.jsx(Gne,{...e,ref:r,index:s})}),Gne=p.forwardRef((e,t)=>{const{__scopeSlider:n,index:a,name:i,...r}=e,s=Bf(Jw,n),l=yO(Jw,n),[u,c]=p.useState(null),h=Pe(t,v=>c(v)),d=u?s.form||!!u.closest("form"):!0,m=uk(u),f=s.values[a],y=f===void 0?0:_O(f,s.min,s.max),g=Qne(a,s.values.length),x=m==null?void 0:m[l.size],w=x?Zne(x,y,l.direction):0;return p.useEffect(()=>{if(u)return s.thumbs.add(u),()=>{s.thumbs.delete(u)}},[u,s.thumbs]),o.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[l.startEdge]:`calc(${y}% + ${w}px)`},children:[o.jsx(Gw.ItemSlot,{scope:e.__scopeSlider,children:o.jsx(we.span,{role:"slider","aria-label":e["aria-label"]||g,"aria-valuemin":s.min,"aria-valuenow":f,"aria-valuemax":s.max,"aria-orientation":s.orientation,"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,tabIndex:s.disabled?void 0:0,...r,ref:h,style:f===void 0?{display:"none"}:e.style,onFocus:ue(e.onFocus,()=>{s.valueIndexToChangeRef.current=a})})}),d&&o.jsx(jO,{name:i??(s.name?s.name+(s.values.length>1?"[]":""):void 0),form:s.form,value:f},a)]})});bO.displayName=Jw;var Yne="RadioBubbleInput",jO=p.forwardRef(({__scopeSlider:e,value:t,...n},a)=>{const i=p.useRef(null),r=Pe(i,a),s=Hv(t);return p.useEffect(()=>{const l=i.current;if(!l)return;const u=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(u,"value").set;if(s!==t&&h){const d=new Event("input",{bubbles:!0});h.call(l,t),l.dispatchEvent(d)}},[s,t]),o.jsx(we.input,{style:{display:"none"},...n,ref:r,defaultValue:t})});jO.displayName=Yne;function Jne(e=[],t,n){const a=[...e];return a[n]=t,a.sort((i,r)=>i-r)}function _O(e,t,n){const r=100/(n-t)*(e-t);return Sm(r,[0,100])}function Qne(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function Xne(e,t){if(e.length===1)return 0;const n=e.map(i=>Math.abs(i-t)),a=Math.min(...n);return n.indexOf(a)}function Zne(e,t,n){const a=e/2,r=ab([0,50],[0,a]);return(a-r(t)*n)*n}function eae(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function tae(e,t){if(t>0){const n=eae(e);return Math.min(...n)>=t}return!0}function ab(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const a=(t[1]-t[0])/(e[1]-e[0]);return t[0]+a*(n-e[0])}}function nae(e){return(String(e).split(".")[1]||"").length}function aae(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var SO=pO,iae=kO,rae=vO,sae=bO;const Zc=p.forwardRef(({className:e,...t},n)=>o.jsxs(SO,{ref:n,className:ce("relative flex w-full touch-none select-none items-center",e),...t,children:[o.jsx(iae,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:o.jsx(rae,{className:"absolute h-full bg-primary"})}),o.jsx(sae,{className:"block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"})]}));Zc.displayName=SO.displayName;const NO="/assets/issue-jobs-DKK-gAbi.png",oae="/assets/issue-education-DO1_JLl_.png",lae="/assets/issue-healthcare-09D4bxJw.png",uae="/assets/issue-taxes-CyOgTGai.png",cae="/assets/issue-corruption-B5rKlTmq.png",dae="/assets/issue-infrastructure-CQBfHksB.png",hae="/assets/issue-youth-DQU30WsV.png",mae="/assets/issue-digital-DI_j4Lsx.png",fae="/assets/issue-agriculture-DutGVVpb.png",pae="/assets/issue-security-DXvb8mtQ.png",gae={Jobs:{icon:NO,gradient:"from-emerald-500/30 via-amber-400/20 to-emerald-700/30",ring:"ring-emerald-400/40",emoji:"ð¼"},Education:{icon:oae,gradient:"from-blue-500/30 via-yellow-400/20 to-indigo-600/30",ring:"ring-blue-400/40",emoji:"ð"},Healthcare:{icon:lae,gradient:"from-rose-500/30 via-pink-300/20 to-red-600/30",ring:"ring-rose-400/40",emoji:"â¤ï¸"},Taxes:{icon:uae,gradient:"from-yellow-400/30 via-teal-400/20 to-amber-600/30",ring:"ring-amber-400/40",emoji:"ðª"},Corruption:{icon:cae,gradient:"from-purple-500/30 via-amber-400/20 to-violet-700/30",ring:"ring-purple-400/40",emoji:"ð¡ï¸"}
678,Infrastructure:{icon:dae,gradient:"from-orange-500/30 via-slate-400/20 to-orange-700/30",ring:"ring-orange-400/40",emoji:"ð£ï¸"},"Youth Opportunities":{icon:hae,gradient:"from-pink-500/30 via-cyan-400/20 to-fuchsia-600/30",ring:"ring-pink-400/40",emoji:"ð"},"Digital Access":{icon:mae,gradient:"from-cyan-400/30 via-lime-400/20 to-blue-600/30",ring:"ring-cyan-400/40",emoji:"ð±"},Agriculture:{icon:fae,gradient:"from-green-500/30 via-yellow-400/20 to-lime-700/30",ring:"ring-green-400/40",emoji:"ð"},Security:{icon:pae,gradient:"from-blue-700/30 via-slate-300/20 to-indigo-900/30",ring:"ring-blue-500/40",emoji:"ð¡ï¸"}},Wd=e=>gae[e]??{icon:NO,gradient:"from-primary/20 via-accent/10 to-primary/30",ring:"ring-primary/40",emoji:"â¨"},yae="anthem-instrumental.mp3",wae="game-audio";function xae(){const e=p.useRef(null),[t,n]=p.useState(!1),[a,i]=p.useState(!1),[r,s]=p.useState(!1);p.useEffect(()=>{const{data:m}=te.storage.from(wae).getPublicUrl(yae);if(!(m!=null&&m.publicUrl))return;let f=!1;return fetch(m.publicUrl,{method:"HEAD"}).then(y=>{if(f||!y.ok)return;const g=new Audio(m.publicUrl);g.loop=!0,g.volume=.35,g.preload="auto",e.current=g,n(!0)}).catch(()=>{}),()=>{var y;f=!0,(y=e.current)==null||y.pause(),e.current=null}},[]);const l=p.useCallback(async()=>{const m=e.current;if(m)try{await m.play(),i(!0)}catch{i(!1)}},[]),u=p.useCallback(()=>{var m;(m=e.current)==null||m.pause(),i(!1)},[]),c=p.useCallback(()=>{e.current&&(a?u():l())},[a,l,u]),h=p.useCallback(m=>{e.current&&(e.current.volume=Math.max(0,Math.min(1,m)))},[]),d=p.useCallback(()=>{if(!e.current)return;const m=!r;e.current.muted=m,s(m)},[r]);return{available:t,playing:a,muted:r,play:l,pause:u,toggle:c,toggleMute:d,setVolume:h}}const kae="/assets/ruto-DXWDjEQF.jpg",vae="/assets/mwangi-lRpb-RUF.jpeg",bae="/assets/maraga-CqSOgeSq.jpeg",uS="/assets/matiangi-BWdJfqrG.jpg",jae="/assets/karua-Dgqb-pxZ.webp",_ae=["President","Governor","Senator","MP","MCA","Woman Representative"],Sae=["Jobs","Education","Healthcare","Taxes","Corruption","Infrastructure","Youth Opportunities","Digital Access","Agriculture","Security"],qd="pickAndVote.savedGame.v2",Nae=()=>{var U;const{t:e,lang:t}=Re(),{user:n}=Rt(),a=xae(),[i,r]=p.useState([]),[s,l]=p.useState(!0),[u,c]=p.useState("President"),[h,d]=p.useState(["Jobs","Education","Healthcare"]),[m,f]=p.useState(5),[y,g]=p.useState(!1),[x,w]=p.useState([]),[v,k]=p.useState(0),[j,S]=p.useState({}),[_,T]=p.useState([]),[E,O]=p.useState({}),[A,R]=p.useState(null),[F,Y]=p.useState(!1),[V,z]=p.useState(!1),[W,B]=p.useState(!1);p.useEffect(()=>{let P=!0;return(async()=>{l(!0);const{data:L,error:H}=await te.from("manifesto_cards").select("*").eq("is_published",!0);P&&(H?nn.error(e("Failed to load manifesto cards")):r((L||[]).map(Z=>({...Z,promises_en:Array.isArray(Z.promises_en)?Z.promises_en:[],promises_sw:Array.isArray(Z.promises_sw)?Z.promises_sw:[]}))),l(!1))})(),()=>{P=!1}},[e]),p.useEffect(()=>{try{const P=localStorage.getItem(qd);if(P){const L=JSON.parse(P);(L==null?void 0:L.v)===2&&Array.isArray(L.rounds)&&L.rounds.length>0&&B(!0)}}catch{}},[]);const M=p.useMemo(()=>i.filter(P=>P.office===u&&(h.length===0||h.includes(P.issue))),[i,u,h]),I=p.useMemo(()=>{const P={};return i.forEach(L=>{P[L.office]=(P[L.office]||0)+1}),P},[i]),b=p.useMemo(()=>{const P={};return i.forEach(L=>{L.office===u&&(P[L.issue]=(P[L.issue]||0)+1)}),P},[i,u]),C=p.useMemo(()=>{const P={};return M.forEach(L=>{var H;(P[H=L.issue]||(P[H]=[])).push(L)}),Object.entries(P).filter(([,L])=>L.length>=2).map(([L,H])=>({issue:L,cards:H}))},[M]),D=C.length;p.useEffect(()=>{D!==0&&(m>D&&f(D),m<1&&D>=1&&f(Math.min(5,D)))},[D]);const N=x[v],J=(P,L,H,Z,Ae)=>{try{const je={v:2,office:u,selectedIssues:h,rounds:P,currentRound:L,selections:H,chosenCards:Z,pickedCardIdsByRound:Ae};localStorage.setItem(qd,JSON.stringify(je)),B(!0)}catch{}},re=()=>{try{localStorage.removeItem(qd)}catch{}B(!1)},ee=p.useMemo(()=>{const P={};return x.forEach(L=>L.cards.forEach(H=>{P[H.candidate_id]||(P[H.candidate_id]={candidateId:H.candidate_id,candidateName:H.candidate_name,party:H.party,score:0,matchedIssues:[]})}
678)),Object.entries(j).forEach(([L,H])=>{P[L]&&(P[L].score=H)}),_.forEach(L=>{const H=x.flatMap(Z=>Z.cards).find(Z=>Z.id===L);H&&P[H.candidate_id]&&!P[H.candidate_id].matchedIssues.includes(H.issue)&&P[H.candidate_id].matchedIssues.push(H.issue)}),Object.values(P).sort((L,H)=>H.score-L.score)},[x,j,_]),G={"william ruto":kae,"boniface mwangi":vae,"david maraga":bae,"fred matiang'i":uS,"fred matiangi":uS,"martha karua":jae},ie=p.useMemo(()=>{const P={};return i.forEach(L=>{if(P[L.candidate_id])!P[L.candidate_id].sourceUrl&&L.source_url&&(P[L.candidate_id].sourceUrl=L.source_url,P[L.candidate_id].sourceName=L.source_name||P[L.candidate_id].sourceName);else{const H=L.candidate_name.trim().toLowerCase();P[L.candidate_id]={sourceUrl:L.source_url||null,sourceName:L.source_name||null,photoUrl:G[H]||null}}}),P},[i]),q=P=>P.split(/\s+/).filter(Boolean).slice(0,2).map(L=>{var H;return((H=L[0])==null?void 0:H.toUpperCase())||""}).join(""),ae=P=>d(L=>L.includes(P)?L.filter(H=>H!==P):[...L,P]),de=()=>{const P=[...C].sort(()=>Math.random()-.5).slice(0,Math.min(m,C.length)).map(L=>({...L,cards:[...L.cards].sort(()=>Math.random()-.5)}));w(P),g(!0),k(0),S({}),T([]),O({}),R(null),Y(!1),J(P,0,{},[],{}),a.available&&!a.playing&&a.play()},me=()=>{try{const P=localStorage.getItem(qd);if(!P)return;const L=JSON.parse(P);if((L==null?void 0:L.v)!==2)return;c(L.office),d(L.selectedIssues||[]),w(L.rounds),k(L.currentRound||0),S(L.selections||{}),T(L.chosenCards||[]),O(L.pickedCardIdsByRound||{}),R(null),Y(!1),g(!0),nn.success(e("Game resumed"))}catch{nn.error(e("Could not resume previous game"))}},Ce=async(P,L)=>{if(!n)return;z(!0);const{error:H}=await te.from("manifesto_match_results").insert({user_id:n.id,office:u,selected_issues:h,scores:P,chosen_card_ids:L});z(!1),H?nn.error(e("Could not save your result")):(nn.success(e("Result saved to your account")),Es(async()=>{const{awardCivicPoints:Z}=await Promise.resolve().then(()=>ol);return{awardCivicPoints:Z}},void 0).then(({awardCivicPoints:Z})=>{Z("manifesto_match_complete",{refType:"office",refId:u})}))},ke=P=>{if(!N||E[v])return;R(P.id);const L={...j,[P.candidate_id]:(j[P.candidate_id]||0)+1},H=[..._,P.id],Z={...E,[v]:P.id};S(L),T(H),O(Z),J(x,v,L,H,Z)},Ve=()=>{if(!N||E[v])return;const P={...E,[v]:"__skipped__"};O(P),J(x,v,j,_,P),We()},We=()=>{if(R(null),v+1<x.length){const P=v+1;k(P),J(x,P,j,_,E)}else Ge()},Ge=()=>{Y(!0),re(),a.playing&&a.pause();const P={};x.forEach(H=>H.cards.forEach(Z=>{P[Z.candidate_id]||(P[Z.candidate_id]={candidateId:Z.candidate_id,candidateName:Z.candidate_name,party:Z.party,score:0,matchedIssues:[]})})),Object.entries(j).forEach(([H,Z])=>{P[H]&&(P[H].score=Z)}),_.forEach(H=>{const Z=x.flatMap(Ae=>Ae.cards).find(Ae=>Ae.id===H);Z&&P[Z.candidate_id]&&!P[Z.candidate_id].matchedIssues.includes(Z.issue)&&P[Z.candidate_id].matchedIssues.push(Z.issue)});const L=Object.values(P).sort((H,Z)=>Z.score-H.score);Ce(L,_)},ht=()=>{g(!1),w([]),k(0),S({}),T([]),O({}),R(null),Y(!1),re(),a.playing&&a.pause()},mt=P=>t==="sw"&&P.title_sw?P.title_sw:P.title_en,st=P=>t==="sw"&&P.promises_sw&&P.promises_sw.length?P.promises_sw:P.promises_en,$=P=>st(P)[0]||mt(P),he=((U=ee[0])==null?void 0:U.score)||1,xe=()=>a.available?o.jsxs("div",{className:"flex items-center gap-1.5 rounded-full border border-primary/30 bg-background/80 p-1 pl-3 backdrop-blur",children:[o.jsx(CD,{className:"h-3.5 w-3.5 text-primary"}),o.jsx("span",{className:"text-xs font-medium text-foreground",children:e("Anthem music")}),o.jsx(Q,{size:"sm",variant:a.playing?"default":"outline",className:"h-7 rounded-full px-2",onClick:a.toggle,"aria-label":a.playing?e("Pause"):e("Play"),children:a.playing?o.jsx(TD,{className:"h-3 w-3"}):o.jsx(AD,{className:"h-3 w-3"})}),a.playing&&o.jsx(Q,{size:"sm",variant:"ghost",className:"h-7 rounded-full px-2",onClick:a.toggleMute,"aria-label":a.muted?e("Unmute"):e("Mute"),children:o.jsx(KD,{className:ce("h-3 w-3",a.muted&&"text-destructive")}
678)})]}):null,Me=[{label:e("Quick (3)"),value:3},{label:e("Standard (5)"),value:5},{label:e("Deep (10)"),value:10},{label:e("Marathon (All)"),value:D||1}],be=N?E[v]:void 0;return o.jsxs("div",{className:"space-y-6 pb-6",children:[o.jsxs("div",{className:"relative overflow-hidden rounded-2xl border border-primary/30 bg-gradient-to-br from-primary/20 via-accent/10 to-primary/30 p-6 md:p-10",children:[o.jsx("div",{className:"absolute -right-10 -top-10 h-48 w-48 rounded-full bg-accent/20 blur-3xl"}),o.jsx("div",{className:"absolute -left-10 bottom-0 h-48 w-48 rounded-full bg-primary/30 blur-3xl"}),o.jsxs("div",{className:"relative",children:[o.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[o.jsxs(Ze,{className:"gap-1.5 text-accent-foreground bg-info",variant:"default",children:[o.jsx(Hn,{className:"h-3 w-3"}),e("PICK & VOTE")]}),o.jsx(xe,{})]}),o.jsxs("h1",{className:"mt-4 font-heading text-4xl font-extrabold leading-tight text-foreground md:text-5xl",children:["ð°ðª ",e("Pick the promises. Skip the noise.")]}),o.jsx("p",{className:"mt-3 max-w-2xl text-base text-muted-foreground md:text-lg",children:e("A blind tournament of manifesto promises. No names, no parties â just ideas. You decide who wins your vote.")})]})]}),s&&o.jsxs("div",{className:"space-y-4",children:[o.jsx(Tm,{className:"h-32 w-full"}),o.jsx(Tm,{className:"h-48 w-full"})]}),!s&&!y&&W&&o.jsx(X,{className:"border-accent/40 bg-gradient-to-r from-accent/15 to-primary/10",children:o.jsxs(en,{className:"flex flex-col gap-3 p-5 sm:flex-row sm:items-center sm:justify-between",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx(ID,{className:"h-5 w-5 text-accent"}),o.jsxs("div",{children:[o.jsx("p",{className:"font-heading font-bold text-foreground",children:e("Unfinished game found")}),o.jsx("p",{className:"text-sm text-muted-foreground",children:e("Pick up where you left off, or start a fresh round.")})]})]}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx(Q,{onClick:me,children:e("Resume game")}),o.jsx(Q,{variant:"outline",onClick:re,children:e("Discard")})]})]})}),!s&&!y&&o.jsxs("div",{className:"space-y-6",children:[o.jsxs(X,{children:[o.jsx(hr,{children:o.jsxs(mr,{className:"flex items-center gap-2 text-lg",children:[o.jsx(Wn,{className:"h-4 w-4 text-primary"}),e("Choose Election Level")]})}),o.jsx(en,{children:o.jsx("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3",children:_ae.map(P=>{const L=u===P,H=I[P]||0;return o.jsxs("button",{onClick:()=>c(P),className:ce("group relative overflow-hidden rounded-xl border p-4 text-left transition-all",L?"border-primary bg-primary/10 shadow-md ring-2 ring-primary/30":"border-border bg-card hover:border-primary/50 hover:shadow-sm"),children:[o.jsx("p",{className:"font-heading text-sm font-bold text-foreground",children:e(P)}),o.jsxs("p",{className:"mt-1 text-xs text-muted-foreground",children:[H," ",e(H===1?"card":"cards")]})]},P)})})})]}),o.jsxs(X,{children:[o.jsx(hr,{children:o.jsxs(mr,{className:"flex items-center gap-2 text-lg",children:[o.jsx(_2,{className:"h-4 w-4 text-accent"}),e("Select Your Priority Issues")]})}),o.jsx(en,{className:"space-y-4",children:o.jsx("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3 lg:grid-cols-5",children:Sae.map(P=>{const L=h.includes(P),H=b[P]||0,Z=Wd(P);return o.jsxs("button",{onClick:()=>ae(P),className:ce("group relative overflow-hidden rounded-2xl border-2 p-3 text-center transition-all hover:scale-[1.03]","bg-gradient-to-br",Z.gradient,L?ce("border-primary shadow-lg ring-2",Z.ring):"border-border/40 opacity-80 hover:opacity-100"),children:[o.jsx("img",{src:Z.icon,alt:P,loading:"lazy",width:64,height:64,className:"mx-auto h-14 w-14 object-contain drop-shadow-sm"}),o.jsx("p",{className:"mt-1 font-heading text-xs font-bold text-foreground",children:e(P)}),o.jsxs("p",{className:"text-[10px] text-foreground/70",children:[H," ",e(H===1?"card":"cards")]}),L&&o.jsx("span",{className:"absolute right-1.5 top-1.5 flex h-5 w-5 items-center justify-center rounded-full bg-primary text-[10px] font-bold text-primary-foreground",children:"â"})]},P)})})})]}),o.jsxs(X,{className:"border-primary/30 bg-gradient-to-br from-accent/10 via-background to-primary/10",children:[o.jsx(hr,{children:o.jsxs(mr,{className:"flex items-center gap-2 text-lg",children:["ð¯ ",e("How many rounds?")]})}),o.jsxs(en,{className:"space-y-5",children:[o.jsx("p",{className:"text-sm text-muted-foreground",children:e("Each round shows one issue with all candidates' anonymous flashcards. Pick the one that matches your values.")}),o.jsxs("div",{className:"flex items-baseline justify-center gap-2 py-2",children:[o.jsx("span",{className:"font-heading text-6xl font-extrabold text-primary md:text-7xl",children:m}),o.jsx("span",{className:"font-heading text-xl font-medium text-muted-foreground",children:e(m===1?"round":"rounds")})]}),o.jsxs("div",{className:"px-1",children:[o.jsx(Zc,{min:1,max:Math.max(1,D||
6781),step:1,value:[Math.min(m,Math.max(1,D||1))],onValueChange:P=>f(P[0]),disabled:D<1}),o.jsxs("div",{className:"mt-2 flex justify-between text-xs text-muted-foreground",children:[o.jsx("span",{children:"1"}),o.jsxs("span",{children:[Math.max(1,D||1)," ",e("rounds")]})]})]}),o.jsx("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-4",children:Me.map(P=>o.jsx(Q,{variant:m===P.value?"default":"outline",size:"sm",disabled:D<1,onClick:()=>f(Math.max(1,Math.min(P.value,D))),children:P.label},P.label))}),o.jsxs(Ze,{variant:D===0?"destructive":"secondary",className:"gap-1",children:[M.length," ",M.length===1?e("card available"):e("cards available")," · ",D," ",e("rounds")," ",e("available")]})]})]}),o.jsxs(X,{className:"overflow-hidden border-primary/40 bg-gradient-to-r from-primary via-primary/90 to-accent",children:[o.jsxs(en,{className:"flex flex-col items-center gap-4 p-6 text-center md:flex-row md:justify-between md:text-left",children:[o.jsxs("div",{children:[o.jsx("h3",{className:"font-heading text-2xl font-extrabold text-primary-foreground",children:e("Let's play!")}),o.jsx("p",{className:"text-sm text-primary-foreground/90",children:e("Read each anonymous flashcard, pick your favorite, and the card flips to reveal the candidate.")})]}),o.jsxs(Q,{onClick:de,disabled:D===0,size:"lg",variant:"secondary",className:"h-14 rounded-full px-8 font-heading text-lg font-bold shadow-xl hover:scale-105 transition-transform",children:["â¶ ",e("Start Pick & Vote")]})]}),D===0&&o.jsx(en,{className:"pt-0",children:o.jsx("p",{className:"rounded-md bg-background/80 p-2 text-sm text-destructive",children:e("No issues with 2+ candidates yet. Pick more issues or add manifesto data to expand the game.")})})]})]}),y&&!F&&N&&o.jsxs("div",{className:"space-y-6 animate-fade-in",children:[o.jsx(X,{className:"border-primary/30 bg-gradient-to-r from-primary/10 via-accent/5 to-primary/10",children:o.jsxs(en,{className:"flex flex-col gap-4 p-5 md:flex-row md:items-center md:justify-between",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"flex h-12 w-12 items-center justify-center rounded-full bg-primary text-lg font-extrabold text-primary-foreground shadow",children:v+1}),o.jsxs("div",{children:[o.jsxs("h2",{className:"font-heading text-lg font-bold",children:[e("Round")," ",v+1," / ",x.length]}),o.jsxs(Ze,{variant:"secondary",className:"mt-0.5",children:[Wd(N.issue).emoji," ",e(N.issue)]})]})]}),o.jsx("div",{className:"flex-1 md:max-w-sm",children:o.jsx("div",{className:"h-2 w-full overflow-hidden rounded-full bg-muted",children:o.jsx("div",{className:"h-full rounded-full bg-gradient-to-r from-primary to-accent transition-all",style:{width:`${v/x.length*100}%`}})})}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(xe,{}),o.jsx(Q,{variant:"outline",size:"sm",onClick:ht,children:e("Exit Game")})]})]})}),o.jsx(X,{children:o.jsx(en,{className:"p-4 text-center",children:o.jsx("p",{className:"font-heading text-base font-semibold text-foreground",children:e(be?"Tap Next to continue.":"Read the cards. Tap the one that aligns most with your values.")})})}),o.jsx("div",{className:ce("grid gap-4",N.cards.length===2&&"md:grid-cols-2",N.cards.length===3&&"md:grid-cols-3",N.cards.length>=4&&"md:grid-cols-2 lg:grid-cols-4"),children:N.cards.map((P,L)=>{const H=Wd(P.issue),Z=be===P.id,je=!!(be&&be!=="__skipped__")&&!Z,Qe=String.fromCharCode(65+L);return o.jsx("div",{className:ce("[perspective:1200px] transition-opacity",je&&"opacity-40"),children:o.jsxs("div",{className:ce("relative h-72 w-full transition-transform duration-700 [transform-style:preserve-3d]",Z&&"[transform:rotateY(180deg)]"),children:[o.jsxs("button",{type:"button",onClick:()=>ke(P),disabled:!!be,className:ce("absolute inset-0 flex flex-col rounded-xl border-2 p-5 text-left [backface-visibility:hidden]","bg-gradient-to-br",H.gradient,!be&&"cursor-pointer hover:scale-[1.02] hover:shadow-2xl transition-all"),children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("span",{className:"rounded-full bg-background/80 px-2 py-0.5 text-[10px] font-bold uppercase tracking-wide text-foreground backdrop-blur",children:e("Anonymous")}),o.jsx("img",{src:H.icon,alt:P.issue,loading:"lazy",width:40,height:40,className:"h-10 w-10 object-contain drop-shadow-md"})]}),o.jsx("p",{className:"mt-3 font-heading text-3xl font-extrabold text-foreground",children:Qe}),o.jsxs("p",{className:"mt-3 flex-1 text-base font-semibold leading-snug text-foreground",children:["â",$(P),"â"]}
678),o.jsx("p",{className:"mt-3 text-xs text-foreground/70",children:e("Tap to pick â card will flip to reveal the candidate")})]}),o.jsxs("div",{className:ce("absolute inset-0 flex flex-col rounded-xl border-2 border-primary p-5 text-left [transform:rotateY(180deg)] [backface-visibility:hidden]","bg-gradient-to-br from-primary/20 via-background to-accent/20"),children:[o.jsxs(Ze,{className:"w-fit gap-1",variant:"default",children:[o.jsx(Hn,{className:"h-3 w-3"})," ",e("You picked")]}),o.jsx("h3",{className:"mt-3 font-heading text-2xl font-extrabold text-foreground",children:P.candidate_name}),o.jsx("p",{className:"text-sm text-muted-foreground",children:P.party}),o.jsx("p",{className:"mt-3 line-clamp-3 text-sm text-foreground",children:mt(P)}),P.source_url&&o.jsxs("a",{href:P.source_url,target:"_blank",rel:"noopener noreferrer",className:"mt-auto inline-flex items-center gap-1 text-xs text-primary hover:underline",children:[o.jsx(Nn,{className:"h-3 w-3"}),P.source_name||e("Read full manifesto")]})]})]})},P.id)})}),o.jsxs("div",{className:"flex flex-wrap justify-center gap-2",children:[!be&&o.jsxs(Q,{variant:"outline",size:"lg",onClick:Ve,children:["â ",e("Skip this round")]}),be&&o.jsx(Q,{size:"lg",onClick:We,className:"px-10",children:v+1<x.length?`${e("Next")} â`:`ð ${e("See Results")}`})]})]}),F&&o.jsxs("div",{className:"space-y-6 animate-fade-in",children:[o.jsx(X,{className:"overflow-hidden border-primary/40 bg-gradient-to-br from-primary/20 via-accent/10 to-primary/20",children:o.jsxs(en,{className:"p-6 md:p-8",children:[o.jsxs(Ze,{className:"mb-3 gap-1",variant:"default",children:[o.jsx(Wn,{className:"h-3 w-3"}),e("YOUR RANKED RESULTS")]}),o.jsxs("h2",{className:"font-heading text-3xl font-extrabold text-foreground md:text-4xl",children:["ð ",e("Your candidates ranked from most to least chosen")]}),o.jsx("p",{className:"mt-3 max-w-3xl text-sm text-muted-foreground",children:e("This is a neutral decision-support tool. It does not recommend who to vote for. It only shows which candidates' published manifesto promises most closely matched the choices you made.")}),V&&o.jsxs("p",{className:"mt-3 flex items-center gap-2 text-xs text-muted-foreground",children:[o.jsx(Be,{className:"h-3 w-3 animate-spin"})," ",e("Saving your resultâ¦")]}),!n&&o.jsx("p",{className:"mt-3 text-xs text-muted-foreground",children:e("Sign in to save your alignment results to your account.")})]})}),o.jsx("div",{className:"grid gap-3",children:ee.map((P,L)=>{const H=he>0?Math.round(P.score/he*100):0,Z=ie[P.candidateId];return o.jsx(X,{className:ce(L===0&&"border-primary shadow-md"),children:o.jsxs(en,{className:"space-y-4 p-5",children:[o.jsxs("div",{className:"flex flex-col gap-3 md:flex-row md:items-center md:justify-between",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsxs("span",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-primary/10 font-heading text-lg font-extrabold text-primary",children:["#",L+1]}),o.jsxs(Fk,{className:"h-14 w-14 border-2 border-primary/30",children:[(Z==null?void 0:Z.photoUrl)&&o.jsx(Bk,{src:Z.photoUrl,alt:P.candidateName}),o.jsx(Kk,{className:"bg-gradient-to-br from-primary/20 to-accent/20 font-heading font-bold text-primary",children:q(P.candidateName)})]}),o.jsxs("div",{children:[o.jsx("p",{className:"text-xs text-muted-foreground",children:L===0?e("Most chosen"):L===ee.length-1?e("Least chosen"):e("Alignment result")}),o.jsx("h3",{className:"font-heading text-xl font-bold",children:P.candidateName}),o.jsxs("p",{className:"text-sm text-muted-foreground",children:[P.party," · ",P.score," ",P.score===1?e("pick"):e("picks")]})]})]}),o.jsxs("div",{className:"md:min-w-[200px]",children:[o.jsxs("div",{className:"mb-1 flex items-center justify-between text-xs",children:[o.jsx("span",{className:"text-muted-foreground",children:e("Alignment")}),o.jsxs("span",{className:"font-semibold",children:[H,"%"]})]}),o.jsx("div",{className:"h-2 w-full overflow-hidden rounded-full bg-muted",children:o.jsx("div",{className:"h-full rounded-full bg-gradient-to-r from-primary to-accent transition-all",style:{width:`${H}%`}})})]})]}),o.jsxs("div",{children:[o.jsx("p",{className:"mb-2 text-xs font-medium text-foreground",children:e("Top matched issues")}),o.jsx("div",{className:"flex flex-wrap gap-1.5",children:P.matchedIssues.length>0?P.matchedIssues.map(Ae=>o.jsxs(Ze,{variant:"secondary",children:[Wd(Ae).emoji," ",e(Ae)]},Ae)):o.jsx("span",{className:"text-xs text-muted-foreground",children:e("No strong issue match recorded")})})]}),(Z==null?void 0:Z.sourceUrl)&&o.jsx(Q,{asChild:!0,variant:"outline",size:"sm",className:"w-full sm:w-auto",children:o.jsxs("a",{href:Z.sourceUrl,target:"_blank",rel:"noopener noreferrer",children:[o.jsx(Nn,{className:"h-4 w-4"}),e("Read full manifesto"),Z.sourceName&&o.jsxs("span",{className:"ml-1 text-xs text-muted-foreground",children:["· ",Z.sourceName]})]})})]})},P.candidateId)})}),o.jsxs(X,{children:[o.jsx(hr,{children:o.jsx(mr,{className:"text-lg",children:e("What this means")})}),o.jsxs(en,{className:"space-y-2 text-sm text-foreground",children:[o.jsxs("p",{children:["⢠",e("These results reflect the proposals you selected during the blind manifesto comparison.")]}),o.jsxs("p",{children:["⢠",e("They do not tell you who to vote for.")]}),o.jsxs("p",{children:["⢠",e("Use them as a starting point to explore candidate plans more carefully.")]}),o.jsxs("p",{children:["â¢"," ",e("Always review full manifestos, debates, integrity records, and official information before making your final decision.")]}),o.jsx("div",{className:"flex flex-wrap gap-2 pt-3",children:o.jsxs(Q,{onClick:ht,children:[o.jsx(x2,{className:"h-4 w-4"})," ",e("Play Again")]})})]})]})]}),n&&!y&&o.jsx(Cae,{userId:n.id}),o.jsx(X,{className:"bg-foreground text-background",children:o.jsxs(en,{className:"p-6 md:p-8",children:[o.jsx("h2",{className:"font-heading text-2xl font-bold",children:e("Vote by issues, not pressure")}),o.jsx("p",{className:"mt-2 max-w-3xl text-sm opacity-80",children:e("Pick & Vote helps you reflect on what matters most to you before you see names, parties, or campaign branding. Make space for instinct, wisdom, and informed judgment.")}),o.jsxs("p",{className:"mt-3 inline-flex items-center gap-1 text-xs opacity-70",children:[o.jsx(Nn,{className:"h-3 w-3"}),e("Always verify against official manifesto sources.")]})]})})]})},Cae=({userId:e})=>{const{t,lang:n}=Re(),[a,i]=p.useState([]),[r,s]=p.useState(!0),[l,u]=p.useState(null),c=async()=>{s(!0);const{data:m,error:f}=await te.from("manifesto_match_results").select("id, office, selected_issues, scores, chosen_card_ids, created_at").eq("user_id",e).order("created_at",{ascending:!1}).limit(20);f?nn.error(t("Failed to load past results")):i((m||[]).map(y=>({id:y.id,office:y.office,selected_issues:Array.isArray(y.selected_issues)?y.selected_issues:[],scores:Array.isArray(y.scores)?y.scores:[],created_at:y.created_at}))),s(!1)};p.useEffect(()=>{c()},[e]);const h=async m=>{u(m);const{error:f}=await te.from("manifesto_match_results").delete().eq("id",m);if(u(null),f){nn.error(t("Could not delete result"));return}i(y=>y.filter(g=>g.id!==m)),nn.success(t("Result deleted"))},d=m=>
678new Date(m).toLocaleDateString(n==="sw"?"sw-KE":"en-KE",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"});return o.jsxs(X,{children:[o.jsx(hr,{children:o.jsxs(mr,{className:"flex items-center gap-2 text-lg",children:[o.jsx(yD,{className:"h-4 w-4"}),t("Your past Manifesto Match results")]})}),o.jsx(en,{children:r?o.jsxs("div",{className:"space-y-2",children:[o.jsx(Tm,{className:"h-16 w-full"}),o.jsx(Tm,{className:"h-16 w-full"})]}):a.length===0?o.jsx("p",{className:"py-6 text-center text-sm text-muted-foreground",children:t("No saved results yet. Play a round to save your first alignment.")}):o.jsx("ul",{className:"space-y-2",children:a.map(m=>{const f=m.scores[0];return o.jsxs("li",{className:"flex flex-col gap-3 rounded-lg border border-border/60 bg-muted/30 p-3 sm:flex-row sm:items-center sm:justify-between",children:[o.jsxs("div",{className:"min-w-0",children:[o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsx(Ze,{variant:"secondary",children:t(m.office)}),o.jsx("span",{className:"text-xs text-muted-foreground",children:d(m.created_at)})]}),o.jsxs("p",{className:"mt-1 truncate text-sm font-medium text-foreground",children:[t("Top:")," ",f?`${f.candidateName} · ${f.party}`:t("No result")]}),m.selected_issues.length>0&&o.jsx("p",{className:"mt-0.5 truncate text-xs text-muted-foreground",children:m.selected_issues.map(y=>t(y)).join(" · ")})]}),o.jsxs(Q,{variant:"ghost",size:"sm",className:"self-start text-destructive hover:bg-destructive/10 hover:text-destructive sm:self-center",disabled:l===m.id,onClick:()=>h(m.id),"aria-label":t("Delete result"),children:[l===m.id?o.jsx(Be,{className:"h-4 w-4 animate-spin"}):o.jsx(Mc,{className:"h-4 w-4"}),t("Delete")]})]},m.id)})})})]})};var ib="Progress",rb=100,[Tae,jie]=Yt(ib),[Eae,Aae]=Tae(ib),CO=p.forwardRef((e,t)=>{const{__scopeProgress:n,value:a=null,max:i,getValueLabel:r=Pae,...s}=e;(i||i===0)&&!cS(i)&&console.error(Mae(`${i}`,"Progress"));const l=cS(i)?i:rb;a!==null&&!dS(a,l)&&console.error(Rae(`${a}`,"Progress"));const u=dS(a,l)?a:null,c=Em(u)?r(u,l):void 0;return o.jsx(Eae,{scope:n,value:u,max:l,children:o.jsx(we.div,{"aria-valuemax":l,"aria-valuemin":0,"aria-valuenow":Em(u)?u:void 0,"aria-valuetext":c,role:"progressbar","data-state":AO(u,l),"data-value":u??void 0,"data-max":l,...s,ref:t})})});CO.displayName=ib;var TO="ProgressIndicator",EO=p.forwardRef((e,t)=>{const{__scopeProgress:n,...a}=e,i=Aae(TO,n);return o.jsx(we.div,{"data-state":AO(i.value,i.max),"data-value":i.value??void 0,"data-max":i.max,...a,ref:t})});EO.displayName=TO;function Pae(e,t){return`${Math.round(e/t*100)}%`}function AO(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function Em(e){return typeof e=="number"}function cS(e){return Em(e)&&!isNaN(e)&&e>0}function dS(e,t){return Em(e)&&!isNaN(e)&&e<=t&&e>=0}function Mae(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${rb}\`.`}function Rae(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be: 679 - a positive number 680 - less than the value passed to \`max\` (or ${rb} if no \`max\` prop is set) 681 - \`null\` or \`undefined\` if the progress is indeterminate. 682 683Defaulting to \`null\`.`}var PO=CO,Iae=EO;const Kf=p.forwardRef(({className:e,value:t,...n},a)=>o.jsx(PO,{ref:a,className:ce("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...n,children:o.jsx(Iae,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));Kf.displayName=PO.displayName;const Oae=e=>e===1?o.jsx(mD,{className:"h-4 w-4 text-primary"}):e===2?o.jsx(S0,{className:"h-4 w-4 text-secondary"}):e===3?o.jsx(S0,{className:"h-4 w-4 text-muted-foreground"}):null,pg=({entry:e,showFollow:t,onToggleFollow:n,pendingToken:a,lang:i,t:r})=>{const s=new Set(e.earned_action_keys),l=aP.filter(h=>h.earnedByActionKey?s.has(h.earnedByActionKey):!1),u=av(e.total_points),c=a===e.followee_token;return o.jsxs("div",{className:`flex items-center gap-3 rounded-lg border p-3 transition-colors ${e.is_me?"border-primary/40 bg-primary/5":"border-border bg-muted/30 hover:bg-muted/50"}`,children:[o.jsxs("div",{className:"flex shrink-0 items-center gap-1.5 w-12",children:[o.jsxs("span",{className:"font-heading text-sm font-bold tabular-nums text-muted-foreground",children:["#",e.rank]}),Oae(e.rank)]}),o.jsx(zs,{name:e.display_name,url:e.avatar_url,className:"h-9 w-9 shrink-0"}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[o.jsx("p",{className:"font-semibold text-sm truncate",children:e.display_name}),e.is_me&&o.jsx(Ze,{variant:"secondary",className:"text-[9px]",children:r("You","Wewe")})]}),o.jsxs("p",{className:"text-[10px] text-muted-foreground line-clamp-1",children:[i==="en"?u.title_en:u.title_sw,l.length>0&&o.jsxs(o.Fragment,{children:[" · ",o.jsx(h2,{className:"inline h-2.5 w-2.5 mr-0.5"}),r(`${l.length} badges`,`beji ${l.length}`)]})]})]}),o.jsxs("div",{className:"text-right shrink-0",children:[o.jsx("p",{className:"font-heading text-base font-bold tabular-nums",children:e.total_points.toLocaleStr
683ing()}),o.jsx("p",{className:"text-[9px] uppercase tracking-wider text-muted-foreground",children:r("pts","pti")})]}),t&&!e.is_me&&e.followee_token&&o.jsx(Q,{size:"sm",variant:e.is_following?"secondary":"default",className:"h-8 px-2.5 gap-1 shrink-0",disabled:c,onClick:()=>n(e.followee_token),children:e.is_following?o.jsxs(o.Fragment,{children:[o.jsx(j2,{className:"h-3.5 w-3.5"}),o.jsx("span",{className:"text-[11px]",children:r("Following","Unafuata")})]}):o.jsxs(o.Fragment,{children:[o.jsx(BD,{className:"h-3.5 w-3.5"}),o.jsx("span",{className:"text-[11px]",children:r("Follow","Fuata")})]})})]})},Lae=()=>{const{t:e,lang:t}=Re(),{optedIn:n,loading:a,saving:i,setOptIn:r}=Qte(),s=lS("public",!0,50),l=lS("circle",!0),u=p.useMemo(()=>s.entries.find(d=>d.is_me),[s.entries]);p.useMemo(()=>[null,d=>{}],[]);const c=async d=>{await r(d)?(nn.success(d?e("You are now on the public leaderboard","Sasa uko kwenye ubao wa umma"):e("You are hidden from the leaderboard","Umefichwa kutoka kwenye ubao")),s.refresh(),l.refresh()):nn.error(e("Could not update preference","Imeshindwa kusasisha mapendeleo"))},h=async d=>{const m=await Jte(d);if(m===null){nn.error(e("Could not update follow","Imeshindwa kusasisha kufuata"));return}nn.success(m?e("Added to your circle","Imeongezwa kwenye duara lako"):e("Removed from your circle","Imeondolewa kwenye duara lako")),s.refresh(),l.refresh()};return o.jsxs("div",{className:"space-y-5",children:[o.jsx(X,{className:"p-5 border-primary/20",children:o.jsxs("div",{className:"flex items-start justify-between gap-4",children:[o.jsxs("div",{className:"space-y-1",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[n?o.jsx(Zm,{className:"h-4 w-4 text-primary"}):o.jsx(f2,{className:"h-4 w-4 text-muted-foreground"}),o.jsx("h3",{className:"font-heading font-bold",children:e("Show me on the public leaderboard","Nionyeshe kwenye ubao wa umma")})]}),o.jsx("p",{className:"text-xs text-muted-foreground max-w-md",children:e("When on, your display name, total points, and earned badges become visible to other CLICK users â and you can be followed into their circle. Email and personal data are never shared.","Ukiwasha, jina lako, jumla ya pointi na beji zako huonekana kwa watumiaji wengine, na unaweza kufuatwa kwenye duara lao. Barua pepe na data za kibinafsi hazitashirikiwa.")})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(dl,{id:"leaderboard-opt",checked:n,disabled:a||i,onCheckedChange:c}),o.jsx(At,{htmlFor:"leaderboard-opt",className:"sr-only",children:e("Public leaderboard","Ubao wa umma")})]})]})}),o.jsxs(Yc,{defaultValue:"circle",className:"space-y-4",children:[o.jsxs(Rl,{className:"grid w-full grid-cols-2 max-w-sm",children:[o.jsxs(Gn,{value:"circle",className:"gap-1.5",children:[o.jsx(Si,{className:"h-3.5 w-3.5"}),e("My circle","Duara langu")]}),o.jsxs(Gn,{value:"public",className:"gap-1.5",children:[o.jsx(Wn,{className:"h-3.5 w-3.5"}),e("Public","Umma")]})]}),o.jsx(Ra,{value:"circle",className:"mt-0",children:o.jsxs(X,{className:"p-5",children:[o.jsxs("div",{className:"mb-4",children:[o.jsxs("h2",{className:"font-heading text-lg font-bold flex items-center gap-2",children:[o.jsx(Si,{className:"h-5 w-5 text-primary"}),e("My circle ranking","Ubora wa duara langu")]}),o.jsx("p",{className:"text-xs text-muted-foreground",children:e("You and the people you follow, ranked by lifetime civic points.","Wewe na watu unaowafuata, mmepangwa kwa pointi za maisha.")})]}),l.loading?o.jsx("div",{className:"flex justify-center py-8",children:o.jsx(Be,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):l.error?o.jsx("p",{className:"text-sm text-destructive py-4 text-center",children:l.error}):l.entries.length<=1?o.jsxs("div",{className:"text-center py-8 space-y-3",children:[o.jsx(Si,{className:"h-8 w-8 text-muted-foreground mx-auto opacity-50"}),o.jsx("p",{className:"text-sm text-muted-foreground max-w-sm mx-auto",children:e("Your circle is just you so far. Follow other citizens from the Public tab to start a friendly competition.","Duara lako ni wewe tu kwa sasa. Fuata raia wengine kutoka kichupo cha Umma kuanza ushindani wa kirafiki.")}),l.entries[0]&&o.jsx("div",{className:"max-w-md mx-auto pt-2",children:o.jsx(pg,{entry:l.entries[0],showFollow:!1,onToggleFollow:()=>{},pendingToken:null,lang:t,t:e})})]}):o.jsx("div",{className:"space-y-1.5",children:l.entries.map(d=>o.jsx(pg,{entry:d,showFollow:!1,onToggleFollow:()=>{},pendingToken:null,lang:t,t:e},`${d.rank}-${d.display_name}`))})]})}),o.jsx(Ra,{value:"public",className:"mt-0",children:o.jsxs(X,{className:"p-5",children:[o.jsxs("div",{className:"flex items-center justify-between mb-4",children:[o.jsxs("div",{children:[o.jsxs("h2",{className:"font-heading text-lg font-bold flex items-center gap-2",children:[o.jsx(Wn,{className:"h-5 w-5 text-primary"}),e("Public leaderboard","Ubao wa Umma")]}),o.jsx("p",{className:"text-xs text-muted-foreground",children:e("Top citizens by lifetime civic points","Raia bora kwa pointi za maisha")})]}),u&&o.jsx(Ze,{variant:"secondary",className:"text-xs",children:e(`You are #${u.rank}`,`Wewe ni #${u.rank}`)})]}),s.loading?o.jsx("div",{className:"flex justify-center py-8",children:o.jsx(Be,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):s.error?o.jsx("p",{className:"text-sm text-destructive py-4 text-center",children:s.error}):s.entries.length===0?o.jsxs("div",{className:"text-center py-8 space-y-2",children:[o.jsx(Wn,{className:"h-8 w-8 text-muted-foreground mx-auto opacity-50"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:e("No public profiles yet. Be the first â toggle the switch above to join the leaderboard.","Hakuna wasifu wa umma bado. Kuwa wa kwanza â wash
683a swichi hapo juu kujiunga.")})]}):o.jsx("div",{className:"space-y-1.5",children:s.entries.map(d=>o.jsx(pg,{entry:d,showFollow:!0,onToggleFollow:h,pendingToken:null,lang:t,t:e},`${d.rank}-${d.display_name}`))})]})})]})]})},Dae=(e,t)=>{const n=t==="sw",a=Date.now()-new Date(e).getTime(),i=Math.floor(a/864e5);return i<=0?n?"Leo":"Today":i===1?n?"Jana":"Yesterday":n?`siku ${i} zilizopita`:`${i} days ago`};function zae(){const{t:e,lang:t}=Re(),{user:n,loading:a}=Rt(),{stats:i,actions:r,loading:s}=Uc(),l=p.useMemo(()=>av(i.total_points),[i.total_points]),u=p.useMemo(()=>iP(i.total_points),[i.total_points]),c=u?Math.min(100,Math.round((i.total_points-l.pointsRequired)/(u.pointsRequired-l.pointsRequired)*100)):100,h=p.useMemo(()=>new Set(r.map(d=>d.action_key)),[r]);return a?o.jsx("div",{className:"flex min-h-[60vh] items-center justify-center",children:o.jsx(Be,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):n?o.jsxs("div",{className:"container max-w-5xl space-y-6 py-4",children:[o.jsx(X,{className:"p-6 md:p-8 bg-gradient-to-br from-primary/10 via-background to-accent/10 border-primary/20",children:o.jsxs("div",{className:"flex flex-col gap-6 lg:flex-row lg:items-center lg:justify-between",children:[o.jsxs("div",{className:"space-y-3",children:[o.jsxs(Ze,{variant:"secondary",className:"gap-1",children:[o.jsx(Hn,{className:"h-3 w-3"}),e("CIVIC SCORE","ALAMA YA URAIA")]}),o.jsx("h1",{className:"font-heading text-2xl md:text-3xl font-bold text-foreground",children:e("Your civic journey on CLICK","Safari yako ya uraia kwenye CLICK")}),o.jsx("p",{className:"max-w-xl text-sm text-muted-foreground",children:e("Every meaningful action you take builds your civic impact. Track your progress, unlock milestones, and grow as an informed citizen.","Kila kitendo cha maana unachofanya hujenga athari yako ya uraia. Fuatilia maendeleo, fungua hatua muhimu, na ukue kama raia mwenye habari.")})]}),o.jsxs(X,{className:"min-w-[260px] p-5 bg-card/80 backdrop-blur border-border/60",children:[o.jsx("p",{className:"text-xs uppercase tracking-wider text-muted-foreground",children:e("Current level","Daraja la sasa")}),o.jsx("h2",{className:"mt-1 font-heading text-xl font-bold text-foreground",children:t==="en"?l.title_en:l.title_sw}),o.jsxs("p",{className:"mt-1 text-sm text-muted-foreground",children:[i.total_points," ",e("points","pointi")]}),u&&o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"mt-3 text-xs text-muted-foreground",children:e(`${u.pointsRequired-i.total_points} pts to ${u.title_en}`,`pointi ${u.pointsRequired-i.total_points} hadi ${u.title_sw}`)}),o.jsx(Kf,{value:c,className:"mt-2 h-2"})]})]})]})}),o.jsxs(Yc,{defaultValue:"progress",className:"space-y-4",children:[o.jsxs(Rl,{className:"grid w-full grid-cols-2 max-w-md",children:[o.jsxs(Gn,{value:"progress",className:"gap-1.5",children:[o.jsx(Wn,{className:"h-3.5 w-3.5"}),e("My progress","Maendeleo yangu")]}),o.jsxs(Gn,{value:"leaderboard",className:"gap-1.5",children:[o.jsx(Si,{className:"h-3.5 w-3.5"}),e("Leaderboard","Ubao wa Uongozi")]})]}),o.jsxs(Ra,{value:"progress",className:"space-y-6 mt-0",children:[o.jsxs("div",{className:"grid gap-3 sm:grid-cols-3",children:[o.jsxs(X,{className:"p-4",children:[o.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[o.jsx(Wn,{className:"h-4 w-4 text-primary"}),o.jsx("p",{className:"text-xs uppercase tracking-wider",children:e("Total points","Jumla ya pointi")})]}),o.jsx("p",{className:"mt-1 font-heading text-3xl font-bold",children:i.total_points})]}),o.jsxs(X,{className:"p-4",children:[o.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[o.jsx(Xx,{className:"h-4 w-4 text-accent"}),o.jsx("p",{className:"text-xs uppercase tracking-wider",children:e("Civic streak","Mfululizo wa uraia")})]}),o.jsxs("p",{className:"mt-1 font-heading text-3xl font-bold",children:[i.streak_days," ",o.jsx("span",{className:"text-base font-medium text-muted-foreground",children:e("days","siku")})]})]}),o.jsxs(X,{className:"p-4",children:[o.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[o.jsx(h2,{className:"h-4 w-4 text-primary"}),o.jsx("p",{className:"text-xs uppercase tracking-wider",children:e("Next unlock","Ifuatayo")})]}),o.jsx("p",{className:"mt-1 font-heading text-lg font-bold",children:u?t==="en"?u.title_en:u.title_sw:e("Maxed out","Umefika kileleni")})]})]}),o.jsxs(X,{className:"p-5 md:p-6",children:[o.jsxs("div",{className:"mb-5",children:[o.jsx("h2",{className:"font-heading text-xl font-bold",children:e("Civic Roadmap","Ramani ya Uraia")}),o.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:e("Move through milestones as you learn, participate, and engage.","Pita kupitia hatua muhimu unaposoma, kushiriki, na kujihusisha.")})]}),o.jsxs("div",{className:"relative",children:[o.jsx("div",{className:"absolute left-3.5 to
683p-2 bottom-2 hidden w-0.5 bg-border md:block"}),o.jsx("div",{className:"space-y-3",children:sl.map(d=>{const m=i.total_points>=d.pointsRequired,f=(u==null?void 0:u.id)===d.id;return o.jsxs("div",{className:"relative md:pl-12",children:[o.jsx("div",{className:`absolute left-0 top-4 hidden h-8 w-8 items-center justify-center rounded-full border-2 md:flex ${m?"border-primary bg-primary text-primary-foreground":f?"border-accent bg-accent/10 text-accent":"border-border bg-muted text-muted-foreground"}`,children:m?o.jsx(Jx,{className:"h-4 w-4"}):o.jsx("span",{className:"text-xs",children:"â¢"})}),o.jsxs("div",{className:`rounded-xl border p-4 ${m?"border-primary/30 bg-primary/5":f?"border-accent/40 bg-accent/5":"border-border bg-muted/30"}`,children:[o.jsxs("div",{className:"flex flex-wrap items-center gap-2 mb-1.5",children:[o.jsx(Ze,{variant:d.type==="major"?"default":"secondary",className:"text-[10px]",children:d.type==="major"?e("Major milestone","Hatua kuu"):e("Milestone","Hatua")}),o.jsxs(Ze,{variant:"outline",className:"text-[10px]",children:[d.pointsRequired," ",e("pts","pointi")]}),m&&o.jsx(Ze,{className:"bg-primary/15 text-primary text-[10px] hover:bg-primary/15",children:e("Unlocked","Imefunguliwa")}),f&&o.jsx(Ze,{className:"bg-accent/15 text-accent-foreground text-[10px] hover:bg-accent/15",children:e("Next up","Inayofuata")})]}),o.jsx("h3",{className:"font-heading text-base font-bold",children:t==="en"?d.title_en:d.title_sw}),o.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:t==="en"?d.description_en:d.description_sw}),d.reward_en&&o.jsxs("p",{className:"mt-2 text-xs font-medium text-foreground",children:[e("Reward:","Zawadi:")," ",t==="en"?d.reward_en:d.reward_sw]}),!m&&o.jsx("p",{className:"mt-2 text-xs text-muted-foreground",children:d.pointsRequired-i.total_points>0?e(`${d.pointsRequired-i.total_points} points away`,`pointi ${d.pointsRequired-i.total_points} zinabaki`):e("Ready to unlock","Tayari kufungua")})]})]},d.id)})})]})]}),o.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[o.jsxs(X,{className:"p-5",children:[o.jsx("h2",{className:"font-heading text-lg font-bold mb-3",children:e("Today's civic missions","Misheni za uraia za leo")}),o.jsx("div",{className:"space-y-2.5",children:Jq.map(d=>{Oj[d.titleKey];const m=d.titleKey==="guide_view"?"/guides":"/bills";return o.jsx(Ue,{to:m,children:o.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-lg border border-border bg-muted/40 p-3 hover:bg-muted/60 transition-colors",children:[o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-medium",children:t==="en"?d.en:d.sw}),o.jsx("p",{className:"text-xs text-muted-foreground",children:e("Tap to start","Bofya kuanza")})]}),o.jsxs(Ze,{className:"bg-primary text-primary-foreground hover:bg-primary",children:["+",nP[d.titleKey]??0," ",e("pts","pointi")]})]})},d.id)})})]}),o.jsxs(X,{className:"p-5",children:[o.jsx("h2",{className:"font-heading text-lg font-bold mb-3",children:e("Rewards track","Daraja la zawadi")}),o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"rounded-lg border border-border bg-muted/40 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wider text-muted-foreground",children:e("Upcoming reward","Zawadi inayokuja")}),o.jsx("p",{className:"mt-1 font-semibold",children:u!=null&&u.reward_en?t==="en"?u.reward_en:u.reward_sw:e("All rewards unlocked","Zawadi zote zimefunguliwa")})]}),o.jsxs("div",{className:"rounded-lg border border-border bg-muted/40 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wider text-muted-foreground",children:e("Future partner rewards","Zawadi za washirika za baadaye")}),o.jsxs("ul",{className:"mt-2 space-y-1 text-sm text-muted-foreground",children:[o.jsxs("li",{children:["⢠",e("Free data bundles","Vifungu vya data bure")]}),o.jsxs("li",{children:["⢠",e("Airtime / call credit","Muda wa maongezi / salio")]}),o.jsxs("li",{children:["⢠",e("Youth civic challenge rewards","Zawadi za changamoto za uraia za vijana")]}),o.jsxs("li",{children:["⢠",e("Sponsored learning bundles","Vifungu vya kujifunza vilivyodhaminiwa")]})]})]}),o.jsx("p",{className:"text-xs text-muted-foreground italic",children:e("Partner rewards can later be powered by Safaricom or other civic engagement partners.","Zawadi za washirika zinaweza kuendeshwa baadaye na Safaricom au washirika wengine.")})]})]})]}),o.jsxs(X,{className:"p-5",children:[o.jsx("h2",{className:"font-heading text-lg font-bold mb-3",children:e("Civic badges","Beji za uraia")}),o.jsx("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:aP.map(d=>{const m=d.earnedByActionKey&&h.has(d.earnedByActionKey)||d.earnedByActionCount!==void 0&&i.actions_count>=d.earnedByActionCount||d.earnedByPoints!==void 0&&i.total_points>=d.earnedByPoints;return o.jsxs("div",{className:`rounded-lg border p-4 ${m?"border-primary/30 bg-primary/5":"border-border bg-muted/30 opacity-75"}`,children:[o.jsxs("div",{className:"flex items-center justify-between gap-2 mb-1",children:[o.jsx("h3",{className:"font-semibold text-sm",children:t==="en"?d.name_en:d.name_sw}),o.jsx(Ze,{variant:m?"default":"outline",className:"text-[10px]",children:m?e("Earned","Imepatikana"):e("Locked","Imefungwa")})]}),o.jsx("p",{className:"text-xs text-muted-foreground",children:t==="en"?d.description_en:d.description_sw})]},d.id)})})]}),o.jsxs(X,{className:"p-5",children:[o.jsx("h2",{className:"font-heading text-lg font-bold mb-3",children:e("Recent civic activity","Shughuli za hivi karibuni")}),s?o.jsx("div",{className:"flex justify-center py-6",children:o.jsx(Be,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):r.length===0?o.jsx("p",{className:"text-sm text-muted-foreground py-4 text-center",children:e("No civic actions yet. Read a bill, follow legislation, or complete Pick & Vote to start earning points.","Hakuna vitendo vya uraia bado. Soma mswada, fuata sheria, au maliza Linganisha Ilani kuanza kupata pointi.")}):o.jsx("div",{className:"space-y-2",children:r.map(d=>{const m=Oj[d.action_key];return o.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-lg border border-border bg-muted/30 p-3",children:[o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-medium",children:m?t==="en"?m.en:m.sw:d.action_key}),o.jsx("p",{className:"text-xs text-muted-foreground",children:Dae(d.created_at,t)})]}),o.jsxs(Ze,{className:"bg-primary text-primary-foreground hover:bg-primary",children:["+",d.points," ",e("pts","pointi")]})]},d.id)})})]}),o.jsxs(X,{className:"p-6 bg-gradient-to-br from-primary/15 to-accent/10 border-primary/20",children:[o.jsx("h2",{className:"font-heading text-xl font-bold mb-2",children:e("Build your civic impact","Jenga athari yako ya uraia")}),o.jsx("p",{className:"text-sm text-muted-foreground mb-4 max-w-2xl",children:e("Read bills. Join events. Prepare to vote. Explore manifestos. Submit petitions. Every meaningful step strengthens your role in public life.","Soma miswada. Hudhuria matukio. Jiandae kupiga kura. Chunguza ilani. Wasilisha maombi. Kila hatua ya maana huimarisha jukumu lako katika maisha ya umma.")}),o.jsxs("div",{className:"flex flex-wrap gap-2",children:[o.jsx(Ue,{to:"/bills",children:o.jsxs(Q,{size:"sm",className:"gap-1.5",children:[o.jsx(Kn,{className:"h-3.5 w-3.5"}),e("Explore bills","Chunguza miswada")]})}),o.jsx(Ue,{to:"/manifesto-match",children:o.jsxs(Q,{size:"sm",variant:"outline",className:"gap-1.5",children:[o.jsx(Hn,{className:"h-3.5 w-3.5"}),e("Pick & Vote","Pick & Vote")]})})]})]})]}),o.jsx(Ra,{value:"leaderboard",className:"mt-0",children:o.jsx(Lae,{})})]})]}):o.jsxs("div",{className:"container max-w-2xl py-12 text-center space-y-4",children:[o.jsx(Wn,{className:"mx-auto h-12 w-12 text-primary"}),o.jsx("h1",{className:"font-heading text-2xl font-bold",children:e("Sign in to see your Civic Score","Ingia ili uone Alama yako ya Uraia")}),o.jsx("p",{className:"text-muted-foreground",children:e("Track your civic actions, build a streak, and unlock milestones.","Fuatilia vitendo vyako vya uraia, jenga mfululizo, na ufungue hatua muhimu.")}),o.jsx(Ue,{to:"/welcome",children:o.jsxs(Q,{className:"gap-2",children:[o.jsx(w2,{className:"h-4 w-4"}),e("Sign in","Ingia")]})})]})}var Fae="Separator",hS="horizontal",Bae=["horizontal","vertical"],MO=p.forwardRef((e,t)=>
683{const{decorative:n,orientation:a=hS,...i}=e,r=Kae(a)?a:hS,l=n?{role:"none"}:{"aria-orientation":r==="vertical"?r:void 0,role:"separator"};return o.jsx(we.div,{"data-orientation":r,...l,...i,ref:t})});MO.displayName=Fae;function Kae(e){return Bae.includes(e)}var RO=MO;const Am=p.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...a},i)=>o.jsx(RO,{ref:i,decorative:n,orientation:t,className:ce("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...a}));Am.displayName=RO.displayName;function $ae(e=[]){const t=e.map(i=>i.toLowerCase()),n=(...i)=>i.some(r=>t.some(s=>s.includes(r))),a=new Set;return n("tax","finance","revenue","vat")&&(a.add("vat"),a.add("paye"),a.add("food")),n("energy","fuel","petrol","transport","roads")&&a.add("fuel"),n("housing","land","rent")&&a.add("housing"),n("health","sha","nhif","medical")&&a.add("health"),n("education","labour","labor","employment","wage")&&a.add("paye"),n("agriculture","food","consumer")&&a.add("food"),Array.from(a)}async function Uae(){const{data:e,error:t}=await te.from("items").select("id, slug, title_en, title_sw, type, stage, categories, last_action_date, follower_count, click_count").eq("status","active").order("last_action_date",{ascending:!1}).limit(60);if(t)throw t;return(e||[]).map(n=>{const a=$ae(n.categories||[]);return{id:n.id,slug:n.slug,title_en:n.title_en,title_sw:n.title_sw||n.title_en,type:n.type,stage:n.stage,categories:n.categories||[],slots:a}}).filter(n=>n.slots.length>0)}function IO(){return bl({queryKey:["money-drivers"],queryFn:Uae,staleTime:6e4})}function fi(e,t,n=2){return e?e.filter(a=>a.slots.includes(t)).slice(0,n):[]}const Vae=({driver:e})=>{const{t,lang:n}=Re(),a=n==="en"?e.title_en:e.title_sw;return o.jsxs(Ue,{to:`/items/${e.slug}`,className:"inline-flex items-center gap-1 max-w-full rounded-full border border-accent/40 bg-accent/10 px-2 py-0.5 text-[10px] text-foreground hover:bg-accent/20 transition-colors",title:`${t("Driven by","Inasababishwa na")}: ${a}`,children:[o.jsx("span",{className:"font-medium uppercase tracking-wide text-[9px] text-accent-foreground/80 flex-shrink-0",children:t("Driver","Sababu")}),o.jsx("span",{className:"truncate max-w-[180px]",children:a}),o.jsx(Nn,{className:"h-2.5 w-2.5 flex-shrink-0 opacity-60"})]})},pi=({drivers:e})=>e.length===0?null:o.jsx("div",{className:"flex flex-wrap gap-1 pt-1",children:e.map(t=>o.jsx(Vae,{driver:t},t.id))}),Hae={vat:{en:"VAT on what you buy",sw:"VAT kwa unachonunua"},paye:{en:"PAYE on your salary",sw:"PAYE kwa mshahara"},fuel:{en:"Fuel & transport",sw:"Mafuta na usafiri"},housing:{en:"Rent & housing",sw:"Kodi ya nyumba"},health:{en:"Health deduction (SHA)",sw:"Makato ya afya (SHA)"},food:{en:"Food & essentials",sw:"Chakula na mahitaji"}},Wae=({onJumpToScenario:e})=>{const{t,lang:n}=Re(),{data:a,isLoading:i}=IO();if(i)return o.jsxs(X,{className:"p-3 flex items-center gap-2 text-xs text-muted-foreground",children:[o.jsx(Be,{className:"h-3 w-3 animate-spin"}),t("Loading active bills affecting your moneyâ¦","Inapakia miswada inayoathiri pesa yakoâ¦")]});if(!a||a.length===0)return o.jsx(X,{className:"p-3 text-xs text-muted-foreground",children:t("No active bills are currently driving the sliders below. Adjust them yourself to see what-if scenarios.","Hakuna miswada hai inayoathiri vitelezi kwa sasa. Vibadilishe mwenyewe kuona matukio.")});const s=["vat","paye","fuel","housing","health","food"].map(l=>({slot:l,items:a.filter(u=>u.slots.includes(l)).slice(0,3)})).filter(l=>l.items.length>0);return s.length===0?null:o.jsxs(X,{className:"overflow-hidden border-accent/30",children:[o.jsxs("div",{className:"bg-gradient-to-br from-accent/15 via-accent/5 to-transparent px-3 py-2.5 border-b border-accent/20",children:[o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx(Jh,{className:"h-3.5 w-3.5 text-accent-foreground"}),o.jsx("h3",{className:"font-heading text-sm font-bold",children:t("What's moving your money","Kinachoathiri pesa yako")}
683)]}),o.jsx("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:t("Real CLICK bills & budgets currently affecting each slider below.","Miswada na bajeti halisi za CLICK zinazoathiri kila kitelezi hapo chini.")})]}),o.jsx("div",{className:"divide-y",children:s.map(({slot:l,items:u})=>o.jsxs("div",{className:"px-3 py-2.5",children:[o.jsxs("div",{className:"flex items-center justify-between gap-2 mb-1.5",children:[o.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wide text-foreground",children:Hae[l][n==="en"?"en":"sw"]}),o.jsxs(Q,{size:"sm",variant:"ghost",className:"h-6 text-[10px] px-2 text-primary hover:text-primary",onClick:()=>e(l),children:[t("Adjust","Rekebisha"),o.jsx(Kn,{className:"h-2.5 w-2.5 ml-0.5"})]})]}),o.jsx("ul",{className:"space-y-1",children:u.map(c=>o.jsx("li",{children:o.jsxs(Ue,{to:`/items/${c.slug}`,className:"flex items-center gap-2 text-[11px] text-muted-foreground hover:text-foreground transition-colors group",children:[o.jsx("span",{className:"h-1 w-1 rounded-full bg-accent flex-shrink-0"}),o.jsx("span",{className:"truncate group-hover:underline",children:n==="en"?c.title_en:c.title_sw}),o.jsx("span",{className:"text-[9px] uppercase text-muted-foreground/60 flex-shrink-0",children:c.type==="bill"?t("bill","mswada"):t("budget","bajeti")})]})},c.id))})]},l))})]})};function sn(e){return new Intl.NumberFormat("en-KE",{style:"currency",currency:"KES",maximumFractionDigits:0}).format(Math.max(0,e))}function qae(e,t,n){return Math.min(Math.max(e,t),n)}const Gae=()=>{const{t:e}=Re(),{user:t}
683=Rt(),[n,a]=bK(),[i,r]=p.useState(2e4),[s,l]=p.useState(6e3),[u,c]=p.useState(5e3),[h,d]=p.useState(2500),[m,f]=p.useState(1e3),[y,g]=p.useState(2e3),[x,w]=p.useState(!1),[v,k]=p.useState(12e3),[j,S]=p.useState(3e3),[_,T]=p.useState(20),[E,O]=p.useState(!1),[A,R]=p.useState("breakdown"),[F,Y]=p.useState(null),V=p.useRef(null),z=p.useRef({vat:null,paye:null,fuel:null,housing:null,health:null,food:null}),{data:W}=IO(),B=L=>{O(!0),R("scenarios"),setTimeout(()=>{var Z;const H=z.current[L];H?(H.scrollIntoView({behavior:"smooth",block:"center"}),H.classList.add("ring-2","ring-primary/60","rounded-xl"),setTimeout(()=>H.classList.remove("ring-2","ring-primary/60","rounded-xl"),1800)):(Z=V.current)==null||Z.scrollIntoView({behavior:"smooth",block:"start"})},250)},[M,I]=p.useState(16),[b,C]=p.useState(12),[D,N]=p.useState(5),[J,re]=p.useState(10),[ee,G]=p.useState(2.75),ie=t?`policy_sim_custom_${t.id}`:"policy_sim_custom_guest",[q,ae]=p.useState([]),[de,me]=p.useState(""),[Ce,ke]=p.useState(""),[Ve,We]=p.useState(!1),Ge=L=>Array.isArray(L)?L.filter(H=>!!H&&typeof H=="object").map(H=>({id:String(H.id??`${Date.now()}-${Math.random().toString(36).slice(2,7)}`),label:String(H.label??"").slice(0,40),amount:Number(H.amount)||0,vatable:!!H.vatable})).filter(H=>H.label&&H.amount>0).slice(0,10):[];p.useEffect(()=>{if(!t)try{const L=localStorage.getItem(ie);ae(L?Ge(JSON.parse(L)):[])}catch{ae([])}},[ie,t]),p.useEffect(()=>{if(!t)try{localStorage.setItem(ie,JSON.stringify(q))}catch{}},[q,ie,t]);const ht=()=>{const L=de.trim().slice(0,40),H=Number(Ce);!L||!Number.isFinite(H)||H<=0||q.length>=10||(ae([...q,{id:`${Date.now()}-${Math.random().toString(36).slice(2,7)}`,label:L,amount:H,vatable:Ve}]),me(""),ke(""),We(!1))},mt=L=>{ae(q.filter(H=>H.id!==L))},st=p.useMemo(()=>q.reduce((L,H)=>L+(Number.isFinite(H.amount)?H.amount:0),0),[q]),$=p.useMemo(()=>q.filter(L=>L.vatable).reduce((L,H)=>L+H.amount,0),[q]),he=p.useRef(!1),xe=p.useRef(null),Me=p.useRef(!1);p.useEffect(()=>{if(!t){he.current=!0;return}let L=!1;return(async()=>{const{data:H}=await te.from("policy_simulator_inputs").select("*").eq("user_id",t.id).maybeSingle();if(!L&&H)r(Number(H.monthly_income)),l(Number(H.rent)),c(Number(H.food)),d(Number(H.transport)),f(Number(H.airtime)),g(Number(H.other_expenses)),w(!!H.business_mode),k(Number(H.monthly_stock_cost)),S(Number(H.monthly_logistics)),T(Number(H.profit_margin)),I(Number(H.vat_rate)),C(Number(H.fuel_pressure)),N(Number(H.housing_pressure)),re(Number(H.paye_rate)),G(Number(H.health_deduction_rate)),ae(Ge(H.custom_expenses));else if(!L)try{const Z=localStorage.getItem(ie);Z&&ae(Ge(JSON.parse(Z)))}catch{}he.current=!0})(),()=>{L=!0}},[t]),p.useEffect(()=>{if(Me.current||!he.current)return;const L=n.get("bill"),H=n.get("focus"),Z=n.get("vat"),Ae=n.get("fuel"),je=n.get("housing"),Qe=n.get("paye"),Ke=n.get("health");if(!(L||H||Z||Ae||je||Qe||Ke)){Me.current=!0;return}Z&&I(Number(Z)),Ae&&C(Number(Ae)),je&&N(Number(je)),Qe&&re(Number(Qe)),Ke&&G(Number(Ke)),L&&Y(L),O(!0),R("scenarios"),a({},{replace:!0}),Me.current=!0},[n,a,he.current]),p.useEffect(()=>{if(!(!t||!he.current))return xe.current&&clearTimeout(xe.current),xe.current=setTimeout(()=>{te.from("policy_simulator_inputs").upsert({user_id:t.id,monthly_income:i,rent:s,food:u,transport:h,airtime:m,other_expenses:y,business_mode:x,monthly_stock_cost:v,monthly_logistics:j,profit_margin:_,vat_rate:M,fuel_pressure:b,housing_pressure:D,paye_rate:J,health_deduction_rate:ee,custom_expenses:q},{onConflict:"user_id"}).then(()=>{})},800),()=>{xe.current&&clearTimeout(xe.current)}},[t,i,s,u,h,m,y,x,v,j,_,M,b,D,J,ee,q]);const be=p.useMemo(()=>{const L=i,H=L*(J/100),Z=L*(ee/100),Ae=H+Z,je=L-Ae,Ke=(u+m+y+$)*(M/100)
683*.18,Nt=h*(b/100),Xe=s*(D/100),wn=Ke+Nt+Xe,Ct=s+u+h+m+y+st,hi=Ct+wn,Br=je-hi,Bs=L>0?qae(hi/Math.max(je,1)*100,0,140):0;let pa=0,Jt=_;if(x){const $f=v*(M/100*.12),Ee=j*(b/100);pa=$f+Ee;const He=v*(1+_/100),tt=v+j+pa,In=He-tt;Jt=He>0?In/He*100:0}return{gross:L,paye:H,health:Z,totalDirectTaxes:Ae,netIncome:je,vatImpact:Ke,fuelImpact:Nt,housingImpact:Xe,totalCostIncrease:wn,baselineBills:Ct,adjustedBills:hi,moneyLeft:Br,strainLevel:Bs,businessIncrease:pa,newBusinessMargin:Jt}},[i,s,u,h,m,y,x,v,j,_,M,b,D,J,ee,st,$]),U=p.useMemo(()=>be.moneyLeft<0?{title:e("Your budget is under strain","Bajeti yako iko chini ya shinikizo"),text:e("Current taxes and price increases may leave you short before the month ends.","Kodi za sasa na ongezeko la bei zaweza kukuacha bila pesa kabla ya mwisho wa mwezi.")}:be.moneyLeft<i*.15?{title:e("Your budget is tight","Bajeti yako ni finyu"),text:e("You may still manage your month, but policy-driven cost increases are limiting your flexibility.","Unaweza kuvumilia mwezi, lakini ongezeko la gharama linapunguza uhuru wako wa kifedha.")}:{title:e("Your budget is still manageable","Bajeti yako bado inadhibitika"),text:e("You still have some room after taxes and rising costs, though policy changes are reducing your purchasing power.","Bado una nafasi baada ya kodi na gharama, japo mabadiliko ya sera yanapunguza uwezo wako wa kununua.")},[be.moneyLeft,i,e]),P=p.useMemo(()=>{const L=[];return h>
683i*.18&&L.push(e("Transport is taking a large share of your income. Consider cheaper routes or bundling trips.","Usafiri unachukua sehemu kubwa ya mapato yako. Fikiria njia za bei nafuu au kuunganisha safari.")),m>i*.08&&L.push(e("Your airtime and data spending is relatively high. A bundle-based plan may save money.","Matumizi yako ya airtime na data ni ya juu. Mpango wa bando waweza kukuokolea pesa.")),u>i*.3&&L.push(e("Food spending is rising quickly. A lower-VAT basket or bulk buying could reduce pressure.","Matumizi ya chakula yanapanda haraka. Bidhaa zenye VAT ndogo au kununua kwa wingi kwaweza kupunguza shinikizo.")),be.moneyLeft<0&&L.push(e("Your spending currently exceeds what remains after taxes. You may need to cut non-essential costs or increase income.","Matumizi yako yanazidi kile kinachosalia baada ya kodi. Punguza gharama zisizo za lazima au ongeza mapato.")),L.length===0&&L.push(e("Your spending appears balanced for now, but policy changes can still reduce your purchasing power over time.","Matumizi yako yameingia sawa kwa sasa, lakini sera zaweza kupunguza uwezo wako wa kununua baadaye.")),L},[h,m,u,i,be.moneyLeft,e]);return o.jsxs(X,{className:"overflow-hidden border-primary/20",children:[o.jsxs(hr,{className:"bg-gradient-to-br from-primary/10 via-accent/5 to-transparent",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[o.jsx(Ss,{className:"h-4 w-4 text-primary"}),o.jsx(Ze,{variant:"secondary",className:"text-[10px]",children:e("Policy Impact Simulator","Kikokotoo cha Athari za Sera")})]}),o.jsx(mr,{className:"font-heading text-lg",children:e("See how policy affects your money","Ona jinsi sera zinavyoathiri pesa yako")}
683),o.jsx(sv,{className:"text-xs",children:e("Enter your income and spending to estimate how taxes, fuel pressure, and cost-of-living changes affect what you actually have left.","Weka mapato na matumizi yako kuona jinsi kodi, mafuta, na gharama za maisha vinavyoathiri pesa inayobaki.")})]}),o.jsxs(en,{className:"space-y-5 pt-5",children:[F&&o.jsxs(Le.div,{initial:{opacity:0,y:-4},animate:{opacity:1,y:0},className:"flex items-start gap-2 rounded-xl border border-accent/40 bg-accent/10 p-3",children:[o.jsx(Hn,{className:"h-4 w-4 text-accent-foreground flex-shrink-0 mt-0.5"}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("p",{className:"text-[11px] font-semibold text-foreground",children:e("Pre-set from bill","Imewekwa kutoka mswada")}),o.jsx("p",{className:"text-[11px] text-muted-foreground truncate",children:F}),o.jsx("p",{className:"text-[10px] text-muted-foreground/80 mt-0.5",children:e("Scenario sliders adjusted. Tweak them to see how this bill could affect your pocket.","Vitelezi vya matukio vimerekebishwa. Vibadilishe kuona athari kwa mfuko wako.")})]}),o.jsx(Q,{variant:"ghost",size:"sm",className:"h-6 text-[10px] px-2",onClick:()=>Y(null),children:"Ã"})]}),o.jsx(Wae,{onJumpToScenario:B}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(At,{className:"text-xs",children:e("Monthly income (KES)","Mapato ya mwezi (KES)")}),o.jsx(ft,{type:"number",value:i,onChange:L=>r(Number(L.target.value||0)),className:"h-11 rounded-xl"}),o.jsx(pi,{drivers:fi(W,"paye",2)})]}),o.jsxs("div",{children:[o.jsx(Vi,{label:e("Rent","Kodi ya nyumba"),value:s,setValue:l,max:5e4,step:500}),o.jsx(pi,{drivers:fi(W,"housing",2)})]}),o.jsxs("div",{children:[o.jsx(Vi,{label:e("Food","Chakula"),value:u,setValue:c,max:5e4,step:500}),o.jsx(pi,{drivers:fi(W,"food",2)})]}),o.jsxs("div",{children:[o.jsx(Vi,{label:e("Transport","Usafiri"),value:h,setValue:d,max:3e4,step:250}),o.jsx(pi,{drivers:fi(W,"fuel",2)})]}),o.jsx(Vi,{label:e("Airtime / Data","Airtime / Data"),value:m,setValue:f,max:1e4,step:100}),o.jsx(Vi,{label:e("Other essentials","Mahitaji mengine"),value:y,setValue:g,max:2e4,step:250}),o.jsxs("div",{className:"space-y-2 rounded-xl border bg-muted/20 p-3",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("div",{className:"text-xs font-medium text-foreground",children:e("Custom expenses","Gharama zako mwenyewe")}),st>0&&o.jsxs("span",{className:"text-[10px] text-muted-foreground",children:[e("Total","Jumla"),": ",sn(st)]})]}),o.jsx("p",{className:"text-[10px] text-muted-foreground/80 -mt-1",children:e("Add anything else you spend on (school fees, loan, sacco, sub).","Ongeza chochote kingine unachotumia (karo, mkopo, sacco, sub).")}),q.length>0&&o.jsx("div",{className:"space-y-3 pt-1",children:q.map(L=>{const H=Math.max(1e4,Math.ceil(L.amount*2/1e3)*1e3);return o.jsx("div",{className:"space-y-1",children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("div",{className:"flex-1 min-w-0",children:o.jsx(Vi,{label:o.jsxs("span",{className:"flex items-center gap-1.5",children:[o.jsx("span",{className:"truncate",children:L.label}),L.vatable&&o.jsx(Ze,{variant:"outline",className:"h-4 px-1 text-[9px]",children:"VAT"})]}),value:L.amount,setValue:Z=>ae(q.map(Ae=>Ae.id===L.id?{...Ae,amount:Z}:Ae)),max:H,step:Math.max(100,Math.round(H/200))})}),o.jsx(Q,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0 mt-4 flex-shrink-0",onClick:()=>mt(L.id),"aria-label":e("Remove","Ondoa"),children:o.jsx(Rc,{className:"h-3 w-3"})})]})},L.id)})}),o.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row",children:[o.jsx(ft,{value:de,onChange:L=>me(L.target.value),placeholder:e("e.g. School fees","mfano: Karo"),maxLength:40,className:"h-9 text-xs flex-1"}),o.jsx(ft,{type:"number",inputMode:"numeric",value:Ce,onChange:L=>ke(L.target.value),placeholder:e("Amount (KES)","Kiasi (KES)"),className:"h-9 text-xs sm:w-32"})]}),o.jsxs("div",{className:"flex items-center justify-between gap-2",children:[o.jsxs("label",{className:"flex items-center gap-2 text-[10px] text-muted-foreground cursor-pointer",children:[o.jsx(dl,{checked:Ve,onCheckedChange:We}),e("Affected by VAT","Inaathiriwa na VAT")]}),o.jsxs(Q,{size:"sm",onClick:ht,disabled:!de.trim()||!Number(Ce)||q.length>=10,className:"h-8 text-xs",children:[o.jsx(ek,{className:"h-3 w-3"}),e("Add","Ongeza")]})]}),q.length>=10&&o.jsx("p",{className:"text-[10px] text-destructive",children:e("Maximum 10 custom expenses.","Kiwango cha juu ni gharama 10.")})]}),o.jsx(Am,{}),o.jsxs("div",{className:"flex items-start justify-between gap-3 rounded-xl border bg-muted/30 p-3",children:[o.jsxs("div",{className:"space-y-0.5",children:[o.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium",children:[o.jsx(hy,{className:"h-3.5 w-3.5 text-primary"}),e("Small business mode","Hali ya biashara ndogo")]}),o.jsx("p",{className:"text-[11px] text-muted-foreground",children:e("Estimate how tax and cost changes affect stock, logistics, and margins.","Kadiria jinsi kodi na gharama zinavyoathiri stoki, usafirishaji, na faida.")})]}),o.jsx(dl,{checked:x,onCheckedChange:w})]}),x&&o.jsxs(Le.div,{initial:{opacity:0,y:6}
683,animate:{opacity:1,y:0},className:"space-y-4 rounded-xl border bg-card/50 p-3",children:[o.jsx(Vi,{label:e("Monthly stock cost","Gharama ya stoki kwa mwezi"),value:v,setValue:k,max:15e4,step:1e3}),o.jsx(Vi,{label:e("Monthly logistics cost","Gharama ya usafirishaji"),value:j,setValue:S,max:6e4,step:500}),o.jsxs("div",{className:"space-y-2",children:[o.jsxs("div",{className:"flex items-center justify-between text-xs",children:[o.jsx("span",{className:"text-muted-foreground",children:e("Target profit margin","Lengo la faida")}),o.jsxs("span",{className:"font-medium",children:[_,"%"]})]}),o.jsx(Zc,{value:[_],onValueChange:L=>T(L[0]),min:0,max:60,step:1})]})]})]}),o.jsx(Am,{}),o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[o.jsx(Gd,{icon:o.jsx(yl,{className:"h-3.5 w-3.5"}),label:e("Take-home pay","Mshahara halisi"),value:sn(be.netIncome)}),o.jsx(Gd,{icon:o.jsx(xD,{className:"h-3.5 w-3.5"}),label:e("Total taxes","Jumla ya kodi"),value:sn(be.totalDirectTaxes)}),o.jsx(Gd,{icon:o.jsx(Jh,{className:"h-3.5 w-3.5"}),label:e("Price increase impact","Athari ya bei"),value:sn(be.totalCostIncrease)}),o.jsx(Gd,{icon:o.jsx(dD,{className:"h-3.5 w-3.5"}),label:e("Money left","Pesa iliyobaki"),value:sn(be.moneyLeft),emphasis:!0})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsxs("div",{className:"flex items-center justify-between text-xs",children:[o.jsx("span",{className:"text-muted-foreground",children:e("Budget pressure","Shinikizo la bajeti")}),o.jsxs("span",{className:"font-medium",children:[Math.round(be.strainLevel),"%"]})]}),o.jsx(Kf,{value:Math.min(be.strainLevel,100),className:"h-2"}),o.jsxs("p",{className:"text-[11px] text-muted-foreground pt-1",children:[o.jsxs("span",{className:"font-medium text-foreground",children:[U.title,"."]})," ",U.text]})]}),o.jsxs(Q,{variant:"ghost",size:"sm",className:"w-full text-xs",onClick:()=>
683O(!E),children:[E?o.jsx(Qx,{className:"h-3 w-3"}):o.jsx(Ec,{className:"h-3 w-3"}),E?e("Hide details","Ficha maelezo"):e("View more","Ona zaidi")]}),E&&o.jsxs(Le.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},className:"space-y-3",children:[o.jsxs(Yc,{value:A,onValueChange:L=>R(L),children:[o.jsxs(Rl,{className:"w-full grid grid-cols-2 h-9",children:[o.jsx(Gn,{value:"breakdown",className:"text-xs",children:e("Breakdown","Maelezo")}),o.jsx(Gn,{value:"scenarios",className:"text-xs",children:e("Scenarios","Matukio")})]}),o.jsxs(Ra,{value:"breakdown",className:"space-y-1.5 pt-3",children:[o.jsx(Ua,{label:e("Gross income","Mapato ya jumla"),value:sn(be.gross)}),o.jsx(Ua,{label:e("PAYE","PAYE"),value:`- ${sn(be.paye)}`}),o.jsx(Ua,{label:e("Health deduction","Makato ya afya"),value:`- ${sn(be.health)}`}),o.jsx(Ua,{label:e("Net income","Mapato halisi"),value:sn(be.netIncome),strong:!0}),o.jsx(Ua,{label:e("VAT impact","Athari ya VAT"),value:`+ ${sn(be.vatImpact)}`}),o.jsx(Ua,{label:e("Fuel pressure","Shinikizo la mafuta"),value:`+ ${sn(be.fuelImpact)}`}),o.jsx(Ua,{label:e("Housing pressure","Shinikizo la nyumba"),value:`+ ${sn(be.housingImpact)}`}),o.jsx(Ua,{label:e("Money left","Pesa iliyobaki"),value:sn(be.moneyLeft),strong:!0})]}),o.jsxs(Ra,{value:"scenarios",className:"space-y-3 pt-3",ref:V,children:[o.jsxs("div",{ref:L=>z.current.vat=L,className:"transition-all p-1 -m-1",children:[o.jsx(eu,{label:e("VAT rate","Kiwango cha VAT"),value:M,setValue:I,min:0,max:25,step:.5,suffix:"%"}),o.jsx(pi,{drivers:fi(W,"vat",3)})]}),o.jsxs("div",{ref:L=>z.current.fuel=L,className:"transition-all p-1 -m-1",children:[o.jsx(eu,{label:e("Fuel pressure","Shinikizo la mafuta"),value:b,setValue:C,min:0,max:40,step:1,suffix:"%"}),o.jsx(pi,{drivers:fi(W,"fuel",3)})]}),o.jsxs("div",{ref:L=>z.current.housing=L,className:"transition-all p-1 -m-1",children:[o.jsx(eu,{label:e("Housing pressure","Shinikizo la nyumba"),value:D,setValue:N,min:0,max:30,step:1,suffix:"%"}),o.jsx(pi,{drivers:fi(W,"housing",3)})]}),o.jsxs("div",{ref:L=>z.current.paye=L,className:"transition-all p-1 -m-1",children:[o.jsx(eu,{label:e("PAYE rate","Kiwango cha PAYE"),value:J,setValue:re,min:0,max:35,step:.5,suffix:"%"}),o.jsx(pi,{drivers:fi(W,"paye",3)})]}),o.jsxs("div",{ref:L=>z.current.health=L,className:"transition-all p-1 -m-1",children:[o.jsx(eu,{label:e("Health deduction","Makato ya afya"),value:ee,setValue:G,min:0,max:10,step:.25,suffix:"%"}),o.jsx(pi,{drivers:fi(W,"health",3)})]})]})]}),o.jsxs("div",{className:"rounded-xl border bg-muted/30 p-3 space-y-2",children:[o.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-medium",children:[o.jsx(Zx,{className:"h-3 w-3 text-primary"}),e("What this means","Maana yake")]}),o.jsx("p",{className:"text-[11px] text-muted-foreground leading-relaxed",children:e("This estimate translates public policy into personal impact. VAT mostly affects consumables, fuel pressure raises transport costs, and housing pressure reflects how broader inflation pushes up rent and utilities.","Kadirio hili linabadilisha sera ya umma kuwa athari ya kibinafsi. VAT inaathiri bidhaa, shinikizo la mafuta linapandisha gharama za usafiri, na shinikizo la nyumba linaonyesha ongezeko la kodi ya nyumba.")})]}),x&&o.jsxs("div",{className:"rounded-xl border border-accent/30 bg-accent/5 p-3 space-y-2",children:[o.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-medium",children:[o.jsx(hy,{className:"h-3 w-3 text-accent-foreground"}),e("Small business impact","Athari kwa biashara ndogo")]}),o.jsxs("div",{className:"space-y-1",children:[o.jsx(Ua,{label:e("Extra monthly costs","Gharama za ziada"),value:`+ ${sn(be.businessIncrease)}`}),o.jsx(Ua,{label:e("New profit margin","Faida mpya"),value:`${be.newBusinessMargin.toFixed(1)}%`,strong:!0})]}),o.jsx("p",{className:"text-[11px] text-muted-foreground",children:e("Rising taxes and logistics costs can reduce profit margins even when sales stay the same.","Ongezeko la kodi na usafirishaji laweza kupunguza faida hata pale mauzo yanapobaki sawa.")})]}),o.jsxs("div",{className:"rounded-xl border bg-card p-3 space-y-1.5",children:[o.jsx("div",{className:"text-xs font-medium",children:e("Smart spending tips","Mwongozo wa matumizi")}),o.jsx("ul",{className:"space-y-1",children:P.map((L,H)=>o.jsxs("li",{className:"text-[11px] text-muted-foreground leading-relaxed",children:["⢠",L]},H))})]})]})]})]})]})},Vi=({label:e,value:t,setValue:n,max:a,step:i})=>o.jsxs("div",{className:"space-y-2",children:[o.jsxs("div",{className:"flex items-center justify-between text-xs",children:[o.jsx("span",{className:"text-muted-foreground",children:e}),o.jsx("span",{className:"font-medium",children:sn(t)})]}),o.jsx(Zc,{value:[t],onValueChange:r=>n(r[0]),min:0,max:a,step:i})]}),Gd=({icon:e,label:t,value:n,emphasis:a=!1})=>o.jsxs("div",{className:`rounded-xl border p-3 ${a?"bg-primary/10 border-primary/30":"bg-card"}`,children:[o.jsxs("div",{className:"flex items-center gap-1 text-[10px] text-muted-foreground mb-1",children:[e,t]}),o.jsx("div",{className:`font-heading text-sm font-bold ${a?"text-primary":""}`,children:n})]}),Ua=({label:e,value:t,strong:n=!1})=>o.jsxs("div",{className:`flex items-center justify-between text-xs ${n?"font-semibold":""}`,children:[o.jsx("span",{className:n?"text-foreground":"text-muted-foreground",children:e}),o.jsx("span",{children:t})]}),eu=({label:e,value:t,setValue:n,min:a,max:i,step:r,suffix:s})=>o.jsxs("div",{className:"space-y-2",children:[o.jsxs("div",{className:"flex items-center justify-between text-xs",children:[o.jsx("span",{className:"text-muted-foreground",children:e}),o.jsxs("span",{className:"font-medium",children:[t,s]})]}),o.jsx(Zc,{value:[t],onValueChange:l=>n(l[0]),min:a,max:i,step:r})]}),mS=[{key:"student",label_en:"Student",label_sw:"Mwanafunzi",icon:pD},{key:"farmer",label_en:"Farmer",label_sw:"Mkulima",icon:FD},{key:"teacher",label_en:"Teacher",label_sw:"Mwalimu",icon:La},{key:"business",label_en:"Business Owner",label_sw:"Mfanyabiashara",icon:hy},{key:"parent",label_en:"Parent",label_sw:"Mzazi",icon:sD},{key:"freelancer",label_en:"Freelancer",label_sw:"Kazi ya Kibinafsi",icon:vD},{key:"employed",label_en:"Employed Worker",label_sw:"Mfanyakazi",icon:gD},{key:"unemployed",label_en:"Unemployed / Job Seeker",label_sw:"Sitajiri",icon:k2},{key:"other",label_en:"Other",label_sw:"Nyingine",icon:ef}],fS=[{key:"rent",label_en:"Rent / Housing",label_sw:"Kodi / Nyumba"},{key:"food",label_en:"Food",label_sw:"Chakula"},{key:"transport",label_en:"Transport",label_sw:"Usafiri"},{key:"education",label_en:"School fees / Education",label_sw:"Ada za shule"},{key:"healthcare",label_en:"Healthcare",label_sw:"Afya"},{key:"internet",label_en:"Internet / Airtime",label_sw:"Intaneti / Airtime"},{key:"fuel",label_en:"Fuel",label_sw:"Mafuta"},{key:"business_costs",label_en:"Business costs",label_sw:"Gharama za biashara"},{key:"farm_inputs",label_en:"Farm inputs",label_sw:"Pembejeo za shamba"},{key:"childcare",label_en:"Childcare",label_sw:"Malezi ya mtoto"},{key:"loans",label_en:"Loan payments",label_sw:"Malipo ya mkopo"},{key:"other",label_en:"Other",label_sw:"Nyingine"}],Yae=[{key:"finance_bill",label_en:"Finance Bill",label_sw:"Mswada wa Fedha"},{key:"national_budget",label_en:"National Budget",label_sw:"Bajeti ya Taifa"},{key:"vat",label_en:"VAT change",label_sw:"Mabadiliko ya VAT"},{key:"fuel_levy",label_en:"Fuel levy",label_sw:"Ushuru wa mafuta"},{key:"housing_levy",label_en:"Housing levy",label_sw:"Ushuru wa nyumba"},{key:"paye",label_en:"PAYE change",label_sw:"Mabadiliko ya PAYE"},{key:"health",label_en:"Healthcare deductions",label_sw:"Makato ya afya"},{key:"education_funding",label_en:"Education funding change",label_sw:"Mabadiliko ya ufadhili wa elimu"},{key:"custom",label_en:"Custom policy",label_sw:"Sera maalum"}],Jae={student:["food","transport","internet","education"],farmer:["farm_inputs","transport","fuel","food","loans"],teacher:["rent","food","transport","internet","education"],business:["business_costs","rent","transport","internet","loans"],parent:["food","rent","education","healthcare","childcare"],freelancer:["rent","food","internet","transport"],employed:["rent","food","transport","internet","healthcare"],unemployed:["food","transport","internet"],other:["food","transport","internet"]};function Qae(e,t,n){const a={},i=(r,s)=>{s>0&&(a[r]=(a[r]||0)+s)};switch(e){case"vat":case"finance_bill":case"national_budget":{const r=e==="vat"?.02:.015;i("food",(n.food||0)*r),i("internet",(n.internet||0)*r),i("business_costs",(n.business_costs||0)*r),i("other",(n.other||0)*r),e!=="vat"&&(i("transport",(n.transport||0)*.02),i("fuel",(n.fuel||0)*.03),i("paye",t*.005));break}case"fuel_levy":{i("fuel",(n.fuel||0)*.08),i("transport",(n.transport||0)*.06),i("food",(n.food||0)*.01);break}case"housing_levy":{i("housing_levy",t*.015);break}case"paye":{i("paye",t*.015);break}case"health":{i("health",Math.max(t*.0175-t*.0275*0,t*.005));break}case"education_funding":{i("education",(n.education||0)*.1);break}
683case"custom":{i("food",(n.food||0)*.01),i("transport",(n.transport||0)*.01),i("other",(n.other||0)*.01);break}}return a}const Yd={rent:{en:"Rent / Housing",sw:"Kodi / Nyumba"},food:{en:"Food",sw:"Chakula"},transport:{en:"Transport",sw:"Usafiri"},education:{en:"Education",sw:"Elimu"},healthcare:{en:"Healthcare",sw:"Afya"},internet:{en:"Internet / Airtime",sw:"Intaneti / Airtime"},fuel:{en:"Fuel",sw:"Mafuta"},business_costs:{en:"Business costs",sw:"Gharama za biashara"},farm_inputs:{en:"Farm inputs",sw:"Pembejeo"},childcare:{en:"Childcare",sw:"Malezi"},loans:{en:"Loans",sw:"Mkopo"},other:{en:"Other",sw:"Nyingine"},paye:{en:"PAYE (income tax)",sw:"PAYE"},health:{en:"Health deduction",sw:"Makato ya afya"},housing_levy:{en:"Housing levy",sw:"Ushuru wa nyumba"}};function eo(e){return new Intl.NumberFormat("en-KE",{style:"currency",currency:"KES",maximumFractionDigits:0}).format(Math.round(e))}const Xae=()=>{const{t:e,lang:t}=Re(),{user:n}=Rt(),{toast:a}=Zn(),i=Mn(),[r,s]=p.useState(1),[l,u]=p.useState(null),[c,h]=p.useState(""),[d,m]=p.useState(""),[f,y]=p.useState({}),[g,x]=p.useState(null),[w,v]=p.useState(""),[k,j]=p.useState(!1),[S,_]=p.useState(!1),T=B=>{u(B);const M=Jae[B],I={...f};M.forEach(b=>{b in I||(I[b]=0)}),y(I)},E=(B,M)=>{y(I=>({...I,[B]:M}))},O=B=>{y(M=>{const I={...M};return B in I?delete I[B]:I[B]=0,I})},A=Number(d)||0,R=p.useMemo(()=>{if(!g)return null;const B=Qae(g,A,f),M=Object.values(B).reduce((D,N)=>D+N,0),I=M*12,b=A>0?M/A*100:0;let C="low";return b>7?C="high":b>=2&&(C="medium"),{breakdown:B,monthly:M,annual:I,pct:b,level:C}},[g,A,f]),F=5,Y=r===1?!!l&&(l!=="other"||c.trim().length>0):r===2?A>0:r===3?Object.values(f).some(B=>B>0):r===4?!!g&&(g!=="custom"||w.trim().length>0):!0,V=()=>{s(1),u(null),h(""),m(""),y({}),x(null),v(""),_(!1)},z=async()=>{if(!n){_(!0);return}if(!R||!l||!g)return;j(!0);const{error:B}=await te.from("pesa_yangu_scenarios").insert({user_id:n.id,persona:l,custom_persona:l==="other"?c.trim().slice(0,80):null,monthly_income:A,expenses:f,policy_type:g,custom_policy_description:g==="custom"?w.trim().slice(0,500):null,monthly_impact:Math.round(R.monthly),annual_impact:Math.round(R.annual),impact_level:R.level,category_breakdown:R.breakdown});if(j(!1),B){a({title:e("Could not save","Imeshindwa kuhifadhi"),description:B.message,variant:"destructive"});return}a({title:e("Scenario saved","Imehifadhiwa"),description:e("You can revisit it anytime.","Waweza kuirudia wakati wowote.")})},W=()=>{if(!l)return"";if(l==="other")return c||e("You","Wewe");const B=mS.find(M=>M.key===l);return t==="en"?B.label_en:B.label_sw};return o.jsxs(X,{className:"overflow-hidden border-primary/20",children:[o.jsxs(hr,{className:"bg-gradient-to-br from-primary/10 via-accent/5 to-transparent",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[o.jsx(yl,{className:"h-4 w-4 text-primary"}),o.jsx(Ze,{variant:"secondary",className:"text-[10px]",children:e("Personal Budget Impact","Athari kwa Bajeti Yako")})]}),o.jsx(mr,{className:"font-heading text-lg",children:e("How this bill affects your pocket","Jinsi mswada huu unavyoathiri mfuko wako")}),o.jsx(sv,{className:"text-xs",children:e("Answer a few simple questions and see the estimated monthly impact on your money.","Jibu maswali machache uone athari ya kila mwezi kwenye pesa yako.")}),o.jsxs("div",{className:"pt-3 space-y-1.5",children:[o.jsxs("div",{className:"flex items-center justify-between text-[10px] text-muted-foreground",children:[o.jsxs("span",{children:[e("Step","Hatua")," ",r," ",e("of","ya")," ",F]}),o.jsxs("span",{children:[Math.round(r/F*100),"%"]})]}),o.jsx(Kf,{value:r/F*100,className:"h-1.5"})]})]}),o.jsxs(en,{className:"pt-5 space-y-5",children:[o.jsxs(Rv,{mode:"wait",children:[r===1&&o.jsxs(Le.div,{initial:{opacity:0,x:8},animate:{opacity:1,x:0},exit:{opacity:0,x:-8},className:"space-y-3",children:[o.jsx("h3",{className:"font-heading font-semibold text-sm",children:e("Which best describes you?","Nini kinachokufafanua vyema?")}),o.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-2",children:mS.map(B=>{const M=B.icon,I=l===B.key;return o.jsxs("button",{type:"button",onClick:()=>T(B.key),className:`flex flex-col items-center gap-1.5 rounded-xl border p-3 text-center transition ${I?"border-primary bg-primary/10 shadow-sm":"border-border hover:border-primary/50 hover:bg-muted/50"}`,children:[o.jsx(M,{className:`h-5 w-5 ${I?"text-primary":"text-muted-foreground"}`}),o.jsx("span",{className:"text-[11px] font-medium leading-tight",children:t==="en"?B.label_en:B.label_sw})]},B.key)})}),l==="other"&&o.jsxs("div",{className:"space-y-1.5",children:[o.jsx(At,{className:"text-xs",children:e("Tell us about you","Tueleze kukuhusu")}),o.jsx(ft,{value:c,onChange:B=>h(B.target.value.slice(0,60)),placeholder:e("e.g. Boda boda rider","k.m. Dereva wa boda")})]})]},"s1"),r===2&&o.jsxs(Le.div,{initial:{opacity:0,x:8}
683,animate:{opacity:1,x:0},exit:{opacity:0,x:-8},className:"space-y-3",children:[o.jsx("h3",{className:"font-heading font-semibold text-sm",children:e("About how much money do you earn per month?","Unapata pesa ngapi kwa mwezi takribani?")}),o.jsx("p",{className:"text-[11px] text-muted-foreground",children:e("An estimate is fine. We use this to size the impact.","Kadirio linatosha. Tunatumia kupima athari.")}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsx(At,{className:"text-xs",children:e("Monthly income (KSh)","Mapato ya mwezi (KSh)")}),o.jsx(ft,{type:"number",inputMode:"numeric",min:0,value:d,onChange:B=>m(B.target.value),placeholder:"e.g. 25000",className:"text-base"})]}),o.jsx("div",{className:"flex flex-wrap gap-1.5",children:[5e3,15e3,3e4,6e4,1e5].map(B=>o.jsx(Q,{size:"sm",variant:"outline",className:"h-7 text-[11px]",onClick:()=>m(String(B)),children:eo(B)},B))})]},"s2"),r===3&&o.jsxs(Le.div,{initial:{opacity:0,x:8},animate:{opacity:1,x:0},exit:{opacity:0,x:-8},className:"space-y-3",children:[o.jsx("h3",{className:"font-heading font-semibold text-sm",children:e("What do you spend money on each month?","Unatumia pesa kwenye nini kila mwezi?")}),o.jsx("p",{className:"text-[11px] text-muted-foreground",children:e("Tap categories to add or remove. Enter roughly what you spend.","Gusa kuongeza au kuondoa. Weka kadirio la matumizi.")}),o.jsx("div",{className:"flex flex-wrap gap-1.5",children:fS.map(B=>{const M=B.key in f;return o.jsx("button",{type:"button",onClick:()=>O(B.key),className:`text-[11px] px-2.5 py-1 rounded-full border transition ${M?"bg-primary text-primary-foreground border-primary":"border-border hover:border-primary/50"}`,children:t==="en"?B.label_en:B.label_sw},B.key)})}),o.jsxs("div",{className:"space-y-2",children:[fS.filter(B=>B.key in f).map(B=>o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(At,{className:"text-xs flex-1 min-w-0 truncate",children:t==="en"?B.label_en:B.label_sw}),o.jsx(ft,{type:"number",inputMode:"numeric",min:0,value:f[B.key]||"",onChange:M=>E(B.key,Number(M.target.value)||0),placeholder:"KSh",className:"h-9 w-32 text-sm"})]},B.key)),Object.keys(f).length===0&&o.jsx("p",{className:"text-[11px] text-muted-foreground italic",children:e("Add at least one category to continue.","Ongeza angalau kitengo kimoja kuendelea.")})]})]},"s3"),r===4&&o.jsxs(Le.div,{initial:{opacity:0,x:8},animate:{opacity:1,x:0},exit:{opacity:0,x:-8},className:"space-y-3",children:[o.jsx("h3",{className:"font-heading font-semibold text-sm",children:e("Which bill or budget change do you want to test?","Ni mabadiliko gani ya mswada au bajeti unayotaka kujaribu?")}),o.jsx("div",{className:"grid grid-cols-2 gap-2",children:Yae.map(B=>{const M=g===B.key;return o.jsx("button",{type:"button",onClick:()=>x(B.key),className:`text-left rounded-xl border p-3 transition ${M?"border-primary bg-primary/10 shadow-sm":"border-border hover:border-primary/50 hover:bg-muted/50"}`,children:o.jsx("div",{className:"text-[12px] font-medium leading-tight",children:t==="en"?B.label_en:B.label_sw})},B.key)})}),g==="custom"&&o.jsxs("div",{className:"space-y-1.5",children:[o.jsx(At,{className:"text-xs",children:e("Describe the policy in plain words","Eleza sera kwa lugha rahisi")}),o.jsx(Ia,{rows:3,value:w,onChange:B=>v(B.target.value.slice(0,500)),placeholder:e("e.g. Government adds 5% tax on mobile money","k.m. Serikali inaongeza kodi ya 5% kwenye pesa za simu")})]})]},"s4"),r===5&&R&&o.jsxs(Le.div,{initial:{opacity:0,x:8},animate:{opacity:1,x:0},exit:{opacity:0,x:-8},className:"space-y-4",children:[o.jsxs("div",{className:"rounded-xl border border-primary/30 bg-gradient-to-br from-primary/10 to-accent/5 p-4 text-center",children:[o.jsxs("div",{className:"flex items-center justify-center gap-1.5 text-[11px] text-muted-foreground mb-1",children:[o.jsx(Hn,{className:"h-3 w-3"})," ",e("Estimated monthly impact","Athari ya mwezi (kadirio)")]}),o.jsxs("div",{className:"font-heading text-3xl font-bold text-primary",children:["+",eo(R.monthly)]}),o.jsxs("div",{className:"text-[11px] text-muted-foreground mt-1",children:[e("Estimated annual impact","Athari ya mwaka (kadirio)"),": ",o.jsxs("span",{className:"font-semibold text-foreground",children:["+",eo(R.annual)]})]}),o.jsxs(Ze,{variant:R.level==="high"?"destructive":R.level==="medium"?"default":"secondary",className:"mt-2 text-[10px]",children:[R.level==="low"&&e("Low impact","Athari ndogo"),R.level==="medium"&&e("Medium impact","Athari ya wastani"),R.level==="high"&&e("High impact","Athari kubwa")," · ",R.pct.toFixed(1),"% ",e("of income","ya mapato")]})]}),o.jsxs("div",{className:"rounded-xl border p-3 space-y-1.5",children:[o.jsx("div",{className:"text-[11px] font-semibold text-foreground",children:e("How this affects your pocket","Jinsi hii inavyoathiri mfuko wako")}),o.jsxs("p",{className:"text-[12px] text-muted-foreground leading-relaxed",children:[e(`For someone like a ${W().toLowerCase()} earning ${eo(A)} per month, this change mostly affects `,`Kwa mtu kama ${W().toLowerCase()} anayepata ${eo(A)} kwa mwezi, mabadiliko haya yanaathiri zaidi `),o.jsx("span",{className:"font-semibold text-foreground",children:Object.entries(R.breakdown).sort((B,M)=>M[1]-B[1]).slice(0,2).map(([B])=>{var M,I;return(t==="en"?(M=Yd[B])==null?void 0:M.en:(I=Yd[B])==null?void 0:I.sw)||B}).join(e(" and "," na "))}),"."]})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsx("div",{className:"text-[11px] font-semibold",children:e("Category breakdown","Mchanganuo wa kategoria")}),Object.entries(R.breakdown).length===0&&o.jsx("p",{className:"text-[11px] text-muted-foreground italic",children:e("No measurable impact on the categories you entered.","Hakuna athari inayoonekana kwenye kategoria zako.")}),o.jsx("div",{className:"space-y-1",children:Object.entries(R.breakdown).sort((B,M)=>M[1]-B[1]).map(([B,M])=>{var C,D;const I=Math.max(...Object.values(R.breakdown)),b=I>0?M/I*100:0;return o.jsxs("div",{className:"space-y-0.5",children:[o.jsxs("div",{className:"flex items-center justify-between text-[11px]",children:[o.jsx("span",{className:"text-muted-foreground",children:t==="en"?(C=Yd[B])==null?void 0:C.en:((D=Yd[B])==null?void 0:D.sw)||B}),o.jsxs("span",{className:"font-semibold",children:["+",eo(M)]})]}),o.jsx("div",{className:"h-1.5 rounded-full bg-muted overflow-hidden",children:o.jsx("div",{className:"h-full bg-primary",style:{width:`${b}%`}})})]},B)})})]}),o.jsx("div",{className:"rounded-lg bg-muted/50 border border-border p-3",children:o.jsx("p",{className:"text-[11px] text-muted-foreground leading-relaxed",children:e("This is an estimate based on the information you entered. Real impact may vary depending on prices, county, household size, and actual government implementation.","Hii ni kadirio kutokana na uliyoingiza. Athari halisi inaweza kutofautiana kulingana na bei, kaunti, ukubwa wa familia na jinsi
683serikali inavyotekeleza.")})}),S&&!n&&o.jsxs("div",{className:"rounded-xl border border-primary/30 bg-primary/5 p-3 space-y-2",children:[o.jsx("p",{className:"text-[12px] font-semibold",children:e("Create a free account to save your Pesa Yangu scenarios.","Fungua akaunti bila malipo kuhifadhi matukio yako ya Pesa Yangu.")}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx(Q,{size:"sm",onClick:()=>i("/welcome"),children:e("Create account","Fungua akaunti")}),o.jsx(Q,{size:"sm",variant:"ghost",onClick:()=>_(!1),children:e("Not now","Sio sasa")})]})]})]},"s5")]}),o.jsx(Am,{}),o.jsxs("div",{className:"flex items-center justify-between gap-2",children:[r>1?o.jsxs(Q,{variant:"ghost",size:"sm",onClick:()=>s(B=>Math.max(1,B-1)),children:[o.jsx(tl,{className:"h-4 w-4 mr-1"})," ",e("Back","Rudi")]}):o.jsx("div",{}),o.jsxs("div",{className:"flex items-center gap-2",children:[r===5&&o.jsxs(o.Fragment,{children:[o.jsxs(Q,{size:"sm",variant:"outline",onClick:V,children:[o.jsx(RD,{className:"h-4 w-4 mr-1"})," ",e("New scenario","Tukio jipya")]}),o.jsxs(Q,{size:"sm",onClick:z,disabled:k,children:[o.jsx(gy,{className:"h-4 w-4 mr-1"}),e(n?"Save":"Save scenario","Hifadhi")]})]}),r<5&&o.jsx(Q,{size:"sm",disabled:!Y,onClick:()=>s(B=>Math.min(5,B+1)),children:r===4?o.jsxs(o.Fragment,{children:[o.jsx(cD,{className:"h-4 w-4 mr-1"})," ",e("See impact","Ona athari")]}):o.jsxs(o.Fragment,{children:[e("Next","Ifuatayo")," ",o.jsx(Kn,{className:"h-4 w-4 ml-1"})]})})]})]})]})]})},Zae=()=>{const{t:e}=Re();return o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"relative overflow-hidden rounded-2xl h-32",children:[o.jsx("img",{src:Lv,alt:"",className:"absolute inset-0 w-full h-full object-cover"}),o.jsx("div",{className:"absolute inset-0 bg-primary/70"}),o.jsxs("div",{className:"relative h-full flex flex-col justify-center px-5",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(yl,{className:"h-5 w-5 text-primary-foreground"}),o.jsx("h1",{className:"font-heading text-xl font-bold text-primary-foreground",children:e("Pesa Yangu","Pesa Yangu")})]}),o.jsx("p",{className:"text-xs text-primary-foreground/80 mt-1",children:e("See how policy and taxes affect your pocket.","Tazama jinsi sera na kodi zinavyoathiri mfuko wako.")})]})]}),o.jsx(Xae,{}),o.jsx(Gae,{})]})},eie=()=>{const e=Or();return p.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",e.pathname)},[e.pathname]),o.jsx("div",{className:"flex min-h-screen items-center justify-center bg-muted",children:o.jsxs("div",{className:"text-center",children:[o.jsx("h1",{className:"mb-4 text-4xl font-bold",children:"404"}),o.jsx("p",{className:"mb-4 text-xl text-muted-foreground",children:"Oops! Page not found"}),o.jsx("a",{href:"/",className:"text-primary underline hover:text-primary/90",children:"Return to Home"})]})})},tie=()=>{const{t:e}=Re();return o.jsxs("div",{className:"space-y-5 pb-8 max-w-2xl mx-auto",children:[o.jsxs(Ue,{to:"/settings",className:"inline-flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[o.jsx(tl,{className:"h-3.5 w-3.5"}),e("Back to Settings","Rudi kwa Mipangilio")]}),o.jsx(X,{className:"overflow-hidden border-primary/30 bg-gradient-to-br from-primary/15 via-background to-accent/10",children:o.jsxs("div",{className:"p-6 space-y-3",children:[o.jsxs("div",{className:"inline-flex items-center gap-1.5 rounded-full bg-primary/15 px-3 py-1",children:[o.jsx(Ai,{className:"h-3 w-3 text-primary"}),o.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wide text-primary",children:e("Legal","Kisheria")})]}),o.jsx("h1",{className:"font-heading text-2xl font-black leading-tight",children:e("Privacy Policy","Sera ya Faragha")}),o.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:e("Last updated: 16 June 2026 · Effective immediately","Imesasishwa: 16 Juni 2026 · Inaanza mara moja")})]})}),o.jsxs(X,{className:"p-6 space-y-6 bg-card/60 backdrop-blur",children:[o.jsxs("section",{className:"space-y-3",children:[o.jsx("h2",{className:"font-heading text-sm font-bold text-foreground",children:e("1. Introduction","1. Utangulizi")}),o.jsx("p",{className:"text-[13px] leading-[1.75] text-foreground
683/90",children:e('CLICK ("we", "us", or "our") is committed to protecting your privacy. This Privacy Policy explains how we collect, use, store, and protect your personal information when you use our mobile and web application. By using CLICK, you agree to the practices described in this policy.','CLICK ("sisi") imejitolea kulinda faragha yako. Sera hii ya Faragha inaelezea jinsi tunavyokusanya, kutumia, kuhifadhi, na kulinda taarifa zako za kibinafsi unapotumia programu yetu ya simu na wavuti. Kwa kutumia CLICK, unakubali mienendo iliyoelezwa katika sera hii.')})]}),o.jsxs("section",{className:"space-y-3",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Pc,{className:"h-4 w-4 text-primary"}),o.jsx("h2",{className:"font-heading text-sm font-bold text-foreground",children:e("2. Location Data","2. Taarifa za Mahali")})]}),o.jsx("p",{className:"text-[13px] leading-[1.75] text-foreground/90",children:e("We collect your location data strictly for the purpose of showing nearby election centers, polling stations, and civic events relevant to your area. We do not track your location in the background, nor do we monitor your movements continuously. Location access is only active when you explicitly request to find nearby centers or events, and you can disable location permissions at any time through your device settings.","Tunakusanya taarifa za mahali pako kwa madhumuni ya kuonyesha vituo vya uchaguzi vilivyo karibu, vituo vya kupigia kura, na matukio ya kiraia yanayohusu eneo lako. Hatufuatilii mahali pako kwenye mandharinyuma, wala hatuchunguzi mwendo wako mara kwa mara. Mfikiaji wa mahali unafanya kazi tu unapotaka moja kwa moja kupata vituo au matukio vilivyo karibu, na unaweza kuzima ruhusa za mahali wakati wowote kupitia mipangilio ya kifaa chako.")})]}),o.jsxs("section",{className:"space-y-3",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(OD,{className:"h-4 w-4 text-primary"}),o.jsx("h2",{className:"font-heading text-sm font-bold text-foreground",children:e("3. Data Storage & Security","3. Hifadhi na Usalama wa Data")})]}),o.jsx("p",{className:"text-[13px] leading-[1.75] text-foreground/90",children:e("Your account registration details â including your name, email address, password, and profile information â are stored securely using Lovable Cloud infrastructure. All data is encrypted in transit and at rest. We implement industry-standard security measures, including secure authentication protocols and regular security audits, to protect your information from unauthorized access, alteration, or disclosure.","Taarifa zako za usajili wa akaunti â ikiwa ni pamoja na jina lako, anwani ya barua pepe, nywila, na taarifa za wasifu â zinahifadhiwa kwa usalama ukitumia miundombinu ya Lovable Cloud. Data yote inasimbwa wakati wa usafiri na wakati wa kuhifadhiwa. Tunatekeleza hatua za usalama zilizokubalika kimataifa, ikiwa ni pamoja na itifaki salama za uthibitishaji na ukaguzi wa usalama mara kwa mara, ili kulinda taarifa zako dhidi ya ufikiaji usioidhinishwa, mabadiliko, au ufichuzi.")})]}),o.jsxs("section",{className:"space-y-3",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(oD,{className:"h-4 w-4 text-primary"}),o.jsx("h2",{className:"font-heading text-sm font-bold text-foreground",children:e("4. No Sale of User Data","4. Hakuna Uuzaji wa Data ya Watumiaji")})]}),o.jsx("p",{className:"text-[13px] leading-[1.75] text-foreground/90",children:e("We do not sell, rent, trade, or otherwise transfer your personal data to third parties for commercial purposes. We do not share your information with advertisers, data brokers, or marketing companies. Your data is used solely to provide and improve the CLICK service, deliver personalized civic content, and facilitate your engagement with legislative and electoral processes.","Hatuuzi, kuagiza, kufanya biashara, au kuhamisha data yako ya kibinafsi kwa wahusika wengine kwa madhumuni ya kibiashara. Hatugawi taarifa zako na watangazaji, wafanyabiashara wa data, au kampuni za masoko. Data yako inatumika tu kutoa na kuboresha huduma ya CLICK, kutoa maudhui ya kiraia yaliyobinafsishwa, na kurahisisha ushiriki wako katika michakato ya kisheria na uchaguzi.")})]}),o.jsxs("section",{className:"space-y-3",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Mc,{className:"h-4 w-4 text-primary"}),o.jsx("h2",{className:"font-heading text-sm font-bold text-foreground",children:e("5. Account Deletion","5. Kufuta Akaunti")})]}),o.jsx("p",{className:"text-[13px] leading-[1.75] text-foreground
683/90",children:e("You have the right to permanently delete your CLICK account and all associated data at any time. Account deletion can be initiated from your Profile page within the app settings. Upon deletion, all personal information, activity history, saved preferences, forum posts, and civic score data will be irreversibly removed from our systems within 30 days. Some anonymized statistical data may be retained for analytical purposes, but it will not be linked to your identity.","Unayo haki ya kufuta akaunti yako ya CLICK na data yote inayohusiana wakati wowote. Kufuta akaunti kunaweza kuanzishwa kutoka kwenye ukurasa wa Wasifu wako ndani ya mipangilio ya programu. Baada ya kufuta, taarifa zote za kibinafsi, historia ya shughuli, mapendekezo yaliyohifadhiwa, machapisho ya jukwaa, na data ya alama ya uraia itaondolewa kabisa kutoka kwenye mifumo yetu ndani ya siku 30. Baadhi ya data ya takwimu isiyojulikana inaweza kuhifadhiwa kwa madhumuni ya uchanganuzi, lakini haitaunganishwa na utambulisho wako.")})]}),o.jsxs("section",{className:"space-y-3",children:[o.jsx("h2",{className:"font-heading text-sm font-bold text-foreground",children:e("6. Data We Collect","6. Data Tunayokusanya")}),o.jsx("p",{className:"text-[13px] leading-[1.75] text-foreground/90",children:e("We collect the following categories of information: (a) Account information â name, email, password, display name, and optional profile photo; (b) Location data â when you explicitly request nearby election centers or events; (c) Preferences â your selected county, followed bill categories, and notification settings; (d) Civic activity â bills you follow, questions you ask, forum posts you make, and your civic score progress; (e) Device information â operating system, app version, and crash logs for debugging purposes only.","Tunakusanya kategoria zifuatazo za taarifa: (a) Taarifa za akaunti â jina, barua pepe, nywila, jina la kuonyesha, na picha ya hiari ya wasifu; (b) Data ya mahali â unapotaka moja kwa moja vituo vya uchaguzi au matukio vilivyo karibu; (c) Mapendekezo â kaunti yako uliyochagua, kategoria za miswada unayofuatilia, na mipangilio ya arifa; (d) Shughuli ya kiraia â miswada unayofuatilia, maswali unayouliza, machapisho ya jukwaa unayoyafanya, na maendeleo ya alama yako ya uraia; (e) Taarifa za kifaa â mfumo wa uendeshaji, toleo la programu, na rekodi za hitilafu kwa madhumuni ya kutatua matatizo tu.")})]}),o.jsxs("section",{className:"space-y-3",children:[o.jsx("h2",{className:"font-heading text-sm font-bold text-foreground",children:e("7. Third-Party Services","7. Huduma za Wahusika Wengine")}),o.jsx("p",{className:"text-[13px] leading-[1.75] text-foreground/90",children:e("CLICK integrates with Lovable Cloud for authentication, database storage, and backend services. We may also use analytics tools to understand app usage patterns in aggregate. These service providers have access to your data only to the extent necessary to perform their functions and are contractually bound to maintain its confidentiality and security.","CLICK inaunganishwa na Lovable Cloud kwa uthibitishaji, hifadhi ya hifadhidata, na huduma za nyuma. Tunaweza pia kutumia zana za uchanganuzi kuelewa mienendo ya matumizi ya programu kwa jumla. Watoa huduma hawa wanaweza kufikia data yako kwa kiwango kinachohitajika tu kutekeleza kazi zao na wamefungwa kisheria kudumisha siri na usalama wake.")})]}),o.jsxs("section",{className:"space-y-3",children:[o.jsx("h2",{className:"font-heading text-sm font-bold text-foreground",children:e("8. Children's Privacy","8. Faragha ya Watoto")}),o.jsx("p",{className:"text-[13px] leading-[1.75] text-foreground/90",children:e("CLICK is designed for Kenyan citizens aged 18 to 35. We do not knowingly collect personal information from individuals under the age of 18. If we become aware that we have inadvertently collected data from a minor, we will take immediate steps to delete such information.","CLICK imeundwa kwa raia wa Kenya waliopo kati ya miaka 18 na 35. Hatukusanyi taarifa za kibinafsi kwa makusudi kutoka kwa watu waliopo chini ya miaka 18. Ikiwa tutagundua kwamba tumejikusanyia data kutoka kwa mtoto, tutachukua hatua za mara moja kufuta taarifa hizo.")})]}),o.jsxs("section",{className:"space-y-3",children:[o.jsx("h2",{className:"font-heading text-sm font-bold text-foreground",children:e("9. Changes to This Policy","9. Mabadiliko ya Sera Hii")}),o.jsx("p",{className:"text-[13px] leading-[1.75] text-foreground
683/90",children:e("We may update this Privacy Policy from time to time to reflect changes in our practices or for legal reasons. We will notify you of any material changes through the app or via email. Continued use of CLICK after such changes constitutes acceptance of the revised policy.","Tunaweza kusasisha Sera hii ya Faragha mara kwa mara kuwakilisha mabadiliko katika mienendo yetu au kwa sababu za kisheria. Tutakuarifu juu ya mabadiliko yoyote muhimu kupitia programu au kwa barua pepe. Endelea kutumia CLICK baada ya mabadiliko hayo kunamaanisha kukubaliana na sera iliyorekebishwa.")})]}),o.jsxs("section",{className:"space-y-3",children:[o.jsx("h2",{className:"font-heading text-sm font-bold text-foreground",children:e("10. Contact Us","10. Wasiliana Nasi")}),o.jsx("p",{className:"text-[13px] leading-[1.75] text-foreground/90",children:e("If you have any questions, concerns, or requests regarding this Privacy Policy or your personal data, please contact us through the Help & Support section of the app.","Ikiwa una maswali, wasiwasi, au maombi kuhusu Sera hii ya Faragha au data yako ya kibinafsi, tafadhali wasiliana nasi kupitia sehemu ya Usaidizi na Msaada ya programu.")})]}),o.jsxs("div",{className:"pt-4 border-t border-border/50 text-[11px] text-muted-foreground text-center",children:[o.jsx("span",{className:"font-heading font-bold text-foreground",children:"CLICK"}),o.jsxs("span",{children:[" · ",e("Kiambu County, Kenya","Kaunti ya Kiambu, Kenya")," · ",e("Built in 2026","Imejengwa 2026")]})]})]}),o.jsx(Ue,{to:"/welcome",children:o.jsx(Q,{variant:"outline",size:"sm",className:"w-full text-xs",children:e("View intro & onboarding guide","Tazama utangulizi na mwongozo")})})]})},nie=()=>{const{t:e}=Re();return o.jsxs("div",{className:"space-y-5 pb-8 max-w-2xl mx-auto",children:[o.jsxs(Ue,{to:"/settings",className:"inline-flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[o.jsx(tl,{className:"h-3.5 w-3.5"}),e("Back to Settings","Rudi kwa Mipangilio")]}),o.jsx(X,{className:"overflow-hidden border-primary/30 bg-gradient-to-br from-primary/15 via-background to-accent/10",children:o.jsxs("div",{className:"p-6 space-y-3",children:[o.jsxs("div",{className:"inline-flex items-center gap-1.5 rounded-full bg-primary/15 px-3 py-1",children:[o.jsx(Ft,{className:"h-3 w-3 text-primary"}),o.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wide text-primary",children:e("Legal","Kisheria")})]}),o.jsx("h1",{className:"font-heading text-2xl font-black leading-tight",children:e("Terms of Service","Masharti ya Huduma")}),o.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:e("Last updated: 16 June 2026 · Effective immediately","Imesasishwa: 16 Juni 2026 · Inaanza mara moja")})]})}),o.jsxs(X,{className:"p-6 space-y-6 bg-card/60 backdrop-blur",children:[o.jsxs("section",{className:"space-y-3",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Jn,{className:"h-4 w-4 text-primary"}),o.jsx("h2",{className:"font-heading text-sm font-bold text-foreground",children:e("1. Acceptance of Terms","1. Kukubaliana na Masharti")})]}),o.jsx("p",{className:"text-[13px] leading-[1.75] text-foreground/90",children:e('By accessing or using CLICK (the "App"), you agree to be bound by these Terms of Service and our Privacy Policy. If you do not agree to these terms, you may not use the App. These terms apply to all visitors, users, and others who access or use the App.','Kwa kufikia au kutumia CLICK ("Programu"), unakubali kufungwa na Masharti haya ya Huduma na Sera yetu ya Faragha. Ikiwa hukubaliani na masharti haya, huwezi kutumia Programu. Masharti haya yanatumika kwa w
683ageni, watumiaji, na wengine wote wanaofikia au kutumia Programu.')})]}),o.jsxs("section",{className:"space-y-3",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Jn,{className:"h-4 w-4 text-primary"}),o.jsx("h2",{className:"font-heading text-sm font-bold text-foreground",children:e("2. Description of Service","2. Maelezo ya Huduma")})]}),o.jsx("p",{className:"text-[13px] leading-[1.75] text-foreground/90",children:e("CLICK is a civic engagement platform designed for Kenyan citizens aged 18 to 35. The App provides information about parliamentary bills, budgets, civic events, and facilitates public participation in governance processes. Features include bill tracking, civic score tracking, public guides, event discovery, and access to legal Q&A.","CLICK ni jukwaa la ushiriki wa kiraia lililoundwa kwa raia wa Kenya waliopo kati ya miaka 18 na 35. Programu inatoa taarifa kuhusu miswada ya bunge, bajeti, matukio ya kiraia, na kurahisisha ushiriki wa umma katika michakato ya utawala. Vipengele ni pamoja na ufuatiliaji wa miswada, ufuatiliaji wa alama ya uraia, miongozo ya umma, ugunduzi wa matukio, na ufikiaji wa maswali na majibu ya kisheria.")})]}),o.jsxs("section",{className:"space-y-3",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(j2,{className:"h-4 w-4 text-primary"}),o.jsx("h2",{className:"font-heading text-sm font-bold text-foreground",children:e("3. User Accounts","3. Akaunti za Watumiaji")})]}),o.jsx("p",{className:"text-[13px] leading-[1.75] text-foreground/90",children:e("To access certain features, you must create an account. You are responsible for maintaining the confidentiality of your account credentials and for all activities that occur under your account. You must provide accurate and complete information when creating your account. You must be at least 18 years old to use CLICK.","Ili kufikia vipengele fulani, lazima uunde akaunti. Wewe una jukumu la kudumisha siri ya hati zako za uthibitishaji wa akaunti na kwa shughuli zote zinazotokea chini ya akaunti yako. Lazima utoe taarifa sahihi na kamili unapounda akaunti yako. Lazima uwe na umri wa angalau miaka 18 ili kutumia CLICK.")})]}),o.jsxs("section",{className:"space-y-3",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(b2,{className:"h-4 w-4 text-primary"}),o.jsx("h2",{className:"font-heading text-sm font-bold text-foreground",children:e("4. Acceptable Use","4. Matumizi Yanayokubalika")})]}),o.jsx("p",{className:"text-[13px] leading-[1.75] text-foreground/90",children:e("You agree to use CLICK only for lawful purposes. You may not use the App to: (a) post or transmit any content that is unlawful, threatening, abusive, defamatory, or otherwise objectionable; (b) impersonate any person or entity; (c) interfere with or disrupt the App or servers; (d) attempt to gain unauthorized access to any part of the App; (e) use the App to incite violence, hatred, or discrimination; (f) post misleading or false information about bills, budgets, or civic processes.","Unakubali kutumia CLICK kwa madhumuni ya kisheria tu. Huwezi kutumia Programu kwa: (a) kuchapisha au kutuma maudhui yoyote yasiyo ya kisheria, yenye kutisha, kinyanyasi, au yenye kukashifu; (b) kujifanya kuwa mtu au shirika lingine; (c) kuingilia au kuvuruga Programu au seva; (d) kujaribu kupata ufikiaji usioidhinishwa wa sehemu yoyote ya Programu; (e) kutumia Programu kuchochea vurugu, chuki, au ubaguzi; (f) kuchapisha taarifa zinazopotosha au za uongo kuhusu miswada, bajeti, au michakato ya kiraia.")})]}),o.jsxs("section",{className:"space-y-3",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Ft,{className:"h-4 w-4 text-primary"}),o.jsx("h2",{className:"font-heading text-sm font-bold text-foreground",children:e("5. Intellectual Property","5. Mali ya Kiakili")})]}),o.jsx("p",{className:"text-[13px] leading-[1.75] text-foreground/90",children:e("All content, features, and functionality of CLICK â including text, graphics, logos, icons, images, and software â are the exclusive property of CLICK or its licensors and are protected by
683Kenyan and international copyright, trademark, and other intellectual property laws. You may not reproduce, distribute, modify, or create derivative works from any part of the App without our express written permission.","Maudhui yote, vipengele, na utendaji wa CLICK â ikiwa ni pamoja na maandishi, picha, nembo, iconi, picha, na programu â ni mali ya kipekee ya CLICK au waliotoa leseni na yanalindwa na sheria za hakimiliki, nembo za biashara, na sheria nyingine za mali ya kiakili za Kenya na kimataifa. Huwezi kuiga, kusambaza, kubadilisha, au kuunda kazi zinazotokana na sehemu yoyote ya Programu bila ruhusa yetu ya maandishi.")})]}),o.jsxs("section",{className:"space-y-3",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(ND,{className:"h-4 w-4 text-primary"}),o.jsx("h2",{className:"font-heading text-sm font-bold text-foreground",children:e("6. User-Generated Content","6. Maudhui Yanayotokana na Watumiaji")})]}),o.jsx("p",{className:"text-[13px] leading-[1.75] text-foreground/90",children:e("By posting content on CLICK â including forum discussions, questions, comments, or legal queries â you grant us a non-exclusive, royalty-free, worldwide license to use, reproduce, modify, and display that content for the purpose of operating and improving the App. You represent that you own or have the right to post such content and that it does not violate any third-party rights. We reserve the right to remove any content that violates these terms.","Kwa kuchapisha maudhui kwenye CLICK â ikiwa ni pamoja na mijadala ya jukwaa, maswali, maoni, au maswali ya kisheria â unatupa leseni isiyo ya kipekee, bila malipo, ya kimataifa kutumia, kuiga, kubadilisha, na kuonyesha maudhui hayo kwa madhumuni ya kuendesha na kuboresha Programu. Unawakilisha kwamba unamiliki au una haki ya kuchapisha maudhui hayo na kwamba hayakiuki haki za wahusika wengine. Tunahifadhi haki ya kuondoa maudhui yoyote yanayokiuka masharti haya.")})]}),o.jsxs("section",{className:"space-y-3",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Qu,{className:"h-4 w-4 text-primary"}),o.jsx("h2",{className:"font-heading text-sm font-bold text-foreground",children:e("7. Disclaimer of Warranties","7. Kanusho la Dhamana")})]}),o.jsx("p",{className:"text-[13px] leading-[1.75] text-foreground/90",children:e('CLICK is provided on an "as is" and "as available" basis. We make no warranties, express or implied, regarding the accuracy, reliability, or completeness of any information provided through the App. Civic information is sourced from official Kenyan government channels, but we do not guarantee that it is always current or error-free. You use the App at your own risk.','CLICK inatolewa kwa msingi wa "kama ilivyo" na "kama inavyopatikana". Hatutoi dhamana, za wazi au zilizokusudiwa, kuhusu usahihi, uaminifu, au ukamilifu wa taarifa zozote zinazotolewa kupitia Programu. Taarifa za kiraia zinasomwa kutoka kwenye njia rasmi za serikali ya Kenya, lakini hatuhakikishi kwamba daima zina sasa au hazina makosa. Unatumia Programu kwa hatari yako mwenyewe.')})]}),o.jsxs("section",{className:"space-y-3",children:[o.jsx("h2",{className:"font-heading text-sm font-bold text-foreground",children:e("8. Limitation of Liability","8. Kikomo cha Majukumu")}),o.jsx("p",{className:"text-[13px] leading-[1.75] text-foreground/90",children:e("To the maximum extent permitted by law, CLICK and its creators shall not be liable for any indirect, incidental, special, consequential, or punitive damages arising out of or relating to your use of the App. This includes damages for loss of profits, goodwill, data, or other intangible losses, even if we have been advised of the possibility of such damages.","Kwa kiwango cha juu kinachoruhusiwa kwa sheria, CLICK na waanzilishi wake hawatakuwa na majukumu kwa madhara yoyote ya papo kwa hapo, tukio, maalum, yanayotokana, au ya adhabu yanayotokana na au yanayohusiana na matumizi yako ya Programu. Hii inajumuisha madhara kwa upotevu wa faida, uaminifu, data, au hasara nyingine isiyo na mwili, hata kama tumeshauriwa juu ya uwezekano wa madhara hayo.")})]}),o.jsxs("section",{className:"space-y-3",children:[o.jsx("h2",{className:"font-heading text-sm font-bold text-foreground",children:e("9. Governing Law","9. Sheria Inayotawala")}),o.jsx("p",{className:"text-[13px] leading-[1.75] text-foreground
683/90",children:e("These Terms shall be governed by and construed in accordance with the laws of the Republic of Kenya. Any dispute arising under these Terms shall be subject to the exclusive jurisdiction of the courts of Kenya.","Masharti haya yatatawaliwa na kufasiriwa kulingana na sheria za Jamhuri ya Kenya. Mgomo wowote unaotokana na Masharti haya utakuwa chini ya mamlaka ya kipekee ya mahakama za Kenya.")})]}),o.jsxs("section",{className:"space-y-3",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(x2,{className:"h-4 w-4 text-primary"}),o.jsx("h2",{className:"font-heading text-sm font-bold text-foreground",children:e("10. Changes to Terms","10. Mabadiliko ya Masharti")})]}),o.jsx("p",{className:"text-[13px] leading-[1.75] text-foreground/90",children:e("We reserve the right to modify these Terms at any time. We will notify you of material changes through the App or via email. Your continued use of CLICK after such changes constitutes acceptance of the revised Terms.","Tunahifadhi haki ya kubadilisha Masharti haya wakati wowote. Tutakuarifu juu ya mabadiliko muhimu kupitia Programu au kwa barua pepe. Endelea kutumia CLICK baada ya mabadiliko hayo kunamaanisha kukubaliana na Masharti yaliyorekebishwa.")})]}),o.jsxs("section",{className:"space-y-3",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Qu,{className:"h-4 w-4 text-primary"}),o.jsx("h2",{className:"font-heading text-sm font-bold text-foreground",children:e("11. Termination","11. Kukomesha")})]}),o.jsx("p",{className:"text-[13px] leading-[1.75] text-foreground/90",children:e("We may terminate or suspend your account and access to CLICK immediately, without prior notice, for any reason, including breach of these Terms. Upon termination, your right to use the App will cease immediately. You may also delete your account at any time through your profile settings.","Tunaweza kukomesha au kusimamisha akaunti yako na ufikiaji wa CLICK mara moja, bila ilani ya mapema, kwa sababu yoyote, ikiwa ni pamoja na ukiukaji wa Masharti haya. Baada ya kukomesha, haki yako ya kutumia Programu itakoma mara moja. Unaweza pia kufuta akaunti yako wakati wowote kupitia mipangilio ya wasifu wako.")})]}),o.jsxs("section",{className:"space-y-3",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(py,{className:"h-4 w-4 text-primary"}),o.jsx("h2",{className:"font-heading text-sm font-bold text-foreground",children:e("12. Contact Us","12. Wasiliana Nasi")})]}),o.jsx("p",{className:"text-[13px] leading-[1.75] text-foreground/90",children:e("If you have any questions about these Terms, please contact us through the Help & Support section of the App.","Ikiwa una maswali kuhusu Masharti haya, tafadhali wasiliana nasi kupitia sehemu ya Usaidizi na Msaada ya programu.")})]}),o.jsxs("div",{className:"pt-4 border-t border-border/50 text-[11px] text-muted-foreground text-center",children:[o.jsx("span",{className:"font-heading font-bold text-foreground",children:"CLICK"}),o.jsxs("span",{children:[" · ",e("Kiambu County, Kenya","Kaunti ya Kiambu, Kenya")," · ",e("Built in 2026","Imejengwa 2026")]})]})]}),o.jsx(Ue,{to:"/welcome",children:o.jsx(Q,{variant:"outline",size:"sm",className:"w-full text-xs",children:e("View intro & onboarding guide","Tazama utangulizi na mwongozo")})})]})},aie=new iB,iie=()=>o.jsx(PT,{to:"/welcome",replace:!0}),rie=()=>o.jsx(uB,{client:aie,children:o.jsx(SK,{children:o.jsxs(FF,{children:[o.jsx(jz,{}),o.jsx(t4,{}),o.jsx(wK,{children:o.jsx(eG,{children:o.jsxs(cK,{children:[o.jsx(ut,{path:"/",element:o.jsx(iie,{})}),o.jsx(ut,{path:"/home",element:o.jsx(ine,{})}),o.jsx(ut,{path:"/welcome",element:o.jsx(Hte,{})}),o.jsx(ut,{path:"/help",element:o.jsx(qte,{})}),o.jsx(ut,{path:"/bills",element:o.jsx(lZ,{})}),o.jsx(ut,{path:"/budget",element:o.jsx(uZ,{})}),o.jsx(ut,{path:"/item/:slug",element:o.jsx(wee,{})}),o.jsx(ut,{path:"/events",element:o.jsx(xee,{})}),o.jsx(ut,{path:"/legal-qa",element:o.jsx(zee,{})}),o.jsx(ut,{path:"/feed",element:o.jsx(Fee,{})}),o.jsx(ut,{path:"/settings",element:o.jsx($ee,{})}),o.jsx(ut,{path:"/about",element:o.jsx(Uee,{})}),o.jsx(ut,{path:"/admin",element:o.jsx(Ute,{allowedRoles:["admin"],children:o.jsx(Fte,{})})}),o.jsx(ut,{path:"/lawyer",element:o.jsx(Vte,{})}),o.jsx(ut,{path:"/ask-lawyer",element:o.jsx(Dne,{})}),o.jsx(ut,{path:"/guides",element:o.jsx(zne,{})}),o.jsx(ut,{path:"/uko-kadi",element:o.jsx($ne,{})}),o.jsx(ut,{path:"/manifesto-match",element:o.jsx(Nae,{})}),o.jsx(ut,{path:"/civic-score",element:o.jsx(zae,{})}),o.jsx(ut,{path:"/my-money",element:o.jsx(Zae,{})}),o.jsx(ut,{path:"/reset-password",element:o.jsx(rne,{})}),o.jsx(ut,{path:"/privacy-policy",element:o.jsx(tie,{})}),o.jsx(ut,{path:"/terms-of-service",element:o.jsx(nie,{})}),o.jsx(ut,{path:"*",element:o.jsx(eie,{})})]})})})]})})});DC(document.getElementById("root")).render(o.jsx(rie,{}))});export default sie();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.